[gnumeric] export calculation settings to ODF



commit fc2284f41f284fb52e982e874e25308ea63a346a
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed May 20 21:52:12 2009 -0600

    export calculation settings to ODF
    
    2009-05-20  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-write.c (odf_print_spreadsheet_content_prelude): new
    	(odf_write_content): call odf_print_spreadsheet_content_prelude
---
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-write.c |   23 +++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 494c4a4..72bf5a7 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-20  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* openoffice-write.c (odf_print_spreadsheet_content_prelude): new
+	(odf_write_content): call odf_print_spreadsheet_content_prelude
+
 2009-05-19  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-write.c (equal_style): arguments can be const
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index f341812..beb8270 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -1545,6 +1545,26 @@ odf_write_autofilter (GnmOOExport *state, GnmFilter const *filter)
 }
 
 static void
+odf_print_spreadsheet_content_prelude (GnmOOExport *state)
+{
+	gsf_xml_out_start_element (state->xml, TABLE "calculation-settings");
+	gsf_xml_out_start_element (state->xml, TABLE "null-date");
+	/* As encouraged by the OpenFormula definition we "compensate" here. */
+	gsf_xml_out_add_cstr_unchecked (state->xml, TABLE "date-value", "1899-12-30");
+	gsf_xml_out_add_cstr_unchecked (state->xml, TABLE "value-type", "date");
+	gsf_xml_out_end_element (state->xml); /* </table:null-date> */	
+	gsf_xml_out_start_element (state->xml, TABLE "iteration");
+	gsf_xml_out_add_float (state->xml, TABLE "maximum-difference", 
+			       state->wb->iteration.tolerance, 6);
+	gsf_xml_out_add_cstr_unchecked (state->xml, TABLE "status", 
+					state->wb->iteration.enabled ?  "enable" : "disable");
+	gsf_xml_out_add_int (state->xml, TABLE "steps", state->wb->iteration.max_number);
+	gsf_xml_out_end_element (state->xml); /* </table:iteration> */	
+	gsf_xml_out_end_element (state->xml); /* </table:calculation-settings> */	
+}
+
+
+static void
 odf_write_content (GnmOOExport *state, GsfOutput *child)
 {
 	int i;
@@ -1572,6 +1592,9 @@ odf_write_content (GnmOOExport *state, GsfOutput *child)
 
 	gsf_xml_out_start_element (state->xml, OFFICE "body");
 	gsf_xml_out_start_element (state->xml, OFFICE "spreadsheet");
+
+	odf_print_spreadsheet_content_prelude (state);
+
 	for (i = 0; i < workbook_sheet_count (state->wb); i++) {
 		Sheet const *sheet = workbook_sheet_by_index (state->wb, i);
 		char *style_name;



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