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 2f01443e84e6dc81a41c5a09da13cb8abfc6d534 Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Wed Dec 7 12:44:18 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Dec 19 15:54:24 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/+/144476 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py index 100ceaf246f1..6fa029985fcc 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();