[gnumeric] Fix ODF export of styles for additional axes. [#746621]



commit b690933d0109d9f3c478725c1f43de44a55f278c
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sun Mar 22 19:48:59 2015 -0600

    Fix ODF export of styles for additional axes. [#746621]
    
    2015-03-22  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-write.c (odf_write_standard_axes_styles): allow NULL style
        pointers
        (odf_write_axis_full): retrieve style name when it isn't given.

 NEWS                                  |    1 +
 plugins/openoffice/ChangeLog          |    6 ++++++
 plugins/openoffice/openoffice-write.c |   10 +++++++---
 3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 86fa696..c3559c0 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.12.22
 
 Andreas:
        * Improve ODF import/export of additional axes. [#746321]
+       * Fix ODF export of styles for additional axes. [#746621]
 
 Morten:
        * xlsx import/export of log axis.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 28ab6fe..df45806 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,11 @@
 2015-03-22  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * openoffice-write.c (odf_write_standard_axes_styles): allow NULL style
+       pointers
+       (odf_write_axis_full): retrieve style name when it isn't given.
+
+2015-03-22  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * openoffice-write.c (odf_write_attached_axes): avoid
        pre-mature exit on missing axes.
 
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 2ac3ce3..3116ff5 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -7203,11 +7203,11 @@ odf_write_standard_axes_styles (G_GNUC_UNUSED GnmOOExport *state,
        GogObject const *axis;
 
        axis = gog_object_get_child_by_name (chart, x_role);
-       if (axis != NULL)
+       if (axis != NULL && x_style != NULL)
                *x_style = odf_get_gog_style_name_from_obj (state, axis);
 
        axis = gog_object_get_child_by_name (chart, y_role);
-       if (axis != NULL)
+       if (axis != NULL && y_style != NULL)
                *y_style = odf_get_gog_style_name_from_obj (state, axis);
 }
 
@@ -7900,7 +7900,11 @@ odf_write_axis_full (GnmOOExport *state,
                        g_string_truncate (str, 0);
                        g_string_append_printf (str, "%s-%i", axis_role, id);
                        gsf_xml_out_add_cstr_unchecked (state->xml, CHART "name", str->str);
-                       gsf_xml_out_add_cstr (state->xml, CHART "style-name", style_label);
+                       if (style_label)
+                               gsf_xml_out_add_cstr (state->xml, CHART "style-name", style_label);
+                       else 
+                               gsf_xml_out_add_cstr (state->xml, CHART "style-name",
+                                                     odf_get_gog_style_name_from_obj (state, GOG_OBJECT 
(axis)));
                        odf_write_label (state, axis);
                        if (include_cats)
                                odf_write_axis_categories (state, series);


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