[Libreoffice-commits] core.git: cui/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu May 20 10:39:20 UTC 2021


 cui/source/dialogs/splitcelldlg.cxx |   11 ++++++-----
 cui/source/inc/splitcelldlg.hxx     |    2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 39001d0ad8de4aa0b8f643aeadc1ec415e1d66e2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 20 09:38:42 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 20 12:38:35 2021 +0200

    use toggle instead of click for RadioButton
    
    doesn't seem sensible to listen to the prop checkbox in this handler
    
    Change-Id: If514b5a9072e789b6b2cbfc990714e236335d99c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115854
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/dialogs/splitcelldlg.cxx b/cui/source/dialogs/splitcelldlg.cxx
index f58b8cc0ece5..45511a59b794 100644
--- a/cui/source/dialogs/splitcelldlg.cxx
+++ b/cui/source/dialogs/splitcelldlg.cxx
@@ -28,9 +28,8 @@ SvxSplitTableDlg::SvxSplitTableDlg(weld::Window *pParent, bool bIsTableVertical,
     , mnMaxVertical(nMaxVertical)
     , mnMaxHorizontal(nMaxHorizontal)
 {
-    m_xHorzBox->connect_clicked(LINK(this, SvxSplitTableDlg, ClickHdl));
-    m_xPropCB->connect_clicked(LINK(this, SvxSplitTableDlg, ClickHdl));
-    m_xVertBox->connect_clicked(LINK(this, SvxSplitTableDlg, ClickHdl));
+    m_xHorzBox->connect_toggled(LINK(this, SvxSplitTableDlg, ToggleHdl));
+    m_xVertBox->connect_toggled(LINK(this, SvxSplitTableDlg, ToggleHdl));
 
     if (mnMaxVertical < 2)
     {
@@ -51,9 +50,11 @@ SvxSplitTableDlg::SvxSplitTableDlg(weld::Window *pParent, bool bIsTableVertical,
     }
 }
 
-IMPL_LINK(SvxSplitTableDlg, ClickHdl, weld::Button&, rButton, void)
+IMPL_LINK(SvxSplitTableDlg, ToggleHdl, weld::ToggleButton&, rButton, void)
 {
-    const bool bIsVert = &rButton == m_xVertBox.get();
+    if (!rButton.get_active())
+        return;
+    const bool bIsVert = m_xVertBox->get_active();
     tools::Long nMax = bIsVert ? mnMaxVertical : mnMaxHorizontal;
     m_xPropCB->set_sensitive(!bIsVert);
     m_xCountEdit->set_max(nMax);
diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx
index 86655a2a5755..22e61e0ff7fc 100644
--- a/cui/source/inc/splitcelldlg.hxx
+++ b/cui/source/inc/splitcelldlg.hxx
@@ -35,7 +35,7 @@ private:
 public:
     SvxSplitTableDlg(weld::Window *pParent, bool bIsTableVertical, tools::Long nMaxVertical, tools::Long nMaxHorizontal);
 
-    DECL_LINK(ClickHdl, weld::Button&, void);
+    DECL_LINK(ToggleHdl, weld::ToggleButton&, void);
 
     bool IsHorizontal() const;
     bool IsProportional() const;


More information about the Libreoffice-commits mailing list