[gnumeric] xlsx: hook up hsl modifications too.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: hook up hsl modifications too.
- Date: Mon, 30 Mar 2015 22:14:05 +0000 (UTC)
commit 1800ba94c4fedaac68d6d1d5997f2ec29cd57b7c
Author: Morten Welinder <terra gnome org>
Date: Mon Mar 30 18:02:14 2015 -0400
xlsx: hook up hsl modifications too.
We should get a warning when someone actually uses this.
plugins/excel/ChangeLog | 1 +
plugins/excel/xlsx-read-drawing.c | 34 ++++++++++++++++++++++++----------
2 files changed, 25 insertions(+), 10 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 1eca1e9..a1aa913 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -2,6 +2,7 @@
* xlsx-read-drawing.c (xlsx_draw_color_rgba_channel): Rename from
xlsx_draw_color_alpha. Handle all four channels.
+ (xlsx_draw_color_hsl_channel): Hook up hue-sat-lum modification.
2015-03-30 Jean Brefort <jean brefort normalesup org>
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index f2fa2d1..f82ea7c 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -2015,7 +2015,7 @@ xlsx_draw_color_rgba_channel (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
guint action = xin->node->user_data.v_int & 3;
- guint channel = xin->node->user_data.v_int >> 2;
+ guint channel = xin->node->user_data.v_int >> 2; /* a=3, r=2, g=1, b=0 */
int val;
if (simple_int (xin, attrs, &val)) {
const double f = val / 100000.0;
@@ -2048,6 +2048,20 @@ xlsx_draw_color_rgba_channel (GsfXMLIn *xin, xmlChar const **attrs)
}
static void
+xlsx_draw_color_hsl_channel (GsfXMLIn *xin, xmlChar const **attrs)
+{
+ XLSXReadState *state = (XLSXReadState *)xin->user_state;
+ guint action = xin->node->user_data.v_int & 3;
+ guint channel = xin->node->user_data.v_int >> 2; /* hue=2, sat=1, lum=0 */
+ int val;
+ if (simple_int (xin, attrs, &val)) {
+ g_warning ("Unhandling hsl colour modification %d %d for #%08x",
+ action, channel, state->color);
+ }
+}
+
+
+static void
xlsx_draw_color_shade (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
@@ -2363,15 +2377,15 @@ xlsx_ext_gostyle (GsfXMLIn *xin, xmlChar const **attrs)
COLOR_MODIFIER_NODE(parent, COLOR_ALPHA, "alpha", first, &xlsx_draw_color_rgba_channel, 12), \
COLOR_MODIFIER_NODE(parent, COLOR_ALPHA_OFF, "alphaOff", first, &xlsx_draw_color_rgba_channel, 13), \
COLOR_MODIFIER_NODE(parent, COLOR_ALPHA_MOD, "alphaMod", first, &xlsx_draw_color_rgba_channel, 14), \
- COLOR_MODIFIER_NODE(parent, COLOR_HUE, "hue", first, NULL, 0), \
- COLOR_MODIFIER_NODE(parent, COLOR_HUE_OFF, "hueOff", first, NULL, 1), \
- COLOR_MODIFIER_NODE(parent, COLOR_HUE_MOD, "hueMod", first, NULL, 2), \
- COLOR_MODIFIER_NODE(parent, COLOR_SAT, "sat", first, NULL, 0), \
- COLOR_MODIFIER_NODE(parent, COLOR_SAT_OFF, "satOff", first, NULL, 1), \
- COLOR_MODIFIER_NODE(parent, COLOR_SAT_MOD, "satMod", first, NULL, 2), \
- COLOR_MODIFIER_NODE(parent, COLOR_LUM, "lum", first, NULL, 0), \
- COLOR_MODIFIER_NODE(parent, COLOR_LUM_OFF, "lumOff", first, NULL, 1), \
- COLOR_MODIFIER_NODE(parent, COLOR_LUM_MOD, "lumMod", first, NULL, 2), \
+ COLOR_MODIFIER_NODE(parent, COLOR_HUE, "hue", first, xlsx_draw_color_hsl_channel, 8), \
+ COLOR_MODIFIER_NODE(parent, COLOR_HUE_OFF, "hueOff", first, xlsx_draw_color_hsl_channel, 9), \
+ COLOR_MODIFIER_NODE(parent, COLOR_HUE_MOD, "hueMod", first, xlsx_draw_color_hsl_channel, 10), \
+ COLOR_MODIFIER_NODE(parent, COLOR_SAT, "sat", first, xlsx_draw_color_hsl_channel, 4), \
+ COLOR_MODIFIER_NODE(parent, COLOR_SAT_OFF, "satOff", first, xlsx_draw_color_hsl_channel, 5), \
+ COLOR_MODIFIER_NODE(parent, COLOR_SAT_MOD, "satMod", first, xlsx_draw_color_hsl_channel, 6), \
+ COLOR_MODIFIER_NODE(parent, COLOR_LUM, "lum", first, xlsx_draw_color_hsl_channel, 0), \
+ COLOR_MODIFIER_NODE(parent, COLOR_LUM_OFF, "lumOff", first, xlsx_draw_color_hsl_channel, 1), \
+ COLOR_MODIFIER_NODE(parent, COLOR_LUM_MOD, "lumMod", first, xlsx_draw_color_hsl_channel, 2), \
COLOR_MODIFIER_NODE(parent, COLOR_RED, "red", first, &xlsx_draw_color_rgba_channel, 8), \
COLOR_MODIFIER_NODE(parent, COLOR_RED_OFF, "redOff", first, &xlsx_draw_color_rgba_channel, 9), \
COLOR_MODIFIER_NODE(parent, COLOR_RED_MOD, "redMod", first, &xlsx_draw_color_rgba_channel, 10), \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]