[Libreoffice-commits] core.git: include/svx svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed May 19 19:38:16 UTC 2021


 include/svx/ctredlin.hxx                  |    2 +-
 svx/source/dialog/SafeModeDialog.cxx      |   15 ++++++---------
 svx/source/dialog/SafeModeDialog.hxx      |    2 +-
 svx/source/dialog/ctredlin.cxx            |   14 +++++++-------
 svx/source/tbxctrls/extrusioncontrols.cxx |   29 +++++++++--------------------
 svx/source/tbxctrls/extrusioncontrols.hxx |    7 +++----
 svx/source/tbxctrls/fontworkgallery.cxx   |   27 ++++++++-------------------
 7 files changed, 35 insertions(+), 61 deletions(-)

New commits:
commit 9e27ac3ed8f2405a94bf07519ca7941731025e37
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 19 16:19:53 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed May 19 21:37:35 2021 +0200

    use toggle instead of click for RadioButton
    
    Change-Id: I8fb4a28f4be701858af0ae8e95ff0f45a5401490
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115821
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index cffb5be2fbee..c3e887ba1302 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -182,7 +182,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxTPFilter final : public SvxTPage
     std::unique_ptr<weld::Entry> m_xEdComment;
 
     DECL_LINK( SelDateHdl, weld::ComboBox&, void );
-    DECL_LINK( RowEnableHdl, weld::Button&, void );
+    DECL_LINK( RowEnableHdl, weld::ToggleButton&, void );
     DECL_LINK( TimeHdl, weld::Button&, void );
     DECL_LINK( ModifyHdl, weld::Entry&, void );
     DECL_LINK( ModifyListBoxHdl, weld::ComboBox&, void );
diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx
index 6cd0f306ad34..a3c8d453f2e3 100644
--- a/svx/source/dialog/SafeModeDialog.cxx
+++ b/svx/source/dialog/SafeModeDialog.cxx
@@ -57,10 +57,7 @@ SafeModeDialog::SafeModeDialog(weld::Window* pParent)
     , maBackupFileHelper()
 {
     m_xDialog->set_centered_on_parent(false);
-    mxRadioRestore->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl));
-    mxRadioConfigure->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl));
-    mxRadioExtensions->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl));
-    mxRadioReset->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl));
+    mxRadioRestore->connect_toggled(LINK(this, SafeModeDialog, RadioBtnHdl));
 
     mxBtnContinue->connect_clicked(LINK(this, SafeModeDialog, DialogBtnHdl));
     mxBtnRestart->connect_clicked(LINK(this, SafeModeDialog, DialogBtnHdl));
@@ -196,9 +193,9 @@ void SafeModeDialog::applyChanges()
         css::uno::Reference< css::task::XInteractionHandler >());
 }
 
