[gnumeric] xlsx: fix export of line style None.



commit 8e38d75f9235d95584ae622986712a74a20bc930
Author: Morten Welinder <terra gnome org>
Date:   Fri Feb 13 10:36:14 2015 -0500

    xlsx: fix export of line style None.

 NEWS                               |    1 +
 plugins/excel/ChangeLog            |    5 +++++
 plugins/excel/xlsx-write-drawing.c |   16 +++++++++-------
 3 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/NEWS b/NEWS
index 45a26f2..2d6292a 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ Morten:
        * xlsx import/exports of patterns.
        * Plug leaks.
        * Arrow properties editor.  [#158327]
+       * Fix xlsx export of line style None.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.20
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index ab7c826..0869dd7 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-13  Morten Welinder  <terra gnome org>
+
+       * xlsx-write-drawing.c (xlsx_write_go_style_full): When we must
+       use fill in the line style, use a:noFill to indicate no line.
+
 2015-02-12  Morten Welinder  <terra gnome org>
 
        * xlsx-read-drawing.c (xlsx_chart_line_headtail): Improve arrow
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 65c0673..6e950fe 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -189,7 +189,7 @@ typedef struct {
        gboolean def_has_markers;
        gboolean def_has_lines;
        const char *spPr_ns;
-       gboolean must_fill;
+       gboolean must_fill_line;
 
        /* Not strictly context, but extensions to the style.  */
        const char *shapename;
@@ -206,7 +206,7 @@ xlsx_style_context_init (XLSXStyleContext *sctx)
        sctx->def_has_lines = TRUE;
        sctx->spPr_ns = "c";
        sctx->shapename = NULL;
-       sctx->must_fill = FALSE;
+       sctx->must_fill_line = FALSE;
        sctx->start_arrow = NULL;
        sctx->end_arrow = NULL;
        sctx->flipH = FALSE;
@@ -314,7 +314,7 @@ xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style, const XLSXStyleContext
             !style->line.auto_dash ||
             !style->line.auto_width ||
             !style->line.auto_color ||
-            sctx->must_fill)) {
+            sctx->must_fill_line)) {
                int i;
 
                static const char * const dashes[] = {
@@ -344,9 +344,11 @@ xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style, const XLSXStyleContext
                        gsf_xml_out_start_element (xml, "a:solidFill");
                        xlsx_write_rgbarea (xml, style->line.color);
                        gsf_xml_out_end_element (xml);
-               } else if (sctx->must_fill) {
-                       gsf_xml_out_start_element (xml, "a:solidFill");
-                       gsf_xml_out_end_element (xml);
+               } else if (sctx->must_fill_line) {
+                       gsf_xml_out_simple_element
+                               (xml,
+                                is_none ? "a:noFill" : "a:solidFill",
+                                NULL);
                } else if (style->line.auto_dash && !sctx->def_has_lines)
                        gsf_xml_out_simple_element (xml, "a:noFill", NULL);
 
@@ -1200,7 +1202,7 @@ xlsx_write_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part, GSList
 
                        xlsx_style_context_init (&sctx);
                        sctx.spPr_ns = "xdr";
-                       sctx.must_fill = TRUE;
+                       sctx.must_fill_line = 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;
 


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