[gnumeric] ODF import/export: handle some trendline names. [#743448]



commit c2708201a883ab3a5f9c7ba27bc119e36ee73fc6
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sat Jan 24 16:08:15 2015 -0700

    ODF import/export: handle some trendline names. [#743448]
    
    2015-01-24  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (od_series_regression): read trend line name
        * openoffice-write.c (odf_write_regression_curve): save trendline name

 NEWS                                  |    3 +++
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-read.c  |    8 ++++++--
 plugins/openoffice/openoffice-write.c |    5 +++++
 4 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index dd3711a..5114ed4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.12.20
 
+Andreas:
+       * ODF import/export: handle some trendline names. [#743448]
+
 Morten:
        * xlsx chart import: fix font family name.
        * xlsx import/export trend line names.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 7e2179f..9a6fb36 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-24  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (od_series_regression): read trend line name
+       * openoffice-write.c (odf_write_regression_curve): save trendline name
+
 2015-01-23  Morten Welinder <terra gnome org>
 
        * Release 1.12.19
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index c548eaa..4259598 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -9156,6 +9156,7 @@ od_series_regression (GsfXMLIn *xin, xmlChar const **attrs)
        char const *style_name = NULL;
        gchar const *lower_bd = NULL;
        gchar const *upper_bd = NULL;
+       gchar const *name = NULL;
 
        state->chart.regression = NULL;
 
@@ -9166,6 +9167,8 @@ od_series_regression (GsfXMLIn *xin, xmlChar const **attrs)
                        lower_bd = CXML2C (attrs[1]);
                else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_GNUM_NS_EXT, "upper-bound"))
                        upper_bd = CXML2C (attrs[1]);
+               else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_GNUM_NS_EXT, "name"))
+                       name = CXML2C (attrs[1]);
 
        if (style_name != NULL) {
                OOChartStyle *chart_style = g_hash_table_lookup
@@ -9215,8 +9218,9 @@ od_series_regression (GsfXMLIn *xin, xmlChar const **attrs)
                                g_object_unref (style);
                        }
 
-                       odf_store_data (state, lower_bd, regression , 0);
-                       odf_store_data (state, upper_bd, regression , 1);
+                       odf_store_data (state, name, regression, -1);
+                       odf_store_data (state, lower_bd, regression, 0);
+                       odf_store_data (state, upper_bd, regression, 1);
                }
        }
 }
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 9108759..5c7a67b 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -6311,6 +6311,11 @@ odf_write_regression_curve (GnmOOExport *state, GogObjectRole const *role, GogOb
                gsf_xml_out_add_cstr (state->xml, CHART "style-name", str);
 
                if (is_reg_curve && state->with_extension) {
+                       /* name */
+                       bd = gog_dataset_get_dim (GOG_DATASET (regression), -1);
+                       if (bd != NULL)
+                               odf_write_data_attribute
+                                       (state, bd, pp, GNMSTYLE "name");
                        /* Upper and lower bounds */
                        bd = gog_dataset_get_dim (GOG_DATASET (regression), 0);
                        if (bd != NULL)


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