sc/source/ui/cctrl/checklistmenu.cxx |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

New commits:
commit b3fc9d9280076973bcc47c3fbb03fc179ec17e26
Author:     Sahil Gautam <[email protected]>
AuthorDate: Thu Dec 4 14:25:53 2025 +0530
Commit:     Sahil Gautam <[email protected]>
CommitDate: Thu Dec 11 13:21:03 2025 +0100

    Related tdf#167395: Use descriptive variable name for returned value
    
    Change-Id: Iac01f5632e1601aac63955db45b92e13cfca1e9e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195061
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index c9d828b758c9..d5b1d2ca5766 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -858,6 +858,8 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, LockCheckedHdl, 
weld::Toggleable&, void)
     for (auto& aMember : maMembers)
         aMember.mbCheck = true;
 
+    bool bLockCheckedEntries = mxChkLockChecked->get_active();
+
     // go over the members visible in the popup, and remember which one is
     // checked, and which one is not
     mpChecks->all_foreach([this](weld::TreeIter& rEntry){
@@ -908,14 +910,14 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, LockCheckedHdl, 
weld::Toggleable&, void)
         std::vector<int> aFixedWidths { mnCheckWidthReq };
 
         // insert the members, remember whether checked or unchecked.
-        mpChecks->bulk_insert_for_each(aShownIndexes.size(), [this, 
&aShownIndexes](weld::TreeIter& rIter, int i) {
+        mpChecks->bulk_insert_for_each(aShownIndexes.size(), [this, 
&aShownIndexes, &bLockCheckedEntries](weld::TreeIter& rIter, int i) {
             size_t nIndex = aShownIndexes[i];
-            insertMember(*mpChecks, rIter, maMembers[nIndex], 
maMembers[nIndex].mbCheck, mxChkLockChecked->get_active());
+            insertMember(*mpChecks, rIter, maMembers[nIndex], 
maMembers[nIndex].mbCheck, bLockCheckedEntries);
         }, nullptr, &aFixedWidths);
     }
 
     // unmarking should happen after the members are inserted
-    if (!mxChkLockChecked->get_active())
+    if (!bLockCheckedEntries)
         for (auto& aMember : maMembers)
             aMember.mbMarked = false;
 }
commit 3f4c2bd3e3e712316e0d46b4f803b3bdc4f6ee5c
Author:     Sahil Gautam <[email protected]>
AuthorDate: Thu Dec 4 13:50:20 2025 +0530
Commit:     Sahil Gautam <[email protected]>
CommitDate: Thu Dec 11 13:20:48 2025 +0100

    Related tdf#167395: Break out of the loop after the entry has been found
    
    autofilter represents multiple instances of an entry as a single entry
    in the filter popup for obvious reasons, so we need not loop over all
    the entries to find other instances of the current entry.
    
    Change-Id: I72b2c7bd141615ac0c50927dfa7784f9b569e9ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195060
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 23727ebe9677..c9d828b758c9 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -864,14 +864,29 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, LockCheckedHdl, 
weld::Toggleable&, void)
         if (mpChecks->get_toggle(rEntry) == TRISTATE_TRUE)
         {
             for (auto& aMember : maMembers)
+            {
                 if (aMember.maName == mpChecks->get_text(rEntry))
+                {
                     aMember.mbMarked = true;
+                    /*
+                     * if there are multiple entries with the same
+                     * name in the range, they all show up as a single
+                     * entry in the autofilter, so we can break
+                     */
+                    break;
+                }
+            }
         }
         else
         {
             for (auto& aMember : maMembers)
+            {
                 if (aMember.maName == mpChecks->get_text(rEntry))
+                {
                     aMember.mbCheck = false;
+                    break;
+                }
+            }
         }
 
         return false;

Reply via email to