-IMPL_LINK(SafeModeDialog, RadioBtnHdl, weld::Button&, rBtn, void)
+IMPL_LINK_NOARG(SafeModeDialog, RadioBtnHdl, weld::ToggleButton&, void)
 {
-    if (&rBtn == mxRadioRestore.get())
+    if (mxRadioRestore->get_active())
     {
         // Enable the currently selected box
         mxBoxRestore->set_sensitive(true);
@@ -209,7 +206,7 @@ IMPL_LINK(SafeModeDialog, RadioBtnHdl, weld::Button&, rBtn, void)
         mxBoxConfigure->set_sensitive(false);
         mxBoxDeinstall->set_sensitive(false);
     }
-    else if (&rBtn == mxRadioConfigure.get())
+    else if (mxRadioConfigure->get_active())
     {
         // Enable the currently selected box
         mxBoxConfigure->set_sensitive(true);
@@ -221,7 +218,7 @@ IMPL_LINK(SafeModeDialog, RadioBtnHdl, weld::Button&, rBtn, void)
         mxBoxDeinstall->set_sensitive(false);
 
     }
-    else if (&rBtn == mxRadioExtensions.get())
+    else if (mxRadioExtensions->get_active())
     {
         // Enable the currently selected box
         mxBoxDeinstall->set_sensitive(true);
@@ -232,7 +229,7 @@ IMPL_LINK(SafeModeDialog, RadioBtnHdl, weld::Button&, rBtn, void)
         mxBoxConfigure->set_sensitive(false);
         mxBoxReset->set_sensitive(false);
     }
-    else if (&rBtn == mxRadioReset.get())
+    else if (mxRadioReset->get_active())
     {
         // Enable the currently selected box
         mxBoxReset->set_sensitive(true);
diff --git a/svx/source/dialog/SafeModeDialog.hxx b/svx/source/dialog/SafeModeDialog.hxx
index daba66caffce..fca3bd9249b4 100644
--- a/svx/source/dialog/SafeModeDialog.hxx
+++ b/svx/source/dialog/SafeModeDialog.hxx
@@ -56,7 +56,7 @@ private:
     void enableDisableWidgets();
     void applyChanges();
 
-    DECL_LINK(RadioBtnHdl, weld::Button&, void);
+    DECL_LINK(RadioBtnHdl, weld::ToggleButton&, void);
     DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void);
     DECL_LINK(CreateZipBtnHdl, weld::Button&, void);
     DECL_LINK(DialogBtnHdl, weld::Button&, void);
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index d80f84890161..0a472b2074f1 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -526,12 +526,12 @@ SvxTPFilter::SvxTPFilter(weld::Container* pParent)
     m_xIbClock2->connect_clicked( LINK( this, SvxTPFilter,TimeHdl) );
     m_xBtnRange->connect_clicked( LINK( this, SvxTPFilter, RefHandle));
 
-    Link<weld::Button&,void> aLink=LINK( this, SvxTPFilter, RowEnableHdl) ;
-    m_xCbDate->connect_clicked(aLink);
-    m_xCbAuthor->connect_clicked(aLink);
-    m_xCbRange->connect_clicked(aLink);
-    m_xCbAction->connect_clicked(aLink);
-    m_xCbComment->connect_clicked(aLink);
+    Link<weld::ToggleButton&,void> aLink=LINK( this, SvxTPFilter, RowEnableHdl) ;
+    m_xCbDate->connect_toggled(aLink);
+    m_xCbAuthor->connect_toggled(aLink);
+    m_xCbRange->connect_toggled(aLink);
+    m_xCbAction->connect_toggled(aLink);
+    m_xCbComment->connect_toggled(aLink);
 
     Link<SvtCalendarBox&,void> a2Link=LINK(this, SvxTPFilter, ModifyDate);
     m_xDfDate->connect_activated(a2Link);
@@ -839,7 +839,7 @@ IMPL_LINK_NOARG(SvxTPFilter, SelDateHdl, weld::ComboBox&, void)
     bModified = true;
 }
 
-IMPL_LINK(SvxTPFilter, RowEnableHdl, weld::Button&, rCB, void)
+IMPL_LINK(SvxTPFilter, RowEnableHdl, weld::ToggleButton&, rCB, void)
 {
     if (&rCB == m_xCbDate.get())
     {
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index 65d407831ffc..60a060085f3a 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -142,8 +142,7 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow(
     mxDirectionSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
     mxDirectionSet->SetOutputSizePixel(aSize);
 
-    mxPerspective->connect_clicked(LINK(this, ExtrusionDirectionWindow, SelectToolbarMenuHdl));
-    mxParallel->connect_clicked(LINK(this, ExtrusionDirectionWindow, SelectToolbarMenuHdl));
+    mxPerspective->connect_toggled(LINK(this, ExtrusionDirectionWindow, SelectToolbarMenuHdl));
 
     AddStatusListener( g_sExtrusionDirection );
     AddStatusListener( g_sExtrusionProjection );
@@ -233,7 +232,7 @@ IMPL_LINK_NOARG(ExtrusionDirectionWindow, SelectValueSetHdl, ValueSet*, void)
     mxControl->EndPopupMode();
 }
 
-IMPL_LINK_NOARG(ExtrusionDirectionWindow, SelectToolbarMenuHdl, weld::Button&, void)
+IMPL_LINK_NOARG(ExtrusionDirectionWindow, SelectToolbarMenuHdl, weld::ToggleButton&, void)
 {
     int nProjection = mxPerspective->get_active() ? 0 : 1;
 
@@ -349,7 +348,7 @@ ExtrusionDepthWindow::ExtrusionDepthWindow(svt::PopupWindowController* pControl,
     mxDepth3->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl));
     mxDepth4->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl));
     mxInfinity->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl));
