sc/qa/uitest/autofilter/autofilter.py | 25 +++++++++++++++++++++++-- sc/qa/uitest/data/autofilter/tdf140968.xlsx |binary sc/qa/uitest/data/autofilter/time_value.xlsx |binary sc/source/ui/unoobj/datauno.cxx | 13 ------------- 4 files changed, 23 insertions(+), 15 deletions(-)
New commits: commit 6a2060cef22b19dbe04676c8c16776c4693b4dd8 Author: Balazs Varga <balazs.varga...@gmail.com> AuthorDate: Wed May 12 11:39:08 2021 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Thu May 27 13:03:47 2021 +0200 tdf#141309 tdf#142215 OOXML import: fix double conversion in autofilter resulting missing selection of filtered time values and numbers ending with zeroes. No need to convert the filter values from string to number and back at OOXML import, because we'll do that later in the model by filtering with the formatted cell values. Follow-up to commit d5c2584bf36d21580db677b231c57f99f49aa2cb "Related: tdf#140968 avoid duplicated filter values". Change-Id: I75e5b2391624ff85a8ed545926ec519355a356bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115473 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py index 00cfa6fbd9ba..3f20175ef618 100644 --- a/sc/qa/uitest/autofilter/autofilter.py +++ b/sc/qa/uitest/autofilter/autofilter.py @@ -325,6 +325,19 @@ class AutofilterTest(UITestCase): xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) + xFloatWindow = self.xUITest.getFloatWindow() + xCheckListMenu = xFloatWindow.getChild("check_list_menu") + xTreeList = xCheckListMenu.getChild("check_list_box") + self.assertEqual(5, len(xTreeList.getChildren())) + self.assertEqual('true', get_state_as_dict(xTreeList.getChild('0'))['IsChecked']) + self.assertEqual('false', 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']) + self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked']) + xOkBtn = xFloatWindow.getChild("cancel") + xOkBtn.executeAction("CLICK", tuple()) + xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"})) xFloatWindow = self.xUITest.getFloatWindow() xCheckListMenu = xFloatWindow.getChild("check_list_menu") @@ -344,11 +357,18 @@ class AutofilterTest(UITestCase): xFloatWindow = self.xUITest.getFloatWindow() xCheckListMenu = xFloatWindow.getChild("check_list_menu") xTreeList = xCheckListMenu.getChild("check_list_box") - self.assertEqual(4, len(xTreeList.getChildren())) + self.assertEqual(5, len(xTreeList.getChildren())) self.assertEqual("0.000", get_state_as_dict(xTreeList.getChild('0'))['Text']) self.assertEqual("0.046", get_state_as_dict(xTreeList.getChild('1'))['Text']) self.assertEqual("0.365", get_state_as_dict(xTreeList.getChild('2'))['Text']) - self.assertEqual("0.516", get_state_as_dict(xTreeList.getChild('3'))['Text']) + self.assertEqual("0.500", get_state_as_dict(xTreeList.getChild('3'))['Text']) + self.assertEqual("0.516", get_state_as_dict(xTreeList.getChild('4'))['Text']) + + self.assertEqual('false', get_state_as_dict(xTreeList.getChild('0'))['IsChecked']) + self.assertEqual('true', get_state_as_dict(xTreeList.getChild('1'))['IsChecked']) + self.assertEqual('false', get_state_as_dict(xTreeList.getChild('2'))['IsChecked']) + self.assertEqual('true', get_state_as_dict(xTreeList.getChild('3'))['IsChecked']) + self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked']) xFirstEntry = xTreeList.getChild("0") xFirstEntry.executeAction("CLICK", tuple()) @@ -365,6 +385,7 @@ class AutofilterTest(UITestCase): self.assertTrue(is_row_hidden(doc, 4)) self.assertFalse(is_row_hidden(doc, 5)) self.assertFalse(is_row_hidden(doc, 6)) + self.assertFalse(is_row_hidden(doc, 7)) self.ui_test.close_doc() diff --git a/sc/qa/uitest/data/autofilter/tdf140968.xlsx b/sc/qa/uitest/data/autofilter/tdf140968.xlsx index b2b5b2a3e654..e4dd31bd14dd 100644 Binary files a/sc/qa/uitest/data/autofilter/tdf140968.xlsx and b/sc/qa/uitest/data/autofilter/tdf140968.xlsx differ diff --git a/sc/qa/uitest/data/autofilter/time_value.xlsx b/sc/qa/uitest/data/autofilter/time_value.xlsx index 4dc6cf85eb2e..e81b4f24e3e4 100644 Binary files a/sc/qa/uitest/data/autofilter/time_value.xlsx and b/sc/qa/uitest/data/autofilter/time_value.xlsx differ diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index d1c1f55bc1a1..8bdc638c9705 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1149,20 +1149,7 @@ void fillQueryParam( if (aItem.meType == ScQueryEntry::ByString) { - sal_uInt32 nIndex = 0; aItem.mbFormattedValue = true; - bool bNumber = pDoc->GetFormatTable()->IsNumberFormat(rVal.StringValue, nIndex, aItem.mfVal); - if (bNumber) - { - if (aItem.mfVal != 0.0) - { - OUString aStr; - pDoc->GetFormatTable()->GetInputLineString(aItem.mfVal, nIndex, aStr); - aItem.maString = rPool.intern(aStr); - } - else - aItem.meType = ScQueryEntry::ByValue; - } } else if (aItem.meType == ScQueryEntry::ByValue) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits