[gnumeric] Fix import of affice trendline from ODF. [#789538]



commit 05e2575aa633ba3d15898f2b87d37d2426c80b96
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Thu Oct 26 19:53:52 2017 -0600

    Fix import of affice trendline from ODF. [#789538]
    
    2017-10-26  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (od_style_prop_chart): correct property name and
        handle LO trendline intercept extension

 NEWS                                 |    3 ++-
 plugins/openoffice/ChangeLog         |    5 +++++
 plugins/openoffice/openoffice-read.c |   19 ++++++++++++++++++-
 3 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index f82e1e5..e7f914b 100644
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,8 @@ Andreas:
        * Improve contour plot import of Excel generated ODF. [#788801]
        * Improve surface plot export to ODF. [#788447]
        * Fix export/import of CONCATENATE to and from ODF.
-       * Fix export/import of minoraxis divisors to and from ODF.
+       * Fix export/import of minor axis divisors to and from ODF.
+       * Fix import of affice trendline from ODF. [#789538]
 
 Morten:
        * Convert all xpm files to png.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index fb1af60..b1284b8 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-26  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (od_style_prop_chart): correct property name and
+       handle LO trendline intercept extension
+
 2017-10-16  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * openoffice-write.c (odf_write_axis_style): fix export of
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index af06d15..597cdb8 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -7113,6 +7113,9 @@ od_style_prop_chart (GsfXMLIn *xin, xmlChar const **attrs)
        gboolean stacked_unset = FALSE;
        gboolean overlap_set = FALSE;
        gboolean percentage_set = FALSE;
+       gboolean regression_force_intercept_set = FALSE;
+       gboolean regression_force_intercept = FALSE;
+       gnm_float regression_force_intercept_value = 0.;
        char const *interpolation = NULL;
        gboolean local_style = FALSE;
 
@@ -7516,11 +7519,19 @@ od_style_prop_chart (GsfXMLIn *xin, xmlChar const **attrs)
                        style->other_props = g_slist_prepend
                                (style->other_props,
                                 oo_prop_new_int ("lo-dims", tmp));
+               else if (oo_attr_bool (xin, attrs, OO_NS_LOCALC_EXT, "regression-force-intercept",
+                                      &regression_force_intercept))
+                       {
+                               regression_force_intercept_set = TRUE;
+                       }
+               else if (oo_attr_float (xin, attrs, OO_NS_LOCALC_EXT,
+                                         "regression-intercept-value", &ftmp))
+                       regression_force_intercept_value = ftmp;
 #endif
                else if (oo_attr_bool (xin, attrs, OO_GNUM_NS_EXT, "regression-affine",
                                       &btmp))
                        style->other_props = g_slist_prepend (style->other_props,
-                               oo_prop_new_bool ("regression-affine", btmp));
+                               oo_prop_new_bool ("affine", btmp));
                else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_GNUM_NS_EXT,
                                             "regression-name"))
                        style->other_props = g_slist_prepend
@@ -7614,6 +7625,12 @@ od_style_prop_chart (GsfXMLIn *xin, xmlChar const **attrs)
                                oo_prop_new_bool ("major-tick-labeled", btmp));
        }
 
+       if (regression_force_intercept_set) {
+               btmp = regression_force_intercept && (regression_force_intercept_value == 0);
+               style->other_props = g_slist_prepend (style->other_props,
+                               oo_prop_new_bool ("affine", btmp));
+       }
+
        if ((stacked_set && !overlap_set) ||
            (percentage_set && !stacked_unset && !overlap_set))
                style->plot_props = g_slist_prepend (style->plot_props,


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