sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit e1c7923596f39bac8ce926b56a2450911ffde4d8
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Tue Mar 11 14:51:27 2025 +0100
Commit:     Rafael Lima <rafael.palma.l...@gmail.com>
CommitDate: Tue Mar 18 05:04:59 2025 +0100

    tdf#165678 Handle Duplicates dialog: make "All" checkbox work as in 
AutoFilter
    
    Change-Id: I5ed547d89ede1fe1ec413b1746b3cb2cd2c551d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182779
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    Reviewed-by: Sahil Gautam <sahil.gautam.ext...@allotropia.de>

diff --git a/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx 
b/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx
index 0817d3a75914..f3376ae17ec7 100644
--- a/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx
+++ b/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx
@@ -133,7 +133,6 @@ void ScDuplicateRecordsDlg::InsertEntry(const OUString& 
rTxt, bool bToggle)
     const int nRow = m_xCheckList->n_children() - 1;
     m_xCheckList->set_toggle(nRow, bToggle ? TRISTATE_TRUE : TRISTATE_FALSE);
     m_xCheckList->set_text(nRow, rTxt, 0);
-    m_xCheckList->set_sensitive(m_xAllChkBtn->get_state() != TRISTATE_TRUE);
 }
 
 void ScDuplicateRecordsDlg::Init()
@@ -171,7 +170,7 @@ void ScDuplicateRecordsDlg::Init()
         
!officecfg::Office::Calc::Misc::HandleDuplicateRecords::RemoveRecords::get());
 
     SetDialogLabels();
-    m_xAllChkBtn->set_state(TRISTATE_FALSE);
+    m_xAllChkBtn->set_state(TRISTATE_TRUE);
     SetDialogData(true);
 }
 
@@ -200,13 +199,18 @@ IMPL_LINK_NOARG(ScDuplicateRecordsDlg, RecordsChkHdl, 
const weld::TreeView::iter
 
     if (nRet == nTotalCount)
         m_xAllChkBtn->set_state(TRISTATE_TRUE);
-    else
+    else if (nRet == 0)
         m_xAllChkBtn->set_state(TRISTATE_FALSE);
+    else
+        m_xAllChkBtn->set_state(TRISTATE_INDET);
 }
 
 IMPL_LINK_NOARG(ScDuplicateRecordsDlg, AllCheckBtnHdl, weld::Toggleable&, void)
 {
-    SetDialogData(true);
+    if (m_xAllChkBtn->get_state() == TRISTATE_TRUE)
+        SetDialogData(true);
+    else
+        SetDialogData(false);
 }
 
 IMPL_LINK_NOARG(ScDuplicateRecordsDlg, OkHdl, weld::Button&, void)

Reply via email to