[gnumeric] xlsx: avoid criticals on exporting unnamed trend line.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: avoid criticals on exporting unnamed trend line.
- Date: Thu, 26 Oct 2017 23:21:05 +0000 (UTC)
commit cf501a76f38645bdfaf5fbb5371d728b19f33e0a
Author: Morten Welinder <terra gnome org>
Date: Thu Oct 26 19:07:34 2017 -0400
xlsx: avoid criticals on exporting unnamed trend line.
NEWS | 1 +
plugins/excel/ChangeLog | 3 ++-
plugins/excel/xlsx-write-drawing.c | 8 +++++---
3 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index 7da61ed..0a206b0 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ Morten:
* xlsx import improvements for contour graphs.
* xlsx export improvements for contour graphs.
* Fix xlsx export of trend line equation.
+ * Avoid critical on exporting unnamed xlsx trend line.
--------------------------------------------------------------------------
Gnumeric 1.12.35
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 775b553..ca52c70 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -3,7 +3,8 @@
* 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.
+ (xlsx_write_one_plot): Fix writing trendline equation. Don't
+ write a trendline name if there isn't one.
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 5de801b..7f901b1 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -1113,9 +1113,11 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml,
gsf_xml_out_start_element (xml, "c:trendline");
dat = gog_dataset_get_dim (GOG_DATASET (trend), -1);
- name = go_data_get_scalar_string (dat);
- gsf_xml_out_simple_element (xml, "c:name", name);
- g_free (name);
+ if (dat) {
+ char *name = go_data_get_scalar_string (dat);
+ gsf_xml_out_simple_element (xml, "c:name", name);
+ 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]