[gnumeric] ods: read text colour of chart titles etc.



commit 61b574563187b025b0aba4af64250619ef32e9f7
Author: Morten Welinder <terra gnome org>
Date:   Fri May 9 15:02:13 2014 -0400

    ods: read text colour of chart titles etc.

 plugins/openoffice/ChangeLog         |    2 ++
 plugins/openoffice/openoffice-read.c |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 9c18300..639ea05 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,7 @@
 2014-05-09  Morten Welinder  <terra gnome org>
 
+       * openoffice-read.c (od_style_prop_chart): Read text colour.
+
        * openoffice-write.c (odf_write_gog_style_text): Write text colour
        as appropriate.
 
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index be4da8f..84bfbfd 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -863,6 +863,11 @@ odf_apply_style_props (GsfXMLIn *xin, GSList *props, GOStyle *style)
                } else if (0 == strcmp (prop->name, "gnm-auto-color")) {
                        gnm_auto_color_value_set = TRUE;
                        gnm_auto_color_value = g_value_get_boolean (&prop->value);
+               } else if (0 == strcmp (prop->name, "color")) {
+                       GdkRGBA rgba;
+                       gchar const *color = g_value_get_string (&prop->value);
+                       if (gdk_rgba_parse (&rgba, color))
+                               go_color_from_gdk_rgba (&rgba, &style->font.color);
                } else if (0 == strcmp (prop->name, "gnm-auto-dash")) {
                        gnm_auto_dash_set = TRUE;
                        style->line.auto_dash = g_value_get_boolean (&prop->value);
@@ -7135,6 +7140,11 @@ od_style_prop_chart (GsfXMLIn *xin, xmlChar const **attrs)
                        style->style_props = g_slist_prepend
                                (style->style_props,
                                 oo_prop_new_int ("font-gravity-pango", tmp));
+               else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_FO, "color"))
+                       style->style_props = g_slist_prepend
+                               (style->style_props,
+                                oo_prop_new_string ("color",
+                                                    CXML2C(attrs[1])));
                else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_CHART,
                                             "regression-type"))
                        style->other_props = g_slist_prepend


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]