[gnumeric] read extended properties from xlsx
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] read extended properties from xlsx
- Date: Sun, 26 Jun 2011 01:10:56 +0000 (UTC)
commit 451d89ea350bcc025d948b7135c50cfa2858ec20
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Sat Jun 25 19:09:29 2011 -0600
read extended properties from xlsx
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
(xlsx_read_core_prop_dt): renamed to xlsx_read_prop_dt
(xlsx_read_prop_int): new
(xlsx_read_prop_boolean): new
(xlsx_docprops_extended_dtd): new
(xlsx_read_docprops_extended): implement
* xlsx-read.c (xlsx_ns): add name spaces
* xlsx-utils.h (XL_NS_PROP): new
(XL_NS_PROP_VT): new
* xlsx-write-docprops.c (xlsx_write_docprops_app): The
AppVersion format is prescribed to d.dddd.
plugins/excel/ChangeLog | 16 ++++++
plugins/excel/xlsx-read-docprops.c | 88 ++++++++++++++++++++++++++---------
plugins/excel/xlsx-read.c | 2 +
plugins/excel/xlsx-utils.h | 4 +-
plugins/excel/xlsx-write-docprops.c | 7 ++-
5 files changed, 92 insertions(+), 25 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 1cfbe87..bb48f10 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,21 @@
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
+ (xlsx_read_core_prop_dt): renamed to xlsx_read_prop_dt
+ (xlsx_read_prop_int): new
+ (xlsx_read_prop_boolean): new
+ (xlsx_docprops_extended_dtd): new
+ (xlsx_read_docprops_extended): implement
+ * xlsx-read.c (xlsx_ns): add name spaces
+ * xlsx-utils.h (XL_NS_PROP): new
+ (XL_NS_PROP_VT): new
+ * xlsx-write-docprops.c (xlsx_write_docprops_app): The
+ AppVersion format is prescribed to d.dddd.
+
+2011-06-25 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* xlsx-write.c (ns_docprops_extended_vt): new
* xlsx-write-docprops.c (xlsx_map_prop_name_extended): new
(xlsx_meta_write_props_extended): new
diff --git a/plugins/excel/xlsx-read-docprops.c b/plugins/excel/xlsx-read-docprops.c
index 12356db..5035be2 100644
--- a/plugins/excel/xlsx-read-docprops.c
+++ b/plugins/excel/xlsx-read-docprops.c
@@ -38,7 +38,7 @@ xlsx_read_core_keys (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
}
static void
-xlsx_read_core_prop_type (GsfXMLIn *xin, GType g_type)
+xlsx_read_prop_type (GsfXMLIn *xin, GType g_type)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
GValue *res = g_new0 (GValue, 1);
@@ -51,35 +51,80 @@ xlsx_read_core_prop_type (GsfXMLIn *xin, GType g_type)
}
static void
-xlsx_read_core_prop (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
+xlsx_read_prop (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
- xlsx_read_core_prop_type (xin, G_TYPE_STRING);
+ xlsx_read_prop_type (xin, G_TYPE_STRING);
}
static void
-xlsx_read_core_prop_dt (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
+xlsx_read_prop_dt (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
- xlsx_read_core_prop_type (xin, GSF_TIMESTAMP_TYPE);
+ xlsx_read_prop_type (xin, GSF_TIMESTAMP_TYPE);
}
+static void
+xlsx_read_prop_int (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
+{
+ xlsx_read_prop_type (xin, G_TYPE_INT);
+}
+
+static void
+xlsx_read_prop_boolean (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
+{
+ xlsx_read_prop_type (xin, G_TYPE_BOOLEAN);
+}
+
+static GsfXMLInNode const xlsx_docprops_extended_dtd[] = {
+GSF_XML_IN_NODE_FULL (START, START, -1, NULL, GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, NULL, 0),
+GSF_XML_IN_NODE_FULL (START, X_PROPS, XL_NS_PROP, "Properties", GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, NULL, 0),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_TEMPLATE, XL_NS_PROP, "Template", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_TEMPLATE),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_MANAGER, XL_NS_PROP, "Manager", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_MANAGER),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_COMPANY, XL_NS_PROP, "Company", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_COMPANY),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_PAGES, XL_NS_PROP, "Pages", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_PAGE_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_WORDS, XL_NS_PROP, "Words", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_WORD_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_CHARACTERS, XL_NS_PROP, "Characters", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_CHARACTER_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_PRESENTATION_FORMAT, XL_NS_PROP, "PresentationFormat", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_PRESENTATION_FORMAT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_LINES, XL_NS_PROP, "Lines", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_LINE_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_PARAGRAPHS, XL_NS_PROP, "Paragraphs", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_PARAGRAPH_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_SLIDES, XL_NS_PROP, "Slides", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_SLIDE_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_NOTES, XL_NS_PROP, "Notes", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_NOTE_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_TOTAL_TIME, XL_NS_PROP, "TotalTime", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_EDITING_DURATION),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_HIDDEN_SLIDES, XL_NS_PROP, "HiddenSlides", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_HIDDEN_SLIDE_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_MMCLIPS, XL_NS_PROP, "MMClips", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = "xlsx:MMClips"),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_SCALE_CROP, XL_NS_PROP, "ScaleCrop", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_boolean, .v_str = GSF_META_NAME_SCALE),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_LINKS_UP_TO_DATE, XL_NS_PROP, "LinksUpToDate", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_boolean, .v_str = GSF_META_NAME_LINKS_DIRTY),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_CHARACTERS_WITH_SPACES, XL_NS_PROP, "CharactersWithSpaces", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_BYTE_COUNT),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_SHARED_DOC, XL_NS_PROP, "SharedDoc", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_boolean, .v_str = "xlsx:SharedDoc"),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_HYPERLINK_BASE, XL_NS_PROP, "HyperlinkBase", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = "xlsx:HyperlinkBase"),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_HYPERLINKS_CHANGED, XL_NS_PROP, "HyperlinksChanged", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_boolean, .v_str = "xlsx:HyperlinksChanged"),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_DOC_SECURITY, XL_NS_PROP, "DocSecurity", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_int, .v_str = GSF_META_NAME_SECURITY),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_DIG_SIG, XL_NS_PROP, "DigSig", GSF_XML_CONTENT, FALSE, FALSE, NULL, NULL, .v_str = ""),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_HEADING_PAIRS, XL_NS_PROP, "HeadingPairs", GSF_XML_CONTENT, FALSE, FALSE, NULL, NULL, .v_str = ""),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_HLINKS, XL_NS_PROP, "HLinks", GSF_XML_CONTENT, FALSE, FALSE, NULL, NULL, .v_str = ""),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_TITLES_OF_PARTS, XL_NS_PROP, "TitlesOfParts", GSF_XML_CONTENT, FALSE, FALSE, NULL, NULL, .v_str = ""),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_APPLICATION, XL_NS_PROP, "Application", GSF_XML_CONTENT, FALSE, FALSE, NULL, NULL, .v_str = ""),
+GSF_XML_IN_NODE_FULL (X_PROPS, X_PROP_APP_VERSION, XL_NS_PROP, "AppVersion", GSF_XML_CONTENT, FALSE, FALSE, NULL, NULL, .v_str = ""),
+GSF_XML_IN_NODE_END
+};
+
static GsfXMLInNode const xlsx_docprops_core_dtd[] = {
GSF_XML_IN_NODE_FULL (START, START, -1, NULL, GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, NULL, 0),
GSF_XML_IN_NODE_FULL (START, CORE_PROPS, XL_NS_PROP_CP, "coreProperties", GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, NULL, 0),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CATEGORY, XL_NS_PROP_CP, "category", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_CATEGORY),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CONTENT_STATUS, XL_NS_PROP_CP, "contentStatus", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = "cp:contentStatus"),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CONTENT_TYPE, XL_NS_PROP_CP, "contentType", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = "cp:contentType"),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CATEGORY, XL_NS_PROP_CP, "category", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_CATEGORY),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CONTENT_STATUS, XL_NS_PROP_CP, "contentStatus", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = "cp:contentStatus"),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CONTENT_TYPE, XL_NS_PROP_CP, "contentType", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = "cp:contentType"),
GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_KEYWORDS, XL_NS_PROP_CP, "keywords", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_keys, 0),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_LAST_NODIFIED_BY, XL_NS_PROP_CP, "lastModifiedBy", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_CREATOR),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_LAST_PRINTED, XL_NS_PROP_CP, "lastPrinted", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop_dt, .v_str = GSF_META_NAME_PRINT_DATE),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_REVISION, XL_NS_PROP_CP, "revision", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_REVISION_COUNT),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_VERSION, XL_NS_PROP_CP, "version", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = "cp:version"),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CREATOR, XL_NS_PROP_DC, "creator", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_INITIAL_CREATOR),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_DESCRIPTION, XL_NS_PROP_DC, "description", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_DESCRIPTION),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_IDENTIFIER, XL_NS_PROP_DC, "identifier", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = "dc:identifier"),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_LANGUAGE, XL_NS_PROP_DC, "language", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_LANGUAGE),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_SUBJECT, XL_NS_PROP_DC, "subject", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_SUBJECT),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_TITLE, XL_NS_PROP_DC, "title", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop, .v_str = GSF_META_NAME_TITLE),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CREATED, XL_NS_PROP_DCTERMS, "created", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop_dt, .v_str = GSF_META_NAME_DATE_CREATED),
-GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_MODIFIED, XL_NS_PROP_DCTERMS, "modified", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_core_prop_dt, .v_str = GSF_META_NAME_DATE_MODIFIED),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_LAST_NODIFIED_BY, XL_NS_PROP_CP, "lastModifiedBy", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_CREATOR),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_LAST_PRINTED, XL_NS_PROP_CP, "lastPrinted", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_dt, .v_str = GSF_META_NAME_PRINT_DATE),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_REVISION, XL_NS_PROP_CP, "revision", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_REVISION_COUNT),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_VERSION, XL_NS_PROP_CP, "version", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = "cp:version"),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CREATOR, XL_NS_PROP_DC, "creator", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_INITIAL_CREATOR),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_DESCRIPTION, XL_NS_PROP_DC, "description", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_DESCRIPTION),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_IDENTIFIER, XL_NS_PROP_DC, "identifier", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = "dc:identifier"),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_LANGUAGE, XL_NS_PROP_DC, "language", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_LANGUAGE),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_SUBJECT, XL_NS_PROP_DC, "subject", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_SUBJECT),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_TITLE, XL_NS_PROP_DC, "title", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop, .v_str = GSF_META_NAME_TITLE),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_CREATED, XL_NS_PROP_DCTERMS, "created", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_dt, .v_str = GSF_META_NAME_DATE_CREATED),
+GSF_XML_IN_NODE_FULL (CORE_PROPS, PROP_MODIFIED, XL_NS_PROP_DCTERMS, "modified", GSF_XML_CONTENT, FALSE, FALSE, NULL, &xlsx_read_prop_dt, .v_str = GSF_META_NAME_DATE_MODIFIED),
GSF_XML_IN_NODE_END
};
@@ -109,8 +154,7 @@ xlsx_read_docprops_extended (XLSXReadState *state)
"extended-properties", NULL);
if (in == NULL) return;
- /* xlsx_parse_stream (&state, in, xlsx_docprops_extended_dtd); */
- g_object_unref (in);
+ xlsx_parse_stream (state, in, xlsx_docprops_extended_dtd);
}
static void
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index fedc4df..3e25ee6 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -277,6 +277,8 @@ static GsfXMLInNS const xlsx_ns[] = {
GSF_XML_IN_NS (XL_NS_PROP_DCMITYPE, "http://purl.org/dc/dcmitype"),
GSF_XML_IN_NS (XL_NS_PROP_DCTERMS, "http://purl.org/dc/terms/"),
GSF_XML_IN_NS (XL_NS_PROP_XSI, "http://www.w3.org/2001/XMLSchema-instance"),
+ GSF_XML_IN_NS (XL_NS_PROP, "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"),
+ GSF_XML_IN_NS (XL_NS_PROP_VT, "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"),
{ NULL }
};
diff --git a/plugins/excel/xlsx-utils.h b/plugins/excel/xlsx-utils.h
index 7cefe9e..6b1419d 100644
--- a/plugins/excel/xlsx-utils.h
+++ b/plugins/excel/xlsx-utils.h
@@ -41,7 +41,9 @@ enum {
XL_NS_PROP_DC,
XL_NS_PROP_DCMITYPE,
XL_NS_PROP_DCTERMS,
- XL_NS_PROP_XSI
+ XL_NS_PROP_XSI,
+ XL_NS_PROP,
+ XL_NS_PROP_VT
};
#define XLSX_MaxCol 16384
diff --git a/plugins/excel/xlsx-write-docprops.c b/plugins/excel/xlsx-write-docprops.c
index 3b97032..0400bef 100644
--- a/plugins/excel/xlsx-write-docprops.c
+++ b/plugins/excel/xlsx-write-docprops.c
@@ -125,7 +125,8 @@ xlsx_write_docprops_app (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfil
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties");
GsfXMLOut *xml = gsf_xml_out_new (part);
GsfDocMetaData *meta = go_doc_get_meta_data (GO_DOC (state->base.wb));
-
+ double version;
+
gsf_xml_out_start_element (xml, "Properties");
gsf_xml_out_add_cstr_unchecked (xml, "xmlns", ns_docprops_extended);
gsf_xml_out_add_cstr_unchecked (xml, "xmlns:vt", ns_docprops_extended_vt);
@@ -133,7 +134,9 @@ xlsx_write_docprops_app (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfil
gsf_xml_out_add_cstr_unchecked (xml, NULL, PACKAGE_NAME);
gsf_xml_out_end_element (xml); /* </Application> */
gsf_xml_out_start_element (xml, "AppVersion");
- gsf_xml_out_add_cstr_unchecked (xml, NULL, VERSION);
+ /*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_end_element (xml); /* </AppVersion> */
gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props_extended, xml);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]