[gnumeric] xlsx: export marker size.



commit dc814528c75218b2a7d6f37a21d7771da4e4d4fb
Author: Morten Welinder <terra gnome org>
Date:   Sat Jan 17 09:55:08 2015 -0500

    xlsx: export marker size.

 NEWS                               |    2 +-
 plugins/excel/ChangeLog            |    2 ++
 plugins/excel/xlsx-write-drawing.c |   23 +++++++++++++++--------
 3 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/NEWS b/NEWS
index 24eda6a..8c1a604 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.
-       * Improve xlsx graph export: line style; bar/col direction; marker shapes.
+       * Improve xlsx graph export: line style; bar/col direction; marker shape; marker size.
        * Improve xlsx export: default col widths.
 
 Thomas Kluyver:
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 4adb6f7..f946cd8 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 size.
+
        * xlsx-read-drawing.c (xlsx_chart_marker_size): Read marker size.
 
        * xlsx-write.c (xlsx_write_cols): Make sure we include a width for
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index a2e2d9f..fc13628 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -203,7 +203,7 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
 
        if (style->interesting_fields & GO_STYLE_MARKER) {
                static const char *const markers[] = {
-                       NULL,         /* GO_MARKER_NONE */
+                       "none",       /* GO_MARKER_NONE */
                        "square",     /* GO_MARKER_SQUARE */
                        "diamond",    /* GO_MARKER_DIAMOND */
                        "triangle",   /* GO_MARKER_TRIANGLE_DOWN */   /* FIXME: rotation */
@@ -220,19 +220,26 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
                        NULL,         /* GO_MARKER_HOURGLASS */
                        NULL          /* GO_MARKER_LEFT_HALF_BAR */
                };
+               GOMarkerShape s = style->marker.auto_shape
+                       ? GO_MARKER_MAX
+                       : go_marker_get_shape (style->marker.mark);
 
                gsf_xml_out_start_element (xml, "c:marker");
 
                gsf_xml_out_start_element (xml, "c:symbol");
-               if (style->marker.auto_shape)
-                       gsf_xml_out_add_cstr_unchecked (xml, "val", "auto");
-               else {
-                       GOMarkerShape s = go_marker_get_shape (style->marker.mark);
-                       if (s < G_N_ELEMENTS (markers) && markers[s])
-                               gsf_xml_out_add_cstr_unchecked (xml, "val", markers[s]);
-               }               
+               gsf_xml_out_add_cstr_unchecked
+                       (xml, "val",
+                        (s < G_N_ELEMENTS (markers) && markers[s]
+                         ? markers[s]
+                         : "auto"));
                gsf_xml_out_end_element (xml);
 
+               if (!style->marker.auto_shape) {
+                       gsf_xml_out_start_element (xml, "c:size");
+                       gsf_xml_out_add_int (xml, "val", go_marker_get_size (style->marker.mark));
+                       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]