[gnumeric] xlsx: save arrow direction.



commit fad56af21787d7414866e8cf47945fd6dc573921
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 10 14:24:04 2015 -0500

    xlsx: save arrow direction.

 plugins/excel/ChangeLog            |    3 +++
 plugins/excel/xlsx-write-drawing.c |   15 +++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index fc4d895..74736ff 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,8 @@
 2015-02-10  Morten Welinder  <terra gnome org>
 
+       * xlsx-write-drawing.c (xlsx_write_drawing_objects): Save arrow
+       direction.
+
        * xlsx-write.c (xlsx2_file_save, xlsx_file_save): Initialize
        counter.
 
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 6ab53b9..79d2914 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -195,6 +195,8 @@ typedef struct {
        const char *shapename;
        GOArrow *start_arrow;
        GOArrow *end_arrow;
+       gboolean flipH;
+       gboolean flipV;
 } XLSXStyleContext;
 
 static void
@@ -207,6 +209,8 @@ xlsx_style_context_init (XLSXStyleContext *sctx)
        sctx->must_fill = FALSE;
        sctx->start_arrow = NULL;
        sctx->end_arrow = NULL;
+       sctx->flipH = FALSE;
+       sctx->flipV = FALSE;
 }
 
 static void
@@ -219,6 +223,15 @@ xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style, const XLSXStyleContext
 
        gsf_xml_out_start_element (xml, spPr_tag);
 
+       if (sctx->flipH || sctx->flipV) {
+               gsf_xml_out_start_element (xml, "a:xfrm");
+               if (sctx->flipH)
+                       gsf_xml_out_add_uint (xml, "flipH", 1);
+               if (sctx->flipV)
+                       gsf_xml_out_add_uint (xml, "flipV", 1);
+               gsf_xml_out_end_element (xml); /* </a:xfrm> */
+       }
+
        if (sctx->shapename) {
                gsf_xml_out_start_element (xml, "a:prstGeom");
                gsf_xml_out_add_cstr_unchecked (xml, "prst", sctx->shapename);
@@ -1183,6 +1196,8 @@ xlsx_write_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part, GSList
                        xlsx_style_context_init (&sctx);
                        sctx.spPr_ns = "xdr";
                        sctx.must_fill = TRUE;
+                       sctx.flipH = (anchor->base.direction & GOD_ANCHOR_DIR_H_MASK) != GOD_ANCHOR_DIR_RIGHT;
+                       sctx.flipV = (anchor->base.direction & GOD_ANCHOR_DIR_V_MASK) != GOD_ANCHOR_DIR_DOWN;
 
                        if (IS_GNM_SO_LINE (so)) {
                                g_object_get (G_OBJECT (so),


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