[gnumeric] Fix autofilter condition export to ODF. [part of #725458]



commit af6bdf2c40eeeb6a4e1242d5b76625f68a1f8f07
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sun Mar 2 00:52:22 2014 -0700

    Fix autofilter condition export to ODF. [part of #725458]
    
    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

 NEWS                                  |    1 +
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-write.c |    9 +++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index c17a806..ef17630 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Andreas:
        * Export frozen panes info to and import from ODF. [#725228]
        * Export and import more sheet properties to/from ODF. [#725258]
        * Fix validation import from ODF. [#725321]
+       * Fix autofilter condition export to ODF. [part of #725458]
 
 Jean:
        * Fix persistence of hyperlinks tips. [see #724108]
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index a767518..a23115f 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+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
+
 2014-03-01  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * openoffice-read.c (odf_validation_new_single_expr): only force
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 7ac6a2c..39d1f6c 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -4273,8 +4273,13 @@ odf_write_autofilter (GnmOOExport *state, GnmFilter const *filter)
 
        if (filter->is_active) {
                gsf_xml_out_start_element (state->xml, TABLE "filter");
-               for (i = 0 ; i < filter->fields->len ; i++)
-                       odf_write_filter_cond (state, filter, i);
+               if (filter->fields->len > 1) {
+                       gsf_xml_out_start_element (state->xml, TABLE "filter-and");
+                       for (i = 0 ; i < filter->fields->len ; i++)
+                               odf_write_filter_cond (state, filter, i);
+                       gsf_xml_out_end_element (state->xml); /* </table:filter-and> */
+               } else if (filter->fields->len == 1)
+                       odf_write_filter_cond (state, filter, 0);
                gsf_xml_out_end_element (state->xml); /* </table:filter> */
        }
 


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