[gnumeric] Fixed criticals when saving a chart to ODF. [#658194]



commit 988c008aaed14dd40cb1d56b292cb75aa4663736
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Sep 6 10:21:49 2011 +0200

    Fixed criticals when saving a chart to ODF. [#658194]

 NEWS                                  |    1 +
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-write.c |    7 +++++--
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 32d3100..be5e14f 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Jean:
 	* Make Ctrl-PgUp and Ctrl-PgDn work on chart-only sheets. [#645673]
 	* Fix row height autofit when zoom level is not 1. [#656418]
 	* Fix actions sensitivity for chart sheets. [#645842]
+	* Fixed criticals when saving a chart to ODF. [#658194]
 
 Morten:
 	* Fix crash.  [#658140]
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index bd203a0..6077007 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-06  Jean Brefort  <jean brefort normalesup org>
+
+	* openoffice-write.c (odf_write_regression_curve): fixed criticals.
+	[#658194]
+
 2011-09-06  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-read.c (oo_prop_list_apply_to_axis): handle
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index c0a5d24..1199c35 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -5746,8 +5746,11 @@ odf_write_regression_curve (GnmOOExport *state, GogObjectRole const *role, GogOb
 	for (l = regressions; l != NULL && l->data != NULL; l = l->next) {
 		GOData const *bd;
 		GogObject const *regression = l->data;
+		gboolean is_reg_curve = GOG_IS_REG_CURVE (regression);
 		GogObject const *equation
-			= gog_object_get_child_by_name (regression, "Equation");
+			= is_reg_curve?
+			gog_object_get_child_by_name (regression, "Equation"):
+			NULL;
 		str = odf_get_gog_style_name_from_obj
 			(GOG_OBJECT (regression));
 		gsf_xml_out_start_element
@@ -5756,7 +5759,7 @@ odf_write_regression_curve (GnmOOExport *state, GogObjectRole const *role, GogOb
 			 : GNMSTYLE "regression-curve");
 		gsf_xml_out_add_cstr (state->xml, CHART "style-name", str);
 
-		if (state->with_extension) {
+		if (is_reg_curve && state->with_extension) {
 			/* 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]