[gnumeric] Watch for the null date in OOXML import. [#615777]



commit b932ae1462504f1a1b928de5700d1b22e453d7ac
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed Apr 14 22:41:23 2010 -0600

    Watch for the null date in OOXML import. [#615777]
    
    2010-04-14  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* xlsx-read.c (xlsx_CT_WorkbookPr): new
    	(xlsx_workbook_dtd); hook up xlsx_CT_WorkbookPr

 NEWS                      |    1 +
 plugins/excel/ChangeLog   |    5 +++++
 plugins/excel/xlsx-read.c |   22 +++++++++++++++++++++-
 3 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index cdd8413..7b0531f 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ Andreas:
 	* Various ODF export fixes.
 	* Adjust regression tool to reflect the changes to TDIST.
 	* Basic import and export of text boxes from ODF files.
+	* Watch for the null date in OOXML import. [#615777]
 
 Jean:
 	* Print pattern backgrounds. [#615365]
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index a85659a..c132a79 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-14  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* xlsx-read.c (xlsx_CT_WorkbookPr): new
+	(xlsx_workbook_dtd); hook up xlsx_CT_WorkbookPr
+
 2010-03-31  Jean Brefort  <jean brefort normalesup org>
 
 	* ms-chart.c (chart_write_AREAFORMAT): export transparent patterns as
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 398b94f..6286229 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -4073,6 +4073,26 @@ xlsx_CT_PivotCache (GsfXMLIn *xin, xmlChar const **attrs)
 }
 
 static void
+xlsx_CT_WorkbookPr (GsfXMLIn *xin, xmlChar const **attrs)
+{
+	static EnumVal const switchModes[] = {
+		{ "on",	 TRUE },
+		{ "1",	 TRUE },
+		{ "true", TRUE },
+		{ "off", FALSE },
+		{ "0", FALSE },
+		{ "false", FALSE },
+		{ NULL, 0 }
+	};
+	int tmp;
+	XLSXReadState *state = (XLSXReadState *)xin->user_state;
+
+	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
+		if (attr_enum (xin, attrs, "date1904", switchModes, &tmp))
+			workbook_set_1904 (state->wb, tmp);
+}
+
+static void
 xlsx_CT_CalcPr (GsfXMLIn *xin, xmlChar const **attrs)
 {
 	static EnumVal const calcModes[] = {
@@ -4244,7 +4264,7 @@ static GsfXMLInNode const xlsx_workbook_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, WORKBOOK, XL_NS_SS, "workbook", GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, &xlsx_wb_end, 0),
   GSF_XML_IN_NODE (WORKBOOK, VERSION, XL_NS_SS,	   "fileVersion", GSF_XML_NO_CONTENT, NULL, NULL),
-  GSF_XML_IN_NODE (WORKBOOK, PROPERTIES, XL_NS_SS, "workbookPr", GSF_XML_NO_CONTENT, NULL, NULL),
+  GSF_XML_IN_NODE (WORKBOOK, PROPERTIES, XL_NS_SS, "workbookPr", GSF_XML_NO_CONTENT, &xlsx_CT_WorkbookPr, NULL),
   GSF_XML_IN_NODE (WORKBOOK, CALC_PROPS, XL_NS_SS, "calcPr", GSF_XML_NO_CONTENT, &xlsx_CT_CalcPr, NULL),
 
   GSF_XML_IN_NODE (WORKBOOK, VIEWS,	 XL_NS_SS, "bookViews",	GSF_XML_NO_CONTENT, NULL, NULL),



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