[gnumeric] export basic chart legend to ODF



commit aba497ec51802e23dcd418df676ca9504ebe9e16
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Aug 16 00:59:42 2010 -0600

    export basic chart legend to ODF
    
    2010-08-16  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-write.c (odf_write_plot): export legend

 plugins/openoffice/ChangeLog          |    4 ++++
 plugins/openoffice/openoffice-write.c |   14 ++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index b08b5ba..e0ce76e 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-16  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* openoffice-write.c (odf_write_plot): export legend
+
 2010-08-15  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-read.c (od_style_prop_chart): add chart:pie-offset
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index e475417..0256019 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -3782,7 +3782,8 @@ odf_write_plot (GnmOOExport *state, SheetObject *so, GogObject const *chart, Gog
 	double res_pts[4] = {0.,0.,0.,0.};
 	GSList const *series, *l;
 	int i;
-	GogObject *wall = gog_object_get_child_by_name (plot, "Backplane");
+	GogObject const *wall = gog_object_get_child_by_name (plot, "Backplane");
+	GogObject const *legend = gog_object_get_child_by_name (chart, "Legend");
 
 	static struct {
 		char const * type;
@@ -3928,7 +3929,7 @@ odf_write_plot (GnmOOExport *state, SheetObject *so, GogObject const *chart, Gog
 	gsf_xml_out_start_element (state->xml, OFFICE "chart");
 	gsf_xml_out_start_element (state->xml, CHART "chart");
 
-	sheet_object_anchor_to_pts (anchor, state->sheet, res_pts);
+       	sheet_object_anchor_to_pts (anchor, state->sheet, res_pts);
 	odf_add_pt (state->xml, SVG "width", res_pts[2] - res_pts[0] - 2 * this_plot->pad);
 	odf_add_pt (state->xml, SVG "height", res_pts[3] - res_pts[1] - 2 * this_plot->pad);
 
@@ -3972,6 +3973,15 @@ odf_write_plot (GnmOOExport *state, SheetObject *so, GogObject const *chart, Gog
 		gsf_xml_out_end_element (state->xml); /* </chart:wall> */
 	}
 	gsf_xml_out_end_element (state->xml); /* </chart:plot_area> */
+
+	/* Set up legend if appropriate*/
+
+	if (legend != NULL) {
+		gsf_xml_out_start_element (state->xml, CHART "legend");
+		
+		gsf_xml_out_end_element (state->xml); /* </chart:legend> */
+	}
+
 	gsf_xml_out_end_element (state->xml); /* </chart:chart> */
 	gsf_xml_out_end_element (state->xml); /* </office:chart> */
 	gsf_xml_out_end_element (state->xml); /* </office:body> */



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