-    mxCustom->connect_clicked(LINK(this, ExtrusionDepthWindow, ClickHdl));
+    mxCustom->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl));
 
     AddStatusListener( gsExtrusionDepth );
     AddStatusListener( gsMetricUnit );
@@ -444,14 +443,9 @@ void ExtrusionDepthWindow::statusChanged(
     }
 }
 
-IMPL_LINK_NOARG(ExtrusionDepthWindow, ClickHdl, weld::Button&, void)
+IMPL_LINK_NOARG(ExtrusionDepthWindow, SelectHdl, weld::ToggleButton&, void)
 {
-    SelectHdl(*mxCustom);
-}
-
-IMPL_LINK(ExtrusionDepthWindow, SelectHdl, weld::ToggleButton&, rButton, void)
-{
-    if (mbSettingValue || !rButton.get_active())
+    if (mbSettingValue)
         return;
 
     if (mxCustom->get_active())
@@ -609,9 +603,7 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(svt::PopupWindowController* pCo
     mxLightingSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
     mxLightingSet->SetOutputSizePixel(aSize);
 
-    mxBright->connect_clicked(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl));
-    mxNormal->connect_clicked(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl));
-    mxDim->connect_clicked(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl));
+    mxBright->connect_toggled(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl));
 
     AddStatusListener( g_sExtrusionLightingDirection );
     AddStatusListener( g_sExtrusionLightingIntensity );
@@ -715,7 +707,7 @@ IMPL_LINK_NOARG(ExtrusionLightingWindow, SelectValueSetHdl, ValueSet*, void)
     mxControl->EndPopupMode();
 }
 
-IMPL_LINK_NOARG(ExtrusionLightingWindow, SelectToolbarMenuHdl, weld::Button&, void)
+IMPL_LINK_NOARG(ExtrusionLightingWindow, SelectToolbarMenuHdl, weld::ToggleButton&, void)
 {
     int nLevel;
     if (mxBright->get_active())
@@ -805,10 +797,7 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(svt::PopupWindowController* pCont
     , mxPlastic(m_xBuilder->weld_radio_button("plastic"))
     , mxMetal(m_xBuilder->weld_radio_button("metal"))
 {
-    mxWireFrame->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl));
-    mxMatt->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl));
-    mxPlastic->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl));
-    mxMetal->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl));
+    mxWireFrame->connect_toggled(LINK(this, ExtrusionSurfaceWindow, SelectHdl));
 
     AddStatusListener( g_sExtrusionSurface );
 }
@@ -849,7 +838,7 @@ void ExtrusionSurfaceWindow::statusChanged(
     }
 }
 
