[gnumeric] xlsx: don't complain over unknown tags inside <extLst>



commit 1c00e9fb03905a9985e8b9f7a1ecd0264ca40b24
Author: Morten Welinder <terra gnome org>
Date:   Fri Mar 13 21:35:59 2015 -0400

    xlsx: don't complain over unknown tags inside <extLst>

 configure.ac                      |    2 +-
 plugins/excel/ChangeLog           |    4 ++++
 plugins/excel/xlsx-read-drawing.c |    4 ++--
 plugins/excel/xlsx-read.c         |   17 ++++++++++++++---
 4 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dc607e4..87cf34b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,7 +153,7 @@ PKG_PROG_PKG_CONFIG(0.18)
 dnl *****************************
 libspreadsheet_reqs="
        libgoffice-${GOFFICE_API_VER}   >= 0.10.22
-       libgsf-1                >= 1.14.32
+       libgsf-1                >= 1.14.33
        libxml-2.0              >= 2.4.12
 "
 gnumeric_reqs="$libspreadsheet_reqs
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index b68b04b..21f9132 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-13  Morten Welinder  <terra gnome org>
+
+       * xlsx-read.c (xlsx_ext_begin): Ignore unknown stuff inside.
+
 2015-03-09  Morten Welinder  <terra gnome org>
 
        * xlsx-read-drawing.c (cb_axis_set_position): Set position of
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index 01948ae..b91309c 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -2311,7 +2311,7 @@ GSF_XML_IN_NODE_FULL (START, CHART_SPACE, XL_NS_CHART, "chartSpace", GSF_XML_NO_
             GSF_XML_IN_NODE (PR_P_PR_DEF, PR_P_PR_DEF_ULNTX, XL_NS_DRAW, "uLnTx", GSF_XML_NO_CONTENT, NULL, 
NULL),
         GSF_XML_IN_NODE (TEXT_PR_P, PR_P_PR_END,XL_NS_DRAW, "endParaRPr", GSF_XML_NO_CONTENT, NULL, NULL),
     GSF_XML_IN_NODE (SHAPE_PR, EXTLST, XL_NS_DRAW, "extLst", GSF_XML_NO_CONTENT, NULL, NULL),
-      GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_DRAW, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, NULL),
+      GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_DRAW, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, 
&xlsx_ext_end),
         GSF_XML_IN_NODE (EXTITEM, EXT_GOSTYLE, XL_NS_GNM_EXT, "gostyle", GSF_XML_NO_CONTENT, 
&xlsx_ext_gostyle, NULL),
 
   GSF_XML_IN_NODE (CHART_SPACE, TEXT_PR, XL_NS_CHART, "txPr", GSF_XML_NO_CONTENT, NULL, NULL),         /* 
2nd Def */
@@ -3284,7 +3284,7 @@ GSF_XML_IN_NODE_FULL (START, DRAWING, XL_NS_SS_DRAW, "wsDr", GSF_XML_NO_CONTENT,
           GSF_XML_IN_NODE (CXN_SP, SP_XFRM_STYLE, XL_NS_SS_DRAW, "style", GSF_XML_NO_CONTENT, NULL, NULL),
         GSF_XML_IN_NODE (SHAPE_PR, SP_PR_PRST_GEOM, XL_NS_DRAW, "prstGeom", GSF_XML_NO_CONTENT, NULL, NULL),
         GSF_XML_IN_NODE (SHAPE_PR, EXTLST, XL_NS_DRAW, "extLst", GSF_XML_NO_CONTENT, NULL, NULL),
-          GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_DRAW, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, NULL),
+          GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_DRAW, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, 
&xlsx_ext_end),
             GSF_XML_IN_NODE (EXTITEM, EXT_GOSTYLE, XL_NS_GNM_EXT, "gostyle", GSF_XML_NO_CONTENT, 
&xlsx_ext_gostyle, NULL),
 
       GSF_XML_IN_NODE (SHAPE, TX_BODY, XL_NS_SS_DRAW, "txBody", GSF_XML_NO_CONTENT, &xlsx_chart_text_start, 
&xlsx_chart_text),
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 43e78d0..34f2036 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1147,6 +1147,7 @@ xlsx_parse_sqref (GsfXMLIn *xin, xmlChar const *refs)
 /***********************************************************************/
 
 static void xlsx_ext_begin (GsfXMLIn *xin, xmlChar const **attrs);
+static void xlsx_ext_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob);
 
 #include "xlsx-read-drawing.c"
 
@@ -3116,6 +3117,7 @@ xlsx_CT_worksheet (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
                &cb_find_pivots, (XLSXReadState *)xin->user_state);
 }
 
+
 static void
 xlsx_ext_begin (GsfXMLIn *xin, xmlChar const **attrs)
 {
@@ -3132,9 +3134,18 @@ xlsx_ext_begin (GsfXMLIn *xin, xmlChar const **attrs)
        if (!warned)
                xlsx_warning (xin,
                              _("Encountered uninterpretable \"ext\" extension with missing namespace"));
+       gsf_xml_in_set_silent_unknowns (xin, TRUE);
 }
 
 static void
+xlsx_ext_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
+{
+       gsf_xml_in_set_silent_unknowns (xin, FALSE);
+}
+
+
+
+static void
 add_attr (XLSXReadState *state, PangoAttribute *attr)
 {
        attr->start_index = 0;
@@ -3353,7 +3364,7 @@ static GsfXMLInNode const xlsx_sheet_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, SHEET, XL_NS_SS, "worksheet", GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, 
&xlsx_CT_worksheet, 0),
   GSF_XML_IN_NODE (SHEET, EXTLST, XL_NS_SS, "extLst", GSF_XML_NO_CONTENT, NULL, NULL),
-    GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_SS, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, NULL),
+    GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_SS, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, &xlsx_ext_end),
   GSF_XML_IN_NODE (SHEET, PROPS, XL_NS_SS, "sheetPr", GSF_XML_NO_CONTENT, &xlsx_CT_SheetPr, NULL),
     GSF_XML_IN_NODE (PROPS, OUTLINE_PROPS, XL_NS_SS, "outlinePr", GSF_XML_NO_CONTENT, NULL, NULL),
     GSF_XML_IN_NODE (PROPS, TAB_COLOR, XL_NS_SS, "tabColor", GSF_XML_NO_CONTENT, &xlsx_sheet_tabcolor, NULL),
@@ -4005,7 +4016,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, EXTLST, XL_NS_SS, "extLst", GSF_XML_NO_CONTENT, NULL, NULL),
-    GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_SS, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, NULL),
+    GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_SS, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, &xlsx_ext_end),
   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, &xlsx_CT_WorkbookPr, 
NULL),
   GSF_XML_IN_NODE (WORKBOOK, CALC_PROPS, XL_NS_SS, "calcPr", GSF_XML_NO_CONTENT, &xlsx_CT_CalcPr, NULL),
@@ -4697,7 +4708,7 @@ static GsfXMLInNode const xlsx_styles_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, STYLE_INFO, XL_NS_SS, "styleSheet", GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, 
NULL, 0),
   GSF_XML_IN_NODE (STYLE_INFO, EXTLST, XL_NS_SS, "extLst", GSF_XML_NO_CONTENT, NULL, NULL),
-    GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_SS, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, NULL),
+    GSF_XML_IN_NODE (EXTLST, EXTITEM, XL_NS_SS, "ext", GSF_XML_NO_CONTENT, &xlsx_ext_begin, &xlsx_ext_end),
   GSF_XML_IN_NODE (STYLE_INFO, NUM_FMTS, XL_NS_SS, "numFmts", GSF_XML_NO_CONTENT, NULL, NULL),
     GSF_XML_IN_NODE (NUM_FMTS, NUM_FMT, XL_NS_SS, "numFmt", GSF_XML_NO_CONTENT, &xlsx_style_numfmt, NULL),
 


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