[gnumeric] ODF import/export series lines. [#743785]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] ODF import/export series lines. [#743785]
- Date: Sun, 1 Feb 2015 07:17:51 +0000 (UTC)
commit f72f84aa64e49287ed8b4b14d810a0c2517f6610
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Sun Feb 1 00:15:42 2015 -0700
ODF import/export series lines. [#743785]
2015-02-01 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-write.c (odf_write_series_lines): new
(odf_write_standard_series): call odf_write_series_lines
* openoffice-read.c (oo_series_serieslines): new
(opendoc_content_dtd): connect oo_series_serieslines
(opendoc_content_preparse_dtd): advertise new element here too
NEWS | 1 +
plugins/openoffice/ChangeLog | 10 +++++++++-
plugins/openoffice/openoffice-read.c | 26 ++++++++++++++++++++++++++
plugins/openoffice/openoffice-write.c | 16 ++++++++++++++++
4 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 6e692a2..dd35a08 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Andreas:
* ODF import/export marker outline colour.
* ODF export all charts in a graph.
* ODF import/export axis positions.
+ * ODF import/export series lines. [#743785]
Morten:
* xlsx chart import: fix font family name.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 81bb10e..45092f1 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,4 +1,12 @@
-2015-01-30 Andreas J. Guelzow <aguelzow pyrshep ca>
+2015-02-01 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * openoffice-write.c (odf_write_series_lines): new
+ (odf_write_standard_series): call odf_write_series_lines
+ * openoffice-read.c (oo_series_serieslines): new
+ (opendoc_content_dtd): connect oo_series_serieslines
+ (opendoc_content_preparse_dtd): advertise new element here too
+
+2015-01-31 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-write.c (odf_write_multi_chart_frame_size): new
(odf_write_graph): call odf_write_multi_chart_frame_size if app.
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 2927008..3aa32ac 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -9439,6 +9439,30 @@ oo_series_droplines (GsfXMLIn *xin, xmlChar const **attrs)
}
static void
+oo_series_serieslines (GsfXMLIn *xin, xmlChar const **attrs)
+{
+ OOParseState *state = (OOParseState *)xin->user_state;
+ char const *style_name = NULL;
+ for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
+ if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_CHART, "style-name"))
+ style_name = CXML2C (attrs[1]);
+ if (style_name != NULL) {
+ OOChartStyle *chart_style = g_hash_table_lookup (state->chart.graph_styles, style_name);
+ GOStyle *style = NULL;
+ GogObject const *lines;
+
+ lines = gog_object_add_by_name (GOG_OBJECT (state->chart.series), "Series lines", NULL);
+ if (chart_style) {
+ g_object_get (G_OBJECT (lines), "style", &style, NULL);
+ if (style != NULL) {
+ odf_apply_style_props (xin, chart_style->style_props, style);
+ g_object_unref (style);
+ }
+ }
+ }
+}
+
+static void
oo_chart_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
OOParseState *state = (OOParseState *)xin->user_state;
@@ -11692,6 +11716,7 @@ static GsfXMLInNode const opendoc_content_dtd [] =
GSF_XML_IN_NODE (SERIES_REGRESSION_MULTIPLE, SERIES_REG_EQ, OO_NS_CHART, "equation",
GSF_XML_NO_CONTENT, NULL, NULL),/* 2nd Def */
GSF_XML_IN_NODE (SERIES_REGRESSION_MULTIPLE, SERIES_REG_EQ_GNM, OO_GNUM_NS_EXT,
"equation", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (CHART_SERIES, SERIES_DROPLINES, OO_GNUM_NS_EXT, "droplines",
GSF_XML_NO_CONTENT, &oo_series_droplines, NULL),
+ GSF_XML_IN_NODE (CHART_SERIES, SERIES_SERIESLINES, OO_GNUM_NS_EXT, "serieslines",
GSF_XML_NO_CONTENT, &oo_series_serieslines, NULL),
GSF_XML_IN_NODE (CHART_PLOT_AREA, CHART_WALL, OO_NS_CHART, "wall", GSF_XML_NO_CONTENT,
&oo_chart_wall, NULL),
GSF_XML_IN_NODE (CHART_PLOT_AREA, CHART_FLOOR, OO_NS_CHART, "floor", GSF_XML_NO_CONTENT,
NULL, NULL),
GSF_XML_IN_NODE (CHART_PLOT_AREA, CHART_AXIS, OO_NS_CHART, "axis", GSF_XML_NO_CONTENT,
&oo_chart_axis, &oo_chart_axis_end),
@@ -11963,6 +11988,7 @@ static GsfXMLInNode const opendoc_content_preparse_dtd [] =
GSF_XML_IN_NODE (SERIES_REGRESSION_MULTIPLE, SERIES_REG_EQ, OO_NS_CHART, "equation",
GSF_XML_NO_CONTENT, NULL, NULL),/* 2nd Def */
GSF_XML_IN_NODE (SERIES_REGRESSION_MULTIPLE, SERIES_REG_EQ_GNM, OO_GNUM_NS_EXT,
"equation", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (CHART_SERIES, SERIES_DROPLINES, OO_GNUM_NS_EXT, "droplines",
GSF_XML_NO_CONTENT, NULL, NULL),
+ GSF_XML_IN_NODE (CHART_SERIES, SERIES_SERIESLINES, OO_GNUM_NS_EXT, "serieslines",
GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (CHART_PLOT_AREA, CHART_WALL, OO_NS_CHART, "wall", GSF_XML_NO_CONTENT, NULL,
NULL),
GSF_XML_IN_NODE (CHART_PLOT_AREA, CHART_FLOOR, OO_NS_CHART, "floor", GSF_XML_NO_CONTENT,
NULL, NULL),
GSF_XML_IN_NODE (CHART_PLOT_AREA, CHART_AXIS, OO_NS_CHART, "axis", GSF_XML_NO_CONTENT, NULL,
NULL),
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 33aa570..315866d 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -6281,6 +6281,21 @@ odf_write_label_cell_address (GnmOOExport *state, GOData const *dat)
}
static void
+odf_write_series_lines (GnmOOExport *state, GogObject const *series)
+{
+ GogObject const *serieslines = gog_object_get_child_by_name (series, "Series lines");
+ if (serieslines) {
+ char *style = odf_get_gog_style_name_from_obj (state, series);
+
+ gsf_xml_out_start_element (state->xml, GNMSTYLE "serieslines");
+ gsf_xml_out_add_cstr (state->xml, CHART "style-name", style);
+ gsf_xml_out_end_element (state->xml); /* </gnm:serieslines> */
+
+ g_free (style);
+ }
+}
+
+static void
odf_write_drop_line (GnmOOExport *state, GogObject const *series, char const *drop)
{
GogObjectRole const *role = gog_object_find_role_by_name (series, drop);
@@ -6557,6 +6572,7 @@ odf_write_standard_series (GnmOOExport *state, GSList const *series)
"Vertical drop lines");
odf_write_drop_line (state, GOG_OBJECT (series->data),
"Drop lines");
+ odf_write_series_lines (state, GOG_OBJECT (series->data));
}
gsf_xml_out_end_element (state->xml); /* </chart:series> */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]