diff options
-rw-r--r-- | sc/qa/uitest/autofilter/autofilter.py | 27 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 19 | ||||
-rw-r--r-- | vcl/source/treelist/uiobject.cxx | 1 |
3 files changed, 40 insertions, 7 deletions
diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py index 000ddaab77e3..abb776ea8b99 100644 --- a/sc/qa/uitest/autofilter/autofilter.py +++ b/sc/qa/uitest/autofilter/autofilter.py @@ -114,4 +114,31 @@ class AutofilterTest(UITestCase): self.ui_test.close_doc() + def test_tdf134351(self): + doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods")) + + 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_tree_box") + + self.assertEqual(2, len(xTreeList.getChildren())) + self.assertTrue(get_state_as_dict(xTreeList.getChild('0'))['IsSelected']) + self.assertTrue(get_state_as_dict(xTreeList.getChild('1'))['IsSelected']) + + xOkBtn = xFloatWindow.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + self.assertFalse(is_row_hidden(doc, 0)) + # Without the fix in place, this test would have failed here + self.assertFalse(is_row_hidden(doc, 1)) + self.assertFalse(is_row_hidden(doc, 2)) + self.assertFalse(is_row_hidden(doc, 3)) + self.assertFalse(is_row_hidden(doc, 4)) + + self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index bb8cef1279f1..f6edb66554de 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -876,13 +876,18 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) if (aResult == aSaveAutoFilterResult) { SAL_INFO("sc.ui", "Apply autofilter to data when entries are the same"); - // Apply autofilter to data - ScQueryEntry* pEntry = aParam.FindEntryByField(rPos.Col(), true); - pEntry->bDoQuery = true; - pEntry->nField = rPos.Col(); - pEntry->eConnect = SC_AND; - pEntry->eOp = SC_EQUAL; - pViewData->GetView()->Query(aParam, nullptr, true); + + if (!rControl.isAllSelected()) + { + // Apply autofilter to data + ScQueryEntry* pEntry = aParam.FindEntryByField(rPos.Col(), true); + pEntry->bDoQuery = true; + pEntry->nField = rPos.Col(); + pEntry->eConnect = SC_AND; + pEntry->eOp = SC_EQUAL; + pViewData->GetView()->Query(aParam, nullptr, true); + } + return; } } diff --git a/vcl/source/treelist/uiobject.cxx b/vcl/source/treelist/uiobject.cxx index 1c9146c51101..e7fb516b5d21 100644 --- a/vcl/source/treelist/uiobject.cxx +++ b/vcl/source/treelist/uiobject.cxx @@ -106,6 +106,7 @@ StringMap TreeListEntryUIObject::get_state() aMap["Text"] = mxTreeList->GetEntryText(mpEntry); aMap["Children"] = OUString::number(mxTreeList->GetLevelChildCount(mpEntry)); aMap["VisibleChildCount"] = OUString::number(mxTreeList->GetVisibleChildCount(mpEntry)); + aMap["IsSelected"] = OUString::boolean(mxTreeList->IsSelected(mpEntry)); return aMap; } |