summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2025-02-03 15:10:30 +0100
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2025-02-03 20:04:34 +0100
commit85f3a41d6909b4d8adb10012289e64dea88d12d1 (patch)
treed540f975558b0d1adea026dfa9b992f343802c9e /sc
parenta6c1ed0e9c3bbd87d483ecb7c5d667418ffb650e (diff)
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.mehrbrodt@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/dbfunc.cxx6
1 files changed, 1 insertions, 5 deletions
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 );