[gnumeric] Export axes data formats to ODF. Part of [#671461]



commit 1587653d6d827da99154f0d02860c585cdfb7b33
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Mar 22 20:22:28 2012 -0600

    Export axes data formats to ODF. Part of [#671461]
    
    2012-03-22  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-write.c (odf_write_graph_styles): write number styles
    	(odf_write_gog_style): write axis data format
    	(odf_write_graphs): clear the data style hashes

 NEWS                                  |    1 +
 plugins/openoffice/ChangeLog          |    6 ++++++
 plugins/openoffice/openoffice-write.c |   29 +++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 069e48e..36e874a 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Andreas:
 	* Improve annotation import from ODF.
 	* Fix conditional number format import from ODF. [#672489]
 	* Import/Export marker size from/to ODF. Part of [#671461]
+	* Export axes data formats to ODF. Part of [#671461]
 
 Jean:
 	* Fixed crash with sheet object. [#671617]
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 663e03a..becfbd7 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-22  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* openoffice-write.c (odf_write_graph_styles): write number styles
+	(odf_write_gog_style): write axis data format
+	(odf_write_graphs): clear the data style hashes
+
 2012-03-21  Morten Welinder  <terra gnome org>
 
 	* openoffice-write.c (create_new_xml_child): new function.
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 7ecef73..a05a3fa 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -5448,6 +5448,11 @@ odf_write_graph_styles (GnmOOExport *state, GsfOutput *child)
 	g_hash_table_foreach (state->graph_gradients, (GHFunc) odf_write_gradient_info, state);
 	g_hash_table_foreach (state->graph_fill_images, (GHFunc) odf_write_fill_images_info, state);
 
+	g_hash_table_foreach (state->xl_styles, (GHFunc) odf_write_this_xl_style, state);
+	g_hash_table_foreach (state->xl_styles_neg, (GHFunc) odf_write_this_xl_style_neg, state);
+	g_hash_table_foreach (state->xl_styles_zero, (GHFunc) odf_write_this_xl_style_zero, state);
+	g_hash_table_foreach (state->xl_styles_conditional, (GHFunc) odf_write_this_conditional_xl_style, state);
+
 	gsf_xml_out_end_element (state->xml); /* </office:styles> */
 	gsf_xml_out_end_element (state->xml); /* </office:document-styles> */
 
@@ -6785,6 +6790,12 @@ odf_write_gog_style_chart (GnmOOExport *state, GOStyle const *style, GogObject c
 	if (GOG_IS_PLOT (obj))
 		odf_write_plot_style (state, obj);
 
+	if (GOG_IS_AXIS (obj)) {
+		GOFormat *fmt = gog_axis_get_format (GOG_AXIS (obj));
+		odf_add_bool (state->xml, CHART "link-data-style-to-source", fmt == NULL);
+	}
+	
+
 	func = g_hash_table_lookup (state->chart_props_hash, type);
 	if (func != NULL)
 		func (state, style, obj);
@@ -6838,6 +6849,19 @@ odf_write_gog_style (GnmOOExport *state, GOStyle const *style,
 	if (name != NULL) {
 		odf_start_style (state->xml, name, "chart");
 
+		if (GOG_IS_AXIS (obj)) {
+			GOFormat *fmt = gog_axis_get_format (GOG_AXIS (obj));
+			if (fmt) {
+				char const *name = NULL;
+				if (go_format_is_simple (fmt))
+					name = xl_find_format (state, fmt, 0);
+				else
+					name = xl_find_conditional_format (state, fmt);
+				if (name != NULL)
+					gsf_xml_out_add_cstr (state->xml, STYLE "data-style-name", name);
+			}
+		}
+
 		gsf_xml_out_start_element (state->xml, STYLE "chart-properties");
 		odf_write_gog_style_chart (state, style, obj);
 		gsf_xml_out_end_element (state->xml); /* </style:chart-properties> */
@@ -7613,6 +7637,11 @@ odf_write_graphs (SheetObject *graph, char const *name, GnmOOExport *state)
 {
 	GsfOutput  *child;
 
+	g_hash_table_remove_all (state->xl_styles);
+	g_hash_table_remove_all (state->xl_styles_neg);
+	g_hash_table_remove_all (state->xl_styles_zero);
+	g_hash_table_remove_all (state->xl_styles_conditional);
+
 	state->object_name = name;
 
 	child = gsf_outfile_new_child_full (state->outfile, name, TRUE,



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