[gnumeric] Support semi-transparent fonts in cells. [#678176]
- From: Jean BrÃfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Support semi-transparent fonts in cells. [#678176]
- Date: Wed, 1 Aug 2012 13:07:47 +0000 (UTC)
commit 6943edd3a43bb3fd312befbfd77bf74f2d77999b
Author: Jean Brefort <jean brefort normalesup org>
Date: Wed Aug 1 15:07:31 2012 +0200
Support semi-transparent fonts in cells. [#678176]
ChangeLog | 14 ++++++++++++++
NEWS | 1 +
plugins/applix/ChangeLog | 4 ++++
plugins/applix/applix-read.c | 2 +-
plugins/excel/ChangeLog | 5 +++++
plugins/excel/excel-xml-read.c | 2 +-
plugins/excel/ms-excel-read.c | 25 +++++++++++++------------
plugins/lotus-123/ChangeLog | 4 ++++
plugins/lotus-123/lotus.c | 12 ++++++------
plugins/openoffice/ChangeLog | 4 ++++
plugins/openoffice/openoffice-read.c | 2 +-
plugins/psiconv/ChangeLog | 4 ++++
plugins/psiconv/psiconv-read.c | 2 +-
plugins/qpro/ChangeLog | 4 ++++
plugins/qpro/qpro-read.c | 2 +-
src/dialogs/ChangeLog | 5 +++++
src/dialogs/dialog-cell-format.c | 16 ++++++++++------
src/sheet-style.c | 2 +-
src/style-border.c | 4 ++--
src/style-color.c | 24 +++++++++++++++---------
src/style-color.h | 5 +++--
src/tools/ChangeLog | 4 ++++
src/tools/gnm-solver.c | 2 +-
src/wbc-gtk.c | 1 +
src/xml-sax-read.c | 6 +++---
25 files changed, 109 insertions(+), 47 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bbc3f11..80a5e4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * src/sheet-style.c (sheet_style_init_size): Rename style_color_new_i8 and
+ style_color_new_i16 and add an alpha aware version.
+ * src/style-border.c (style_border_equal), (style_border_hash): ditto.
+ * src/style-color.c (style_color_new_rgba16),
+ (style_color_new_pango), (style_color_new_gdk),
+ (style_color_new_rgba8), (style_color_new_rgb8),
+ (style_color_black), (style_color_white), (style_color_grid): ditto.
+ * src/style-color.h: ditto.
+ * src/wbc-gtk.c (wbc_gtk_init_color_fore): add alpha channel support.
+ [#678176]
+ * src/xml-sax-read.c (xml_sax_attr_color): load font alpha channel.
+
2012-07-30 Morten Welinder <terra gnome org>
* src/application.c (gnm_app_recalc): New function. (After almost
diff --git a/NEWS b/NEWS
index 8f9382b..8d247a2 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Andreas:
Jean:
* Fix component references issues. [#680190]
* Fix linear averaging interpolation. [#680723][#680918]
+ * Support semi-transparent fonts in cells. [#678176]
Morten:
* Fix xls read crash. [#679992]
diff --git a/plugins/applix/ChangeLog b/plugins/applix/ChangeLog
index a491bcc..0a11ba9 100644
--- a/plugins/applix/ChangeLog
+++ b/plugins/applix/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * applix-read.c (applix_read_colormap): Rename style_color_new_i8.
+
2012-07-15 Morten Welinder <terra gnome org>
* Release 1.11.5
diff --git a/plugins/applix/applix-read.c b/plugins/applix/applix-read.c
index aeda6b5..8427a29 100644
--- a/plugins/applix/applix-read.c
+++ b/plugins/applix/applix-read.c
@@ -397,7 +397,7 @@ applix_read_colormap (ApplixReadState *state)
/* Store the result */
g_ptr_array_add (state->colors,
- style_color_new_i8 (r, g, b));
+ style_color_new_rgb8 (r, g, b));
#if 0
printf ("'%s' %ld %ld %ld %ld\n", buffer, numbers[1],
numbers[2], numbers[3], numbers[4]);
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index f5aea8e..07aeb22 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * excel-xml-read.c (parse_color): Rename style_color_new_i8.
+ * ms-excel-read.c (excel_palette_get), (excel_read_WINDOW2): ditto.
+
2012-07-18 Morten Welinder <terra gnome org>
* ms-excel-read.c (excel_read_LABEL): Fix crash [#679992].
diff --git a/plugins/excel/excel-xml-read.c b/plugins/excel/excel-xml-read.c
index 7b5d011..05274b9 100644
--- a/plugins/excel/excel-xml-read.c
+++ b/plugins/excel/excel-xml-read.c
@@ -230,7 +230,7 @@ parse_color (GsfXMLIn *xin, xmlChar const *str, char const *name)
g_return_val_if_fail (str != NULL, NULL);
if (3 == sscanf (str, "#%2x%2x%2x", &r, &g, &b))
- return style_color_new_i8 (r, g, b);
+ return style_color_new_rgb8 (r, g, b);
xl_xml_warning (xin, "Invalid attribute '%s', expected color, received '%s'",
name, str);
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index dd55c63..bdc5161 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -1858,12 +1858,12 @@ excel_palette_get (GnmXLImporter *importer, gint idx)
case 80 : /* tooltip background */
return style_color_new_gdk (&gs_yellow);
- case 2 : return style_color_new_i8 (0xff, 0, 0); /* red */
- case 3 : return style_color_new_i8 ( 0, 0xff, 0); /* green */
- case 4 : return style_color_new_i8 ( 0, 0, 0xff); /* blue */
- case 5 : return style_color_new_i8 (0xff, 0xff, 0); /* yellow */
- case 6 : return style_color_new_i8 (0xff, 0, 0xff); /* magenta */
- case 7 : return style_color_new_i8 ( 0, 0xff, 0xff); /* cyan */
+ case 2 : return style_color_new_rgb8 (0xff, 0, 0); /* red */
+ case 3 : return style_color_new_rgb8 ( 0, 0xff, 0); /* green */
+ case 4 : return style_color_new_rgb8 ( 0, 0, 0xff); /* blue */
+ case 5 : return style_color_new_rgb8 (0xff, 0xff, 0); /* yellow */
+ case 6 : return style_color_new_rgb8 (0xff, 0, 0xff); /* magenta */
+ case 7 : return style_color_new_rgb8 ( 0, 0xff, 0xff); /* cyan */
default :
break;
}
@@ -1877,18 +1877,19 @@ excel_palette_get (GnmXLImporter *importer, gint idx)
if (pal->gnm_colors[idx] == NULL) {
pal->gnm_colors[idx] =
- style_color_new_i8 ((guint8) pal->red[idx],
- (guint8) pal->green[idx],
- (guint8) pal->blue[idx]);
+ style_color_new_rgb8 (pal->red[idx],
+ pal->green[idx],
+ pal->blue[idx]);
g_return_val_if_fail (pal->gnm_colors[idx],
style_color_black ());
d (5, {
const GnmColor *c = pal->gnm_colors[idx];
- g_printerr ("New color in slot %d: RGB= %x,%x,%x\n",
+ g_printerr ("New color in slot %d: RGBA = %x,%x,%x,%x\n",
idx,
GO_COLOR_UINT_R (c->go_color),
GO_COLOR_UINT_G (c->go_color),
- GO_COLOR_UINT_B (c->go_color));
+ GO_COLOR_UINT_B (c->go_color),
+ GO_COLOR_UINT_A (c->go_color));
});
}
@@ -5096,7 +5097,7 @@ excel_read_WINDOW2 (BiffQuery *q, ExcelReadSheet *esheet, WorkbookView *wb_view)
r = (guint8) biff_pat_col;
g = (guint8) (biff_pat_col >> 8);
b = (guint8) (biff_pat_col >> 16);
- pattern_color = style_color_new_i8 (r, g, b);
+ pattern_color = style_color_new_rgb8 (r, g, b);
}
d (2, g_printerr ("auto pattern color "
"0x%08x\n",
diff --git a/plugins/lotus-123/ChangeLog b/plugins/lotus-123/ChangeLog
index bc8584b..03936b3 100644
--- a/plugins/lotus-123/ChangeLog
+++ b/plugins/lotus-123/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * lotus.c (lotus_color), (works_color): Rename style_color_new_i8.
+
2012-07-15 Morten Welinder <terra gnome org>
* Release 1.11.5
diff --git a/plugins/lotus-123/lotus.c b/plugins/lotus-123/lotus.c
index 53e4435..2c46787 100644
--- a/plugins/lotus-123/lotus.c
+++ b/plugins/lotus-123/lotus.c
@@ -526,9 +526,9 @@ static GnmColor *
lotus_color (guint i)
{
if (i < G_N_ELEMENTS (lotus_color_table))
- return style_color_new_i8 (lotus_color_table[i][0],
- lotus_color_table[i][1],
- lotus_color_table[i][2]);
+ return style_color_new_rgb8 (lotus_color_table[i][0],
+ lotus_color_table[i][1],
+ lotus_color_table[i][2]);
switch (i) {
case 240:
g_warning ("Unhandled \"3D face\" color.");
@@ -2496,9 +2496,9 @@ works_color (guint i)
{
if (i == 0) return style_color_auto_font();
if (i < G_N_ELEMENTS (works_color_table))
- return style_color_new_i8 (works_color_table[i][0],
- works_color_table[i][1],
- works_color_table[i][2]);
+ return style_color_new_rgb8 (works_color_table[i][0],
+ works_color_table[i][1],
+ works_color_table[i][2]);
return NULL;
}
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index ff5dbe9..28b2a39 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * openoffice-read.c (oo_parse_color): Rename style_color_new_i8.
+
2012-07-15 Morten Welinder <terra gnome org>
* Release 1.11.5
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 14291fb..6c90f30 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -695,7 +695,7 @@ oo_parse_color (GsfXMLIn *xin, xmlChar const *str, char const *name)
g_return_val_if_fail (str != NULL, NULL);
if (3 == sscanf (CXML2C (str), "#%2x%2x%2x", &r, &g, &b))
- return style_color_new_i8 (r, g, b);
+ return style_color_new_rgb8 (r, g, b);
if (0 == strcmp (CXML2C (str), "transparent"))
return style_color_ref (magic_transparent);
diff --git a/plugins/psiconv/ChangeLog b/plugins/psiconv/ChangeLog
index 30d42c6..9cf17f3 100644
--- a/plugins/psiconv/ChangeLog
+++ b/plugins/psiconv/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * psiconv-read.c (get_color): Rename style_color_new_i8.
+
2012-07-15 Morten Welinder <terra gnome org>
* Release 1.11.5
diff --git a/plugins/psiconv/psiconv-read.c b/plugins/psiconv/psiconv-read.c
index 39f559d..b1fd792 100644
--- a/plugins/psiconv/psiconv-read.c
+++ b/plugins/psiconv/psiconv-read.c
@@ -179,7 +179,7 @@ set_format(GnmStyle *style, const psiconv_sheet_numberformat psi_numberformat)
static GnmColor *
get_color(const psiconv_color color)
{
- return style_color_new_i8 (color->red, color->green, color->blue);
+ return style_color_new_rgb8 (color->red, color->green, color->blue);
}
static void
diff --git a/plugins/qpro/ChangeLog b/plugins/qpro/ChangeLog
index fd01dac..37179ba 100644
--- a/plugins/qpro/ChangeLog
+++ b/plugins/qpro/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * qpro-read.c (qpro_read_sheet): Rename style_color_new_i8.
+
2012-07-15 Morten Welinder <terra gnome org>
* Release 1.11.5
diff --git a/plugins/qpro/qpro-read.c b/plugins/qpro/qpro-read.c
index a7886ea..84db919 100644
--- a/plugins/qpro/qpro-read.c
+++ b/plugins/qpro/qpro-read.c
@@ -849,7 +849,7 @@ qpro_read_sheet (QProReadState *state)
case QPRO_PAGE_TAB_COLOR :
if (validate (QPRO_PAGE_TAB_COLOR, 4)) {
- GnmColor *bc = style_color_new_i8 (
+ GnmColor *bc = style_color_new_rgb8 (
data[0], data[1], data[2]);
g_object_set (sheet,
"tab-background", bc,
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 612d422..e4beb32 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * dialog-cell-format.c (setup_color_pickers), (border_get_mstyle),
+ (fmt_dialog_impl): Rename style_color_new_i8.
+
2012-07-15 Morten Welinder <terra gnome org>
* Release 1.11.5
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 6dd3d58..1b7a17c 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -358,7 +358,8 @@ setup_color_pickers (FormatState *state,
char const *default_caption,
char const *caption,
GCallback preview_update,
- GnmStyleElement e)
+ GnmStyleElement e,
+ gboolean allow_alpha)
{
GtkWidget *combo, *w, *frame;
GOColorGroup *cg;
@@ -406,6 +407,8 @@ setup_color_pickers (FormatState *state,
else
go_combo_color_set_color_to_default (GO_COMBO_COLOR (combo));
+ if (allow_alpha)
+ go_combo_color_set_allow_alpha (GO_COMBO_COLOR (combo), TRUE);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_add (GTK_CONTAINER (frame), combo);
@@ -1090,7 +1093,8 @@ border_get_mstyle (FormatState const *state, GnmStyleBorderLocation const loc)
guint8 const r = (guint8) (edge->rgba >> 24);
guint8 const g = (guint8) (edge->rgba >> 16);
guint8 const b = (guint8) (edge->rgba >> 8);
- color = style_color_new_i8 (r, g, b);
+ guint8 const a = (guint8) (edge->rgba >> 0);
+ color = style_color_new_rgba8 (r, g, b, a);
}
return gnm_style_border_fetch
(state->border.edge[loc].pattern_index, color,
@@ -2278,19 +2282,19 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
setup_color_pickers (state, &state->border.color, "border_color_group",
"border-grid", 2, 3, "border_color_label",
_("Automatic"), _("Border"),
- G_CALLBACK (cb_border_color), MSTYLE_BORDER_TOP);
+ G_CALLBACK (cb_border_color), MSTYLE_BORDER_TOP, FALSE);
setup_color_pickers (state, NULL, "fore_color_group",
"font-grid", 1, 2, "font_color_label",
_("Automatic"), _("Foreground"),
- G_CALLBACK (cb_font_preview_color), MSTYLE_FONT_COLOR);
+ G_CALLBACK (cb_font_preview_color), MSTYLE_FONT_COLOR, TRUE);
setup_color_pickers (state, &state->back.back_color, "back_color_group",
"background-grid", 1, 1, "back_color_label",
_("Clear Background"), _("Background"),
- G_CALLBACK (cb_back_preview_color), MSTYLE_COLOR_BACK);
+ G_CALLBACK (cb_back_preview_color), MSTYLE_COLOR_BACK, FALSE);
setup_color_pickers (state, &state->back.pattern_color, "pattern_color_group",
"background-grid", 1, 3, "pattern_color_label",
_("Automatic"), _("Pattern"),
- G_CALLBACK (cb_pattern_preview_color), MSTYLE_COLOR_PATTERN);
+ G_CALLBACK (cb_pattern_preview_color), MSTYLE_COLOR_PATTERN, FALSE);
/* Setup the border images */
for (i = 0; (name = border_buttons[i]) != NULL; ++i) {
diff --git a/src/sheet-style.c b/src/sheet-style.c
index 952c94e..a97c820 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -656,7 +656,7 @@ sheet_style_init_size (Sheet *sheet, int cols, int rows)
* 'none' by default. Then displays that as white. */
if (sheet->sheet_type == GNM_SHEET_OBJECT) {
gnm_style_set_back_color (default_style,
- style_color_new_i8 (0x50, 0x50, 0x50));
+ style_color_new_rgb8 (0x50, 0x50, 0x50));
gnm_style_set_pattern (default_style, 1);
}
#endif
diff --git a/src/style-border.c b/src/style-border.c
index 84a25c3..77fedb5 100644
--- a/src/style-border.c
+++ b/src/style-border.c
@@ -113,7 +113,7 @@ style_border_equal (gconstpointer v1, gconstpointer v2)
/*
* ->color is a pointer, but the comparison is safe because
- * all colours are cached, see style_color_new_i16.
+ * all colours are cached, see style_color_new_go.
*/
return (k1->color == k2->color) &&
(k1->line_type == k2->line_type);
@@ -128,7 +128,7 @@ style_border_hash (gconstpointer v)
* HACK ALERT!
*
* ->color is a pointer, but the comparison is safe because
- * all colours are cached, see style_color_new_i16.
+ * all colours are cached, see style_color_new_go.
*
*/
return (GPOINTER_TO_UINT(b->color) ^ b->line_type);
diff --git a/src/style-color.c b/src/style-color.c
index 4e5af9a..ceec79a 100644
--- a/src/style-color.c
+++ b/src/style-color.c
@@ -46,15 +46,15 @@ style_color_new_uninterned (GOColor c, gboolean is_auto)
}
GnmColor *
-style_color_new_i16 (gushort red, gushort green, gushort blue)
+style_color_new_rgba16 (gushort red, gushort green, gushort blue, gushort alpha)
{
- return style_color_new_i8 (red >> 8, green >> 8, blue >> 8);
+ return style_color_new_rgba8 (red >> 8, green >> 8, blue >> 8, alpha >> 8);
}
GnmColor *
style_color_new_pango (PangoColor const *c)
{
- return style_color_new_i16 (c->red, c->green, c->blue);
+ return style_color_new_rgba16 (c->red, c->green, c->blue, 0xffff);
}
GnmColor *
@@ -72,13 +72,19 @@ style_color_new_gdk (GdkRGBA const *c)
guint8 b8 = CLAMP (c->blue * 256, 0, 255);
guint8 a8 = CLAMP (c->alpha * 256, 0, 255);
- return style_color_new_go (GO_COLOR_FROM_RGBA (r8, g8, b8, a8));
+ return style_color_new_rgba8 (r8, g8, b8, a8);
}
GnmColor *
-style_color_new_i8 (guint8 red, guint8 green, guint8 blue)
+style_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha)
{
- return style_color_new_go (GO_COLOR_FROM_RGBA (red, green, blue, 0xff));
+ return style_color_new_go (GO_COLOR_FROM_RGBA (red, green, blue, alpha));
+}
+
+GnmColor *
+style_color_new_rgb8 (guint8 red, guint8 green, guint8 blue)
+{
+ return style_color_new_rgba8 (red, green, blue, 0xff);
}
GnmColor *
@@ -104,7 +110,7 @@ GnmColor *
style_color_black (void)
{
if (!sc_black)
- sc_black = style_color_new_i8 (0, 0, 0);
+ sc_black = style_color_new_rgb8 (0, 0, 0);
return style_color_ref (sc_black);
}
@@ -112,7 +118,7 @@ GnmColor *
style_color_white (void)
{
if (!sc_white)
- sc_white = style_color_new_i8 (0xff, 0xff, 0xff);
+ sc_white = style_color_new_rgb8 (0xff, 0xff, 0xff);
return style_color_ref (sc_white);
}
@@ -120,7 +126,7 @@ GnmColor *
style_color_grid (void)
{
if (!sc_grid)
- sc_grid = style_color_new_i8 (0xc7, 0xc7, 0xc7);
+ sc_grid = style_color_new_rgb8 (0xc7, 0xc7, 0xc7);
return style_color_ref (sc_grid);
}
diff --git a/src/style-color.h b/src/style-color.h
index 71e2788..1ff47cf 100644
--- a/src/style-color.h
+++ b/src/style-color.h
@@ -28,8 +28,9 @@ GNM_VAR_DECL GdkRGBA gs_yellow;
GnmColor *style_color_new_go (GOColor c);
GnmColor *style_color_new_name (char const *name);
-GnmColor *style_color_new_i16 (gushort red, gushort green, gushort blue);
-GnmColor *style_color_new_i8 (guint8 red, guint8 green, guint8 blue);
+GnmColor *style_color_new_rgba16(gushort red, gushort green, gushort blue, gushort alpha);
+GnmColor *style_color_new_rgb8 (guint8 red, guint8 green, guint8 blue);
+GnmColor *style_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha);
GnmColor *style_color_new_pango (PangoColor const *c);
GnmColor *style_color_new_gdk (GdkRGBA const *c);
GnmColor *style_color_auto_font (void);
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index 6aa2c42..fa85e9f 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-01 Jean Brefort <jean brefort normalesup org>
+
+ * gnm-solver.c: Rename style_color_new_i8.
+
2012-07-28 Andreas J. Guelzow <aguelzow pyrshep ca>
* analysis-kaplan-meier.c (analysis_tool_kaplan_meier_engine_run):
diff --git a/src/tools/gnm-solver.c b/src/tools/gnm-solver.c
index b4277b1..b2afc96 100644
--- a/src/tools/gnm-solver.c
+++ b/src/tools/gnm-solver.c
@@ -1402,7 +1402,7 @@ gnm_solver_get_limits (GnmSolver *solver, gnm_float **pmin, gnm_float **pmax)
do { \
int c = (col_); \
dao_set_colors (dao, c, R, c, R, \
- style_color_new_i8 (255, 0, 0), \
+ style_color_new_rgb8 (255, 0, 0), \
NULL); \
} while (0)
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 723581f..277c3d5 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -3251,6 +3251,7 @@ wbc_gtk_init_color_fore (WBCGtk *gtk)
gtk->fore_color = go_action_combo_color_new ("ColorFore", "font",
_("Automatic"), default_color, NULL); /* set group to view */
+ go_action_combo_color_set_allow_alpha (gtk->fore_color, TRUE);
g_object_set (G_OBJECT (gtk->fore_color),
"label", _("Foreground"),
"tooltip", _("Foreground"),
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index cd03fe0..fe4ea9b 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -253,7 +253,7 @@ xml_sax_attr_cellpos (xmlChar const * const *attrs, char const *name, GnmCellPos
static gboolean
xml_sax_attr_color (xmlChar const * const *attrs, char const *name, GnmColor **res)
{
- unsigned int red, green, blue;
+ unsigned int red, green, blue, alpha = 0xffff;
g_return_val_if_fail (attrs != NULL, FALSE);
g_return_val_if_fail (attrs[0] != NULL, FALSE);
@@ -262,12 +262,12 @@ xml_sax_attr_color (xmlChar const * const *attrs, char const *name, GnmColor **r
if (strcmp (CXML2C (attrs[0]), name))
return FALSE;
- if (sscanf (CXML2C (attrs[1]), "%X:%X:%X", &red, &green, &blue) != 3){
+ if (sscanf (CXML2C (attrs[1]), "%X:%X:%X:%X", &red, &green, &blue, &alpha) < 3){
g_warning ("Invalid attribute '%s', expected colour, received '%s'",
name, attrs[1]);
return FALSE;
}
- *res = style_color_new_i16 (red, green, blue);
+ *res = style_color_new_rgba16 (red, green, blue, alpha);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]