[gnumeric] xlsx: import marker size



commit 9adb59f13d4976dffe179fd984ee20230a3c7939
Author: Morten Welinder <terra gnome org>
Date:   Sat Jan 17 09:47:46 2015 -0500

    xlsx: import marker size

 NEWS                               |    2 +-
 plugins/excel/ChangeLog            |    2 ++
 plugins/excel/xlsx-read-drawing.c  |   15 +++++++++++++--
 plugins/excel/xlsx-write-drawing.c |    2 +-
 4 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index 8e31cf2..24eda6a 100644
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@ Morten:
        * Fix ADDRESS problem.
        * Fix sheet-filter problem with errors.  [#742601]
        * Improve error handling for .gnumeric a bit.
-       * Improve xlsx graph import: line colour.
+       * Improve xlsx graph import: line colour; marker size.
        * Improve xlsx graph export: line style; bar/col direction; marker shapes.
        * Improve xlsx export: default col widths.
 
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index c3427b1..4adb6f7 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,7 @@
 2015-01-17  Morten Welinder  <terra gnome org>
 
+       * xlsx-read-drawing.c (xlsx_chart_marker_size): Read marker size.
+
        * xlsx-write.c (xlsx_write_cols): Make sure we include a width for
        default-style columns.  Otherwise XL will see zero width.
 
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index 6a66c52..42b5fad 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -1488,7 +1488,7 @@ xlsx_chart_marker_symbol (GsfXMLIn *xin, xmlChar const **attrs)
                { "plus",       GO_MARKER_CROSS },              /* CHECK ME */
                { "square",     GO_MARKER_SQUARE },
                { "star",       GO_MARKER_ASTERISK },           /* CHECK ME */
-               { "triangle",   GO_MARKER_TRIANGLE_UP },        /* FIXME */
+               { "triangle",   GO_MARKER_TRIANGLE_UP },
                { "x",          GO_MARKER_X },
                { "auto",       GO_MARKER_MAX },
                { NULL, 0 }
@@ -1500,6 +1500,17 @@ xlsx_chart_marker_symbol (GsfXMLIn *xin, xmlChar const **attrs)
 }
 
 static void
+xlsx_chart_marker_size (GsfXMLIn *xin, xmlChar const **attrs)
+{
+       XLSXReadState *state = (XLSXReadState *)xin->user_state;
+       for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
+               int sz;
+               if (attr_int (xin, attrs, "val", &sz))
+                       go_marker_set_size (state->marker, sz);
+       }
+}
+
+static void
 xlsx_chart_marker_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 {
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
@@ -1915,7 +1926,7 @@ GSF_XML_IN_NODE_FULL (START, CHART_SPACE, XL_NS_CHART, "chartSpace", GSF_XML_NO_
             GSF_XML_IN_NODE (SERIES_PT, MARKER, XL_NS_CHART,   "marker", GSF_XML_NO_CONTENT, 
&xlsx_chart_marker_start, &xlsx_chart_marker_end),
               GSF_XML_IN_NODE (MARKER, SHAPE_PR, XL_NS_CHART, "spPr", GSF_XML_NO_CONTENT, NULL, NULL),       
          /* 2nd Def */
               GSF_XML_IN_NODE (MARKER, MARKER_SYMBOL, XL_NS_CHART, "symbol", GSF_XML_NO_CONTENT, 
&xlsx_chart_marker_symbol, NULL),
-              GSF_XML_IN_NODE (MARKER, MARKER_SIZE, XL_NS_CHART, "size", GSF_XML_NO_CONTENT, NULL, NULL),
+              GSF_XML_IN_NODE (MARKER, MARKER_SIZE, XL_NS_CHART, "size", GSF_XML_NO_CONTENT, 
&xlsx_chart_marker_size, NULL),
 
           GSF_XML_IN_NODE (SERIES, SERIES_ERR_BARS, XL_NS_CHART,"errBars", GSF_XML_NO_CONTENT, NULL, NULL),
            GSF_XML_IN_NODE (SERIES_ERR_BARS, SERIES_ERR_BARS_ERRBARTYPE, XL_NS_CHART, "errBarType",  
GSF_XML_NO_CONTENT, NULL, NULL),
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 8a75179..a2e2d9f 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -207,7 +207,7 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
                        "square",     /* GO_MARKER_SQUARE */
                        "diamond",    /* GO_MARKER_DIAMOND */
                        "triangle",   /* GO_MARKER_TRIANGLE_DOWN */   /* FIXME: rotation */
-                       "triangle",   /* GO_MARKER_TRIANGLE_UP */     /* FIXME: rotation */
+                       "triangle",   /* GO_MARKER_TRIANGLE_UP */
                        "triangle",   /* GO_MARKER_TRIANGLE_RIGHT */  /* FIXME: rotation */
                        "triangle",   /* GO_MARKER_TRIANGLE_LEFT */   /* FIXME: rotation */
                        "circle",     /* GO_MARKER_CIRCLE */


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