sc/source/ui/view/dbfunc.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
New commits: commit 85f3a41d6909b4d8adb10012289e64dea88d12d1 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Mon Feb 3 15:10:30 2025 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Feb 3 20:04:34 2025 +0100 tdf#145056 Delete autofilter settings when turning off autofilter Otherwise when turning autofilter back on, colors will still be selected in the dropdown (while the filter is not active) Change-Id: I2bfeed08b187b3923e001d3b71658d5dc47556f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181053 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> Tested-by: Jenkins diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index 875531b37924..b330c89e662c 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -310,6 +310,7 @@ void ScDBFunc::ToggleAutoFilter() { nFlag = rDoc.GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG )->GetValue(); rDoc.ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr( nFlag & ~ScMF::Auto ) ); + aParam.RemoveAllEntriesByField(nCol); } // use a list action for the AutoFilter buttons (ScUndoAutoFilter) and the filter operation @@ -324,11 +325,6 @@ void ScDBFunc::ToggleAutoFilter() pDBData->SetAutoFilter(false); - // remove filter (incl. Paint / Undo) - - SCSIZE nEC = aParam.GetEntryCount(); - for (SCSIZE i=0; i<nEC; i++) - aParam.GetEntry(i).bDoQuery = false; aParam.bDuplicate = true; Query( aParam, nullptr, true );