[gnumeric] xlsx: write marker color.



commit 44c68415b971606388cc2d90374d7511cade05a9
Author: Morten Welinder <terra gnome org>
Date:   Sat Jan 17 10:26:54 2015 -0500

    xlsx: write marker color.

 NEWS                               |    2 +-
 plugins/excel/ChangeLog            |    2 ++
 plugins/excel/xlsx-write-drawing.c |   23 +++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 91ed85a..760d252 100644
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@ Morten:
        * Fix sheet-filter problem with errors.  [#742601]
        * Improve error handling for .gnumeric a bit.
        * Improve xlsx graph import: line colour; marker size; marker color.
-       * Improve xlsx graph export: line style; bar/col direction; marker shape; marker size.
+       * Improve xlsx graph export: line style; bar/col direction; marker shape; marker size; marker color.
        * Improve xlsx export: default col widths.
 
 Thomas Kluyver:
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 9736c73..9f071b0 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,7 @@
 2015-01-17  Morten Welinder  <terra gnome org>
 
+       * xlsx-write-drawing.c (xlsx_write_go_style): Write marker colors.
+
        * xlsx-read-drawing.c (xlsx_chart_solid_fill): Fix reading marker
        colors.
 
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index fc13628..e39de60 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -220,6 +220,7 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
                        NULL,         /* GO_MARKER_HOURGLASS */
                        NULL          /* GO_MARKER_LEFT_HALF_BAR */
                };
+               gboolean need_spPr;
                GOMarkerShape s = style->marker.auto_shape
                        ? GO_MARKER_MAX
                        : go_marker_get_shape (style->marker.mark);
@@ -240,6 +241,28 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
                        gsf_xml_out_end_element (xml);
                }
 
+               need_spPr = (!style->marker.auto_fill_color ||
+                            !style->marker.auto_outline_color);
+               if (need_spPr) {
+                       gsf_xml_out_start_element (xml, "c:spPr");
+
+                       if (!style->marker.auto_fill_color) {
+                               gsf_xml_out_start_element (xml, "a:solidFill");
+                               xlsx_write_rgbarea (xml, go_marker_get_fill_color (style->marker.mark));
+                               gsf_xml_out_end_element (xml);
+                       }
+
+                       if (!style->marker.auto_outline_color) {
+                               gsf_xml_out_start_element (xml, "a:ln");
+                               gsf_xml_out_start_element (xml, "a:solidFill");
+                               xlsx_write_rgbarea (xml, go_marker_get_outline_color (style->marker.mark));
+                               gsf_xml_out_end_element (xml);
+                               gsf_xml_out_end_element (xml);
+                       }
+
+                       gsf_xml_out_end_element (xml);
+               }
+
                gsf_xml_out_end_element (xml);
        }
 }


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