[gnumeric] xlsx: fix writing of trend line equation.



commit bc0ed38f389805401fbfbc13d596ca5592797e9e
Author: Morten Welinder <terra gnome org>
Date:   Thu Oct 26 18:52:36 2017 -0400

    xlsx: fix writing of trend line equation.
    
    Also add test for this.

 NEWS                               |    1 +
 plugins/excel/ChangeLog            |    1 +
 plugins/excel/xlsx-write-drawing.c |    3 ++-
 samples/graph-tests.gnumeric       |  Bin 13994 -> 14184 bytes
 4 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index c3aa360..7da61ed 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Morten:
        * Fix error on xlsx files with bogus Print_Area.
        * xlsx import improvements for contour graphs.
        * xlsx export improvements for contour graphs.
+       * Fix xlsx export of trend line equation.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.35
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index afca323..775b553 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -3,6 +3,7 @@
        * xlsx-write-drawing.c (xlsx_write_axis): Make axis tag for
        contour charts match what XL wants.  Even if it isn't obvious why.
        (xlsx_write_one_chart): Save a view3D for contour charts.
+       (xlsx_write_one_plot): Fix writing trendline equation.
 
 2017-10-24  Morten Welinder  <terra gnome org>
 
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 3512860..5de801b 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -1118,7 +1118,6 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml,
                        g_free (name);
                        xlsx_write_go_style (xml, state, go_styled_object_get_style (GO_STYLED_OBJECT 
(trend)));
                        xlsx_write_chart_cstr_unchecked (xml, "c:trendlineType", trend_type);
-                       gsf_xml_out_end_element (xml); /* </c:trendline> */
 
                        eq = gog_object_get_child_by_name (trend, "Equation");
                        if (eq) {
@@ -1129,6 +1128,8 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml,
                                if (has_eq)
                                        xlsx_write_chart_bool (xml, "c:dispEq", TRUE);
                        }
+
+                       gsf_xml_out_end_element (xml); /* </c:trendline> */
                }
                g_slist_free (children);
 
diff --git a/samples/graph-tests.gnumeric b/samples/graph-tests.gnumeric
index c4df3d0..008f287 100644
Binary files a/samples/graph-tests.gnumeric and b/samples/graph-tests.gnumeric differ


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