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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu May 20 13:32:22 UTC 2021


 dbaccess/source/ui/inc/WCPage.hxx  |    3 +--
 dbaccess/source/ui/misc/WCPage.cxx |   29 +++++++++++++++--------------
 2 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 3f8e50f9b2fb35db190ce0204981f3f02d1d5ae6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 20 11:24:06 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 20 15:31:36 2021 +0200

    merge handlers into single toggle handler
    
    Change-Id: Ic168e3e0d06d732642dc222f5a3dd056fdb74b6e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115862
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx
index d56f983199bb..f340d0c4757e 100644
--- a/dbaccess/source/ui/inc/WCPage.hxx
+++ b/dbaccess/source/ui/inc/WCPage.hxx
@@ -40,8 +40,7 @@ namespace dbaui
         std::unique_ptr<weld::Label> m_xFT_KeyName;
         std::unique_ptr<weld::Entry> m_xEdKeyName;
 
-        DECL_LINK( AppendDataClickHdl, weld::Button&, void );
-        DECL_LINK( RadioChangeHdl, weld::Button&, void );
+        DECL_LINK( RadioChangeHdl, weld::ToggleButton&, void );
         DECL_LINK( KeyClickHdl, weld::ToggleButton&, void );
 
         bool checkAppendData();
diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx
index 3362f17250fe..64abfd101dfd 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -66,13 +66,12 @@ OCopyTable::OCopyTable(weld::Container* pPage, OCopyTableWizard* pWizard)
 
         m_xCB_PrimaryColumn->set_sensitive(m_bPKeyAllowed);
 
-        m_xRB_AppendData->connect_clicked(   LINK( this, OCopyTable, AppendDataClickHdl  ) );
+        m_xRB_AppendData->connect_toggled(  LINK( this, OCopyTable, RadioChangeHdl ) );
+        m_xRB_DefData->connect_toggled(     LINK( this, OCopyTable, RadioChangeHdl ) );
+        m_xRB_Def->connect_toggled(         LINK( this, OCopyTable, RadioChangeHdl ) );
+        m_xRB_View->connect_toggled(        LINK( this, OCopyTable, RadioChangeHdl ) );
 
-        m_xRB_DefData->connect_clicked(      LINK( this, OCopyTable, RadioChangeHdl      ) );
-        m_xRB_Def->connect_clicked(          LINK( this, OCopyTable, RadioChangeHdl      ) );
-        m_xRB_View->connect_clicked(         LINK( this, OCopyTable, RadioChangeHdl      ) );
-
-        m_xCB_PrimaryColumn->connect_toggled(LINK( this, OCopyTable, KeyClickHdl         ) );
+        m_xCB_PrimaryColumn->connect_toggled(LINK( this, OCopyTable, KeyClickHdl ) );
 
         m_xFT_KeyName->set_sensitive(false);
         m_xEdKeyName->set_sensitive(false);
@@ -89,11 +88,6 @@ OCopyTable::~OCopyTable()
 {
 }
 
-IMPL_LINK_NOARG( OCopyTable, AppendDataClickHdl, weld::Button&, void )
-{
-    SetAppendDataRadio();
-}
-
 void OCopyTable::SetAppendDataRadio()
 {
     m_pParent->EnableNextButton(true);
@@ -103,10 +97,17 @@ void OCopyTable::SetAppendDataRadio()
     m_pParent->setOperation(CopyTableOperation::AppendData);
 }
 
-IMPL_LINK(OCopyTable, RadioChangeHdl, weld::Button&, rButton, void)
+IMPL_LINK(OCopyTable, RadioChangeHdl, weld::ToggleButton&, rButton, void)
 {
-    m_pParent->EnableNextButton(&rButton != m_xRB_View.get());
-    bool bKey = m_bPKeyAllowed && &rButton != m_xRB_View.get();
+    if (!rButton.get_active())
+        return;
+    if (m_xRB_AppendData->get_active())
+    {
+        SetAppendDataRadio();
+        return;
+    }
+    m_pParent->EnableNextButton(m_xRB_View->get_active());
+    bool bKey = m_bPKeyAllowed && m_xRB_View->get_active();
     m_xFT_KeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
     m_xEdKeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
     m_xCB_PrimaryColumn->set_sensitive(bKey);


More information about the Libreoffice-commits mailing list