sc/source/ui/view/dbfunc.cxx |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 492c0973b4b53a419061d6d04f787d04ec50517d
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Mon Feb 3 15:10:30 2025 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Feb 6 15:20:22 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
    (cherry picked from commit 85f3a41d6909b4d8adb10012289e64dea88d12d1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181132
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 0123cbf648f7..31a4861e8ff8 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 );
 

Reply via email to