[gnumeric] fix AppVersion format in xlsx export



commit c8570e8a90f9c159f803c723825d031aefd6ae8b
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Sat Jun 25 21:00:40 2011 -0600

    fix AppVersion format in xlsx export
    
    2011-06-25  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* xlsx-write-docprops.c (xlsx_write_docprops_app): The
    	AppVersion format should really be d.dddd.

 plugins/excel/ChangeLog             |    5 +++++
 plugins/excel/xlsx-write-docprops.c |   29 ++++++++++++++++++++++++++++-
 plugins/excel/xlsx-write.c          |    1 +
 3 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index bb48f10..565886a 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,10 @@
 2011-06-25  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* xlsx-write-docprops.c (xlsx_write_docprops_app): The
+	AppVersion format should really be d.dddd.
+
+2011-06-25  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* xlsx-read-docprops.c (xlsx_read_core_prop_type): renamed
 	to xlsx_read_prop_type
 	(xlsx_read_core_prop): renamed to xlsx_read_prop
diff --git a/plugins/excel/xlsx-write-docprops.c b/plugins/excel/xlsx-write-docprops.c
index 0400bef..1cdb97a 100644
--- a/plugins/excel/xlsx-write-docprops.c
+++ b/plugins/excel/xlsx-write-docprops.c
@@ -136,7 +136,7 @@ xlsx_write_docprops_app (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfil
 	gsf_xml_out_start_element (xml, "AppVersion");
 	/*1.10.17 is not permitted for AppVersion, so we need to convert it to 1.1017 */
 	version = GNM_VERSION_EPOCH + 0.01 * GNM_VERSION_MAJOR + 0.0001 * GNM_VERSION_MINOR;
-	gsf_xml_out_add_float (xml, NULL, version, 4);
+	gsf_xml_out_add_float (xml, NULL, version, 5);
 	gsf_xml_out_end_element (xml); /* </AppVersion> */
 
 	gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props_extended, xml);	
@@ -298,10 +298,37 @@ xlsx_write_docprops_core (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfi
 }
 
 static void
+xlsx_write_docprops_custom (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfile *docprops_dir)
+{
+#if 0
+	GsfOutput *part = gsf_outfile_open_pkg_add_rel 
+		(docprops_dir, "custom.xml",
+		 "application/vnd.openxmlformats-officedocument.custom-properties+xml",
+		 root_part,
+		 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";);
+	GsfXMLOut *xml = gsf_xml_out_new (part);
+	GsfDocMetaData *meta = go_doc_get_meta_data (GO_DOC (state->base.wb));
+
+	gsf_xml_out_start_element (xml, "Properties");
+	gsf_xml_out_add_cstr_unchecked (xml, "xmlns", ns_docprops_custom);
+	gsf_xml_out_add_cstr_unchecked (xml, "xmlns:vt", ns_docprops_extended_vt);
+
+	/* gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props_custom, xml); */
+
+	gsf_xml_out_end_element (xml); /* </Properties> */
+	
+	g_object_unref (xml);
+	gsf_output_close (part);
+	g_object_unref (part);
+#endif
+}
+
+static void
 xlsx_write_docprops (XLSXWriteState *state, GsfOutfile *root_part)
 {
 	GsfOutfile *docprops_dir    = (GsfOutfile *)gsf_outfile_new_child (root_part, "docProps", TRUE);
 
 	xlsx_write_docprops_app (state, root_part, docprops_dir);
 	xlsx_write_docprops_core (state, root_part, docprops_dir);
+	xlsx_write_docprops_custom (state, root_part, docprops_dir);
 }
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 30fadbc..752421d 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -84,6 +84,7 @@ static char const *ns_docprops_core_dcterms  = "http://purl.org/dc/terms/";;
 static char const *ns_docprops_core_xsi      = "http://www.w3.org/2001/XMLSchema-instance";;
 static char const *ns_docprops_extended      = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";;
 static char const *ns_docprops_extended_vt   = "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes";;
+/* static char const *ns_docprops_custom        = "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";; */
 static char const *ns_drawing	 = "http://schemas.openxmlformats.org/drawingml/2006/main";;
 static char const *ns_chart	 = "http://schemas.openxmlformats.org/drawingml/2006/chart";;
 static char const *ns_rel	 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";;



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