sc/qa/uitest/autofilter/autofilterBugs.py  |   18 ++++++++++++++++++
 sc/qa/uitest/data/autofilter/tdf152082.ods |binary
 sc/source/filter/xml/xmlfilti.cxx          |    2 ++
 3 files changed, 20 insertions(+)

New commits:
commit f6728e75f814bfc4df533469ff7d90601de490e6
Author:     Tünde Tóth <toth.tu...@nisz.hu>
AuthorDate: Wed Dec 7 12:44:18 2022 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Tue Dec 20 07:51:29 2022 +0000

    tdf#152082 ODS: fix import of Empty filter operator
    
    Bad import of the Empty filter operator resulted shifted
    filter settings, e.g. selected "A" and "B" instead of
    "empty" and "A" from the range "empty", "A" and "B".
    
    Regression from commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d
    "tdf#142910 sc filter: fix "greater than" or "smaller than" etc".
    
    Change-Id: I33082d77fb9e707aa474fb22753a001960341d66
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143776
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 1f30f9cf012cee6823029ef5a96a1d91a0e16cdc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144481
    Tested-by: Jenkins

diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py 
b/sc/qa/uitest/autofilter/autofilterBugs.py
index a295c6307793..864cde7d83a0 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -252,4 +252,22 @@ class autofilter(UITestCase):
             xCancel = xFloatWindow.getChild("cancel")
             xCancel.executeAction("CLICK", tuple())
 
+        #tdf152082
+   def test_tdf152082(self):
+        with self.ui_test.load_file(get_url_for_data_file("tdf152082.ods")):
+            xCalcDoc = self.xUITest.getTopFocusWindow()
+            gridwin = xCalcDoc.getChild("grid_window")
+
+            gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": 
"", "COL": "0", "ROW": "0"}))
+            xFloatWindow = self.xUITest.getFloatWindow()
+            xCheckListMenu = xFloatWindow.getChild("FilterDropDown")
+            xTreeList = xCheckListMenu.getChild("check_list_box")
+            self.assertEqual(4, len(xTreeList.getChildren()))
+            self.assertEqual('true', 
get_state_as_dict(xTreeList.getChild('0'))['IsChecked'])
+            self.assertEqual('true', 
get_state_as_dict(xTreeList.getChild('1'))['IsChecked'])
+            self.assertEqual('true', 
get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
+            self.assertEqual('false', 
get_state_as_dict(xTreeList.getChild('3'))['IsChecked'])
+            xCancelBtn = xFloatWindow.getChild("cancel")
+            xCancelBtn.executeAction("CLICK", tuple())
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/autofilter/tdf152082.ods 
b/sc/qa/uitest/data/autofilter/tdf152082.ods
new file mode 100644
index 000000000000..6a0e1cac6751
Binary files /dev/null and b/sc/qa/uitest/data/autofilter/tdf152082.ods differ
diff --git a/sc/source/filter/xml/xmlfilti.cxx 
b/sc/source/filter/xml/xmlfilti.cxx
index e549a3438d78..7585ce0c50fa 100644
--- a/sc/source/filter/xml/xmlfilti.cxx
+++ b/sc/source/filter/xml/xmlfilti.cxx
@@ -422,6 +422,8 @@ void SAL_CALL ScXMLConditionContext::endFastElement( 
sal_Int32 /*nElement*/ )
     if (maQueryItems.empty())
     {
         ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
+        if (IsXMLToken(sOperator, XML_EMPTY))
+            return;
         if (IsXMLToken(sDataType, XML_NUMBER))
         {
             rItem.mfVal = sConditionValue.toDouble();

Reply via email to