[gnumeric] xlsx: roundtrip the left-half-bar marker shape.



commit 33aa0ccb303a1223f987aeb5f7a5cc3dfe046169
Author: Morten Welinder <terra gnome org>
Date:   Fri Jan 23 19:52:47 2015 -0500

    xlsx: roundtrip the left-half-bar marker shape.
    
    We're clearly within spec, but I doubt anything other than Gnumeric
    will ever read this.

 plugins/excel/xlsx-read-drawing.c  |    7 ++++++-
 plugins/excel/xlsx-write-drawing.c |   14 +++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index 51f0e4c..520582b 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -1717,7 +1717,8 @@ xlsx_sppr_xfrm (GsfXMLIn *xin, xmlChar const **attrs)
 {
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
        for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
-               int rot;
+               int rot, flipH;
+
                if (attr_int (xin, attrs, "rot", &rot)) {
                        rot = rot % (360 * 60000);
                        if (rot < 0) rot += 360 * 60000;
@@ -1737,6 +1738,10 @@ xlsx_sppr_xfrm (GsfXMLIn *xin, xmlChar const **attrs)
                                        break;
                                }
                        }
+               } else if (attr_bool (xin, attrs, "flipH", &flipH) && flipH) {
+                       if (state->marker && go_marker_get_shape (state->marker) == GO_MARKER_HALF_BAR) {
+                               go_marker_set_shape (state->marker, GO_MARKER_LEFT_HALF_BAR);
+                       }
                }
        }
 }
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 5577a04..f2ec1e4 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -215,10 +215,10 @@ xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style,
                        "none",       /* GO_MARKER_NONE */
                        "square",     /* GO_MARKER_SQUARE */
                        "diamond",    /* GO_MARKER_DIAMOND */
-                       "triangle",   /* GO_MARKER_TRIANGLE_DOWN */   /* FIXME: rotation */
+                       "triangle",   /* GO_MARKER_TRIANGLE_DOWN */
                        "triangle",   /* GO_MARKER_TRIANGLE_UP */
-                       "triangle",   /* GO_MARKER_TRIANGLE_RIGHT */  /* FIXME: rotation */
-                       "triangle",   /* GO_MARKER_TRIANGLE_LEFT */   /* FIXME: rotation */
+                       "triangle",   /* GO_MARKER_TRIANGLE_RIGHT */
+                       "triangle",   /* GO_MARKER_TRIANGLE_LEFT */
                        "circle",     /* GO_MARKER_CIRCLE */
                        "x",          /* GO_MARKER_X */
                        "plus",       /* GO_MARKER_CROSS */
@@ -230,6 +230,7 @@ xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style,
                        "dot"         /* GO_MARKER_LEFT_HALF_BAR */
                };
                static gint8 nqturns[] = { 0, 0, 0, 2, 0, +1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+               static gint8 flipH[] =   { 0, 0, 0, 0, 0,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
                gboolean need_spPr;
                GOMarkerShape s = style->marker.auto_shape
                        ? (def_has_markers ? GO_MARKER_MAX : GO_MARKER_NONE)
@@ -254,9 +255,12 @@ xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style,
                if (need_spPr) {
                        gsf_xml_out_start_element (xml, "c:spPr");
 
-                       if (nqturns[s]) {
+                       if (nqturns[s] || flipH[s]) {
                                gsf_xml_out_start_element (xml, "a:xfrm");
-                               gsf_xml_out_add_int (xml, "rot", nqturns[s] * (90 * 60000));
+                               if (nqturns[s])
+                                       gsf_xml_out_add_int (xml, "rot", nqturns[s] * (90 * 60000));
+                               if (flipH[s])
+                                       gsf_xml_out_add_int (xml, "flipH", flipH[s]);
                                gsf_xml_out_end_element (xml);
                        }
 


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