Commit de7cede0 authored by Jody Goldberg's avatar Jody Goldberg
Browse files

- Handle missing args

- Adjust guess at contrast selection for XL import.
- more work on escher streams.
parent 4dabd5c5
1999-09-24 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_decode_tree) : Handle missing arguments.
1999-09-23 Morten Welinder <terra@diku.dk>
* src/widgets/widget-color-combo.c (color_combo_construct):
......
1999-09-24 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_decode_tree) : Handle missing arguments.
1999-09-23 Morten Welinder <terra@diku.dk>
* src/widgets/widget-color-combo.c (color_combo_construct):
......
1999-09-24 Jody Goldberg <jgoldberg@home.com>
* ms-excel-read.c (ms_excel_palette_get) : Change my guess
at what metric to use when selecting white vs black as a contrasting
colour. Use component discrete, rather than a crude luminosity.
1999-09-23 Michael Meeks <michael@nuclecu.unam.mx>
* ole.c (enter_dir): Change logic.
......
......@@ -23,7 +23,7 @@ extern int ms_excel_write_workbook (MsOle *file, Workbook *wb,
/* We need to use these for both read and write */
typedef struct {
int b, g, r;
int r, g, b;
} EXCEL_PALETTE_ENTRY;
extern EXCEL_PALETTE_ENTRY const excel_default_palette[];
#define EXCEL_DEF_PAL_LEN 56
......
This diff is collapsed.
......@@ -743,31 +743,29 @@ EXCEL_PALETTE_ENTRY const excel_default_palette[EXCEL_DEF_PAL_LEN] = {
/* These were generated by creating a sheet and
* modifying the 1st color cell and saving. This
* created a custom palette. I then loaded the sheet
* into gnumeric and dumped the results. Unfortunately
* there was a bug in the extraction that swapped the
* red and blue. It is too much effort to retype this.
* So I'll leave it in this odd format for now.
* into gnumeric and dumped the results.
*/
{ 0, 0, 0}, {255,255,255}, { 0, 0,255}, { 0,255, 0},
{255, 0, 0}, { 0,255,255}, {255, 0,255}, {255,255, 0},
{ 0, 0, 0}, {255,255,255}, {255, 0, 0}, { 0,255, 0},
{ 0, 0,255}, {255,255, 0}, {255, 0,255}, { 0,255,255},
{ 0, 0,128}, { 0,128,0}, {128, 0, 0}, { 0,128,128},
{128, 0,128}, {128,128,0}, {192,192,192}, {128,128,128},
{128, 0, 0}, { 0,128, 0}, { 0, 0,128}, {128,128, 0},
{128, 0,128}, { 0,128,128}, {192,192,192}, {128,128,128},
{255,153,153}, {102, 51,153}, {204,255,255}, {255,255,204},
{102, 0,102}, {128,128,255}, {204,102, 0}, {255,204,204},
{153,153,255}, {153, 51,102}, {255,255,204}, {204,255,255},
{102, 0,102}, {255,128,128}, { 0,102,204}, {204,204,255},
{128, 0, 0}, {255, 0,255}, { 0,255,255}, {255,255, 0},
{128, 0,128}, { 0, 0,128}, {128,128, 0}, {255, 0, 0},
{ 0, 0,128}, {255, 0,255}, {255,255, 0}, { 0,255,255},
{128, 0,128}, {128, 0, 0}, { 0,128,128}, { 0, 0,255},
{255,204, 0}, {255,255,204}, {204,255,204}, {153,255,255},
{255,204,153}, {204,153,255}, {255,153,204}, {153,204,255},
{ 0,204,255}, {204,255,255}, {204,255,204}, {255,255,153},
{153,204,255}, {255,153,204}, {204,153,255}, {255,204,153},
{255,102, 51}, {204,204, 51}, { 0,204,153}, { 0,204,255},
{ 0,153,255}, { 0,102,255}, {153,102,102}, {150,150,150},
{ 51,102,255}, { 51,204,204}, {153,204, 0}, {255,204, 0},
{255,153, 0}, {255,102, 0}, {102,102,153}, {150,150,150},
{ 0, 51,102}, { 51,153,102}, { 0, 51, 0}, { 51, 51, 0},
{153, 51, 0}, {153, 51,102}, { 51, 51,153}, { 51, 51, 51}
{102, 51, 0}, {102,153, 51}, { 0, 51, 0}, { 0, 51, 51},
{ 0, 51,153}, {102, 51,153}, {153, 51, 51}, { 51, 51, 51}
};
static ExcelPalette *
......@@ -870,16 +868,16 @@ ms_excel_palette_get (ExcelPalette *pal, guint idx, StyleColor *contrast)
* on this VERY loose metric.
*/
int const guess =
contrast->color.red +
contrast->color.green +
contrast->color.blue;
((contrast->color.red > 0x7fff) ? 1 : -1) +
((contrast->color.green > 0x7fff) ? 1 : -1) +
((contrast->color.blue> 0x7fff) ? 1 : -1);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_color_debug > 1) {
printf ("Contrast : %d\n", guess);
}
#endif
if (guess <= (0x7fff + 0x8000 + 0x7fff)) {
if (guess < 0) {
#ifndef NO_DEBUG_EXCEL
if (ms_excel_color_debug > 1) {
puts("White");
......@@ -889,7 +887,7 @@ ms_excel_palette_get (ExcelPalette *pal, guint idx, StyleColor *contrast)
}
}
#ifndef NO_DEBUG_EXCEL
if (ms_excel_color_debug > 1) {
else if (ms_excel_color_debug > 1) {
puts("No contrast default to Black");
}
#endif
......
......@@ -1354,6 +1354,9 @@ do_expr_decode_tree (ExprTree *tree, const ParsePosition *pp,
/* FIXME: handle quotes in string. */
return g_strconcat ("\"", v->v.str->str, "\"", NULL);
case VALUE_EMPTY:
return g_strdup ("");
case VALUE_ERROR:
return g_strdup (v->v.error.mesg->str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment