[gnumeric] improve radar plot axes



commit 4541acf34f7822618d4252a6850c2a6fffc2438f
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Tue Aug 24 21:46:58 2010 -0600

    improve radar plot axes
    
    2010-08-24  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (oo_chart_axis): radar plots have different types
    	* openoffice-write.c (odf_write_plot): radar plots should write their
    	  properties and children

 plugins/openoffice/ChangeLog          |    6 ++++++
 plugins/openoffice/openoffice-read.c  |    8 +++++++-
 plugins/openoffice/openoffice-write.c |    2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index db05525..eebdc5e 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,11 @@
 2010-08-24  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-read.c (oo_chart_axis): radar plots have different types
+	* openoffice-write.c (odf_write_plot): radar plots should write their
+	  properties and children
+
+2010-08-24  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-read.c (oo_go_error_info_new_vprintf): new
 	(oo_warning): create hierachical error information
 	(openoffice_file_open): initialize and finalize error info
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index e3364b2..48eff17 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -4208,6 +4208,11 @@ oo_chart_axis (GsfXMLIn *xin, xmlChar const **attrs)
 		{ "z",	GOG_AXIS_Z },
 		{ NULL,	0 },
 	};
+	static OOEnum const types_radar[] = {
+		{ "x",	GOG_AXIS_CIRCULAR },
+		{ "y",	GOG_AXIS_RADIAL },
+		{ NULL,	0 },
+	};
 	GSList	*axes;
 
 	OOParseState *state = (OOParseState *)xin->user_state;
@@ -4221,7 +4226,8 @@ oo_chart_axis (GsfXMLIn *xin, xmlChar const **attrs)
 	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]);
-		else if (oo_attr_enum (xin, attrs, OO_NS_CHART, "dimension", types, &tmp))
+		else if (oo_attr_enum (xin, attrs, OO_NS_CHART, "dimension", 
+				       (state->chart.plot_type == OO_PLOT_RADAR)? types_radar :  types, &tmp))
 			axis_type = tmp;
 
 	axes = gog_chart_get_axes (state->chart.chart, axis_type);
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 8de5d5a..3066477 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -4542,7 +4542,7 @@ odf_write_plot (GnmOOExport *state, SheetObject *so, GogObject const *chart, Gog
 		  5., "X-Axis", "Y-Axis", NULL, odf_write_circle_axes_styles,
 		  odf_write_standard_series, NULL,
 		  NULL,
-		  odf_write_axis, odf_write_generic_axis, odf_write_axis},
+		  odf_write_axis, odf_write_axis, odf_write_axis},
 		{ "GogRadarPlot", CHART "radar", ODF_RADAR,
 		  10., "Circular-Axis", "Radial-Axis", NULL, odf_write_radar_axes_styles,
 		  odf_write_standard_series, NULL,



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