-IMPL_LINK_NOARG(ExtrusionSurfaceWindow, SelectHdl, weld::Button&, void)
+IMPL_LINK_NOARG(ExtrusionSurfaceWindow, SelectHdl, weld::ToggleButton&, void)
 {
     sal_Int32 nSurface;
     if (mxWireFrame->get_active())
diff --git a/svx/source/tbxctrls/extrusioncontrols.hxx b/svx/source/tbxctrls/extrusioncontrols.hxx
index 0a051e2c461d..440ef8874597 100644
--- a/svx/source/tbxctrls/extrusioncontrols.hxx
+++ b/svx/source/tbxctrls/extrusioncontrols.hxx
@@ -65,7 +65,7 @@ private:
 
     Image       maImgDirection[9];
 
-    DECL_LINK( SelectToolbarMenuHdl, weld::Button&, void );
+    DECL_LINK( SelectToolbarMenuHdl, weld::ToggleButton&, void );
     DECL_LINK( SelectValueSetHdl, ValueSet*, void );
 
     void implSetDirection( sal_Int32 nSkew, bool bEnabled );
@@ -106,7 +106,6 @@ private:
     bool        mbSettingValue;
 
     DECL_LINK( SelectHdl, weld::ToggleButton&, void );
-    DECL_LINK( ClickHdl, weld::Button&, void );
 
     void    implFillStrings( FieldUnit eUnit );
     void    implSetDepth( double fDepth );
@@ -151,7 +150,7 @@ private:
     void    implSetIntensity( int nLevel, bool bEnabled );
     void    implSetDirection( int nDirection, bool bEnabled );
 
-    DECL_LINK( SelectToolbarMenuHdl, weld::Button&, void );
+    DECL_LINK( SelectToolbarMenuHdl, weld::ToggleButton&, void );
     DECL_LINK( SelectValueSetHdl, ValueSet*, void );
 public:
     ExtrusionLightingWindow(svt::PopupWindowController* pControl, weld::Widget* pParentWindow);
@@ -186,7 +185,7 @@ private:
     std::unique_ptr<weld::RadioButton> mxPlastic;
     std::unique_ptr<weld::RadioButton> mxMetal;
 
-    DECL_LINK( SelectHdl, weld::Button&, void );
+    DECL_LINK( SelectHdl, weld::ToggleButton&, void );
 
     void    implSetSurface( int nSurface, bool bEnabled );
 
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 3c256c89b773..f024e8524fdb 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -480,7 +480,6 @@ private:
     bool mbSettingValue;
 
     DECL_LINK( SelectHdl, weld::ToggleButton&, void );
-    DECL_LINK( ClickHdl, weld::Button&, void );
 
     void    implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
     void    implSetKernCharacterPairs(bool bKernOnOff, bool bEnabled);
@@ -503,12 +502,7 @@ FontworkCharacterSpacingWindow::FontworkCharacterSpacingWindow(svt::PopupWindowC
     , mxKernPairs(m_xBuilder->weld_check_button("kernpairs"))
     , mbSettingValue(false)
 {
-    mxVeryTight->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
-    mxTight->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
     mxNormal->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
-    mxLoose->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
-    mxVeryLoose->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
-    mxCustom->connect_clicked(LINK(this, FontworkCharacterSpacingWindow, ClickHdl));
 
     mxKernPairs->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
 
@@ -602,17 +596,12 @@ void FontworkCharacterSpacingWindow::statusChanged( const css::frame::FeatureSta
     }
 }
 
-IMPL_LINK_NOARG(FontworkCharacterSpacingWindow, ClickHdl, weld::Button&, void)
+IMPL_LINK_NOARG(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, void)
 {
-    SelectHdl(*mxCustom);
-}
-
-IMPL_LINK(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, rButton, void)
-{
-    if (mbSettingValue || !rButton.get_active())
+    if (mbSettingValue)
         return;
 
-    if (&rButton == mxCustom.get())
+    if (mxCustom->get_active())
     {
         Sequence< PropertyValue > aArgs( 1 );
         aArgs[0].Name = OUString(gsFontworkCharacterSpacing).copy(5);
@@ -622,7 +611,7 @@ IMPL_LINK(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, rButto
         xControl->EndPopupMode();
         xControl->dispatchCommand(".uno:FontworkCharacterSpacingDialog", aArgs);
     }
-    else if (&rButton == mxKernPairs.get())
+    else if (mxKernPairs->get_active())
     {
         Sequence< PropertyValue > aArgs( 1 );
         aArgs[0].Name = OUString(gsFontworkKernCharacterPairs).copy(5);
@@ -636,13 +625,13 @@ IMPL_LINK(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, rButto
     else
     {
         sal_Int32 nCharacterSpacing;
-        if (&rButton == mxVeryTight.get())
+        if (mxVeryTight->get_active())
             nCharacterSpacing = 80;
-        else if (&rButton == mxTight.get())
+        else if (mxTight->get_active())
             nCharacterSpacing = 90;
-        else if (&rButton == mxLoose.get())
+        else if (mxLoose->get_active())
             nCharacterSpacing = 120;
-        else if (&rButton == mxVeryLoose.get())
+        else if (mxVeryLoose->get_active())
             nCharacterSpacing = 150;
         else
             nCharacterSpacing = 100;


More information about the Libreoffice-commits mailing list