[gnumeric] Handle table:filter-or and table:filter-and elements in ODF import



commit 2627d360510493fe2a630dd66b62ed1a9f75ea13
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sun Mar 2 01:23:50 2014 -0700

    Handle table:filter-or and table:filter-and elements in ODF import
    
    2014-03-02  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_filter_or): new, warn when we encounter
        this element
        (opendoc_content_dtd): handle table:filter-or and table:filter-and
        elements
        (opendoc_content_preparse_dtd): ditto

 plugins/openoffice/ChangeLog         |    8 ++++++++
 plugins/openoffice/openoffice-read.c |   18 ++++++++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index a23115f..3a872b0 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,13 @@
 2014-03-02  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * openoffice-read.c (odf_filter_or): new, warn when we encounter
+       this element
+       (opendoc_content_dtd): handle table:filter-or and table:filter-and
+       elements
+       (opendoc_content_preparse_dtd): ditto
+
+2014-03-02  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * openoffice-write.c (odf_write_autofilter): write table:filter-and
        in the case of multiple conditions
 
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 2e48259..3fa881a 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -7328,6 +7328,12 @@ oo_db_range_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 }
 
 static void
+odf_filter_or (GsfXMLIn *xin, G_GNUC_UNUSED xmlChar const **attrs)
+{
+       oo_warning (xin, _("Gnumeric does not support 'or'-ed autofilter conditions."));
+}
+
+static void
 oo_filter_cond (GsfXMLIn *xin, xmlChar const **attrs)
 {
        static OOEnum const datatypes [] = {
@@ -11326,6 +11332,12 @@ static GsfXMLInNode const opendoc_content_dtd [] =
            GSF_XML_IN_NODE (DB_RANGES, DB_RANGE, OO_NS_TABLE, "database-range", GSF_XML_NO_CONTENT, 
&oo_db_range_start, &oo_db_range_end),
              GSF_XML_IN_NODE (DB_RANGE, FILTER, OO_NS_TABLE, "filter", GSF_XML_NO_CONTENT, NULL, NULL),
                GSF_XML_IN_NODE (FILTER, FILTER_COND, OO_NS_TABLE, "filter-condition", GSF_XML_NO_CONTENT, 
&oo_filter_cond, NULL),
+               GSF_XML_IN_NODE (FILTER, FILTER_AND, OO_NS_TABLE, "filter-and", GSF_XML_NO_CONTENT, NULL, 
NULL),
+                  GSF_XML_IN_NODE (FILTER_AND, FILTER_OR, OO_NS_TABLE, "filter-or", GSF_XML_NO_CONTENT, 
&odf_filter_or, NULL),
+                       GSF_XML_IN_NODE (FILTER_OR, FILTER_COND_IGNORE, OO_NS_TABLE, "filter-condition", 
GSF_XML_NO_CONTENT, NULL, NULL),
+                      GSF_XML_IN_NODE (FILTER_OR, FILTER_AND_IGNORE, OO_NS_TABLE, "filter-or", 
GSF_XML_NO_CONTENT, NULL, NULL),
+                  GSF_XML_IN_NODE (FILTER_AND, FILTER_COND, OO_NS_TABLE, "filter-condition", 
GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd def */
+                GSF_XML_IN_NODE (FILTER, FILTER_OR, OO_NS_TABLE, "filter-or", GSF_XML_NO_CONTENT, NULL, 
NULL),/* 2nd def */
            GSF_XML_IN_NODE (DB_RANGE, TABLE_SORT, OO_NS_TABLE, "sort", GSF_XML_NO_CONTENT, NULL, NULL),
              GSF_XML_IN_NODE (TABLE_SORT, SORT_BY, OO_NS_TABLE, "sort-by", GSF_XML_NO_CONTENT, NULL, NULL),
 
@@ -11593,6 +11605,12 @@ static GsfXMLInNode const opendoc_content_preparse_dtd [] =
            GSF_XML_IN_NODE (DB_RANGES, DB_RANGE, OO_NS_TABLE, "database-range", GSF_XML_NO_CONTENT, NULL, 
NULL),
              GSF_XML_IN_NODE (DB_RANGE, FILTER, OO_NS_TABLE, "filter", GSF_XML_NO_CONTENT, NULL, NULL),
                GSF_XML_IN_NODE (FILTER, FILTER_COND, OO_NS_TABLE, "filter-condition", GSF_XML_NO_CONTENT, 
NULL, NULL),
+               GSF_XML_IN_NODE (FILTER, FILTER_AND, OO_NS_TABLE, "filter-and", GSF_XML_NO_CONTENT, NULL, 
NULL),
+                  GSF_XML_IN_NODE (FILTER_AND, FILTER_OR, OO_NS_TABLE, "filter-or", GSF_XML_NO_CONTENT, 
NULL, NULL),
+                       GSF_XML_IN_NODE (FILTER_OR, FILTER_COND_IGNORE, OO_NS_TABLE, "filter-condition", 
GSF_XML_NO_CONTENT, NULL, NULL),
+                      GSF_XML_IN_NODE (FILTER_OR, FILTER_AND_IGNORE, OO_NS_TABLE, "filter-or", 
GSF_XML_NO_CONTENT, NULL, NULL),
+                  GSF_XML_IN_NODE (FILTER_AND, FILTER_COND, OO_NS_TABLE, "filter-condition", 
GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd def */
+                GSF_XML_IN_NODE (FILTER, FILTER_OR, OO_NS_TABLE, "filter-or", GSF_XML_NO_CONTENT, NULL, 
NULL),/* 2nd def */
            GSF_XML_IN_NODE (DB_RANGE, TABLE_SORT, OO_NS_TABLE, "sort", GSF_XML_NO_CONTENT, NULL, NULL),
              GSF_XML_IN_NODE (TABLE_SORT, SORT_BY, OO_NS_TABLE, "sort-by", GSF_XML_NO_CONTENT, NULL, NULL),
 


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