[gnumeric] xlsx: export chart title properties.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: export chart title properties.
- Date: Wed, 21 Jan 2015 21:15:52 +0000 (UTC)
commit 930e37f973434bf2bca15d3ec687737a295a51a8
Author: Morten Welinder <terra gnome org>
Date: Wed Jan 21 16:15:31 2015 -0500
xlsx: export chart title properties.
plugins/excel/xlsx-read-drawing.c | 12 +++++++++---
plugins/excel/xlsx-write-drawing.c | 10 +++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index e48b44b..1c378c8 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -152,10 +152,11 @@ xlsx_chart_title_start (GsfXMLIn *xin, xmlChar const **attrs)
if (state->cur_obj == (GogObject *)state->chart) {
xlsx_push_text_object (state, "Title");
- state->inhibit_text_pop = TRUE;
} else {
- xlsx_chart_text_start (xin, attrs);
+ xlsx_push_text_object (state, "Label");
}
+ state->inhibit_text_pop = TRUE;
+ state->sp_type |= GO_STYLE_LINE;
}
static void
@@ -163,7 +164,12 @@ xlsx_chart_title_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
state->inhibit_text_pop = FALSE;
- xlsx_chart_text (xin, blob);
+ if (GOG_IS_CHART (state->cur_obj)) {
+ xlsx_chart_text (xin, blob);
+ } else {
+ xlsx_chart_pop_obj (state);
+ }
+ state->sp_type &= ~GO_STYLE_LINE;
}
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 7c613e6..4705671 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -282,7 +282,7 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
static void
xlsx_write_chart_text (XLSXWriteState *state, GsfXMLOut *xml,
- GOData *data, GOStyledObject *so)
+ GOData *data, GOStyle *style)
{
/* I don't really know what I am doing here. */
char *text = go_data_get_scalar_string (data);
@@ -304,6 +304,8 @@ xlsx_write_chart_text (XLSXWriteState *state, GsfXMLOut *xml,
gsf_xml_out_end_element (xml);
gsf_xml_out_end_element (xml);
+ xlsx_write_go_style (xml, style);
+
g_free (text);
}
@@ -364,8 +366,9 @@ xlsx_write_axis (XLSXWriteState *state, GsfXMLOut *xml, GogAxis *axis, GogAxisTy
if (label) {
GOData *text = gog_dataset_get_dim (GOG_DATASET (label), 0);
if (text != NULL) {
+ GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (label));
gsf_xml_out_start_element (xml, "c:title");
- xlsx_write_chart_text (state, xml, text, GO_STYLED_OBJECT (label));
+ xlsx_write_chart_text (state, xml, text, style);
gsf_xml_out_end_element (xml);
}
}
@@ -718,8 +721,9 @@ xlsx_write_one_chart (XLSXWriteState *state, GsfXMLOut *xml, GogObject const *ch
if (obj) {
GOData *text = gog_dataset_get_dim (GOG_DATASET (obj), 0);
if (text != NULL) {
+ GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (obj));
gsf_xml_out_start_element (xml, "c:title");
- xlsx_write_chart_text (state, xml, text, GO_STYLED_OBJECT (obj));
+ xlsx_write_chart_text (state, xml, text, style);
gsf_xml_out_end_element (xml);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]