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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri May 21 09:36:58 UTC 2021


 sd/source/filter/html/pubdlg.cxx |   83 +++++++++++++++++++++++----------------
 sd/source/ui/dlg/present.cxx     |   19 ++++----
 sd/source/ui/inc/present.hxx     |    4 -
 sd/source/ui/inc/pubdlg.hxx      |   12 ++---
 4 files changed, 66 insertions(+), 52 deletions(-)

New commits:
commit d35e71409fac3d6054f2acb71a96e84888763f32
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 20 16:45:15 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 21 11:36:17 2021 +0200

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

diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 845139acbd72..cbd57662b76d 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -404,36 +404,36 @@ SdPublishingDlg::SdPublishingDlg(weld::Window* pWindow, DocumentType eDocType)
     m_xLastPageButton->connect_clicked(LINK(this,SdPublishingDlg,LastPageHdl));
     m_xNextPageButton->connect_clicked(LINK(this,SdPublishingDlg,NextPageHdl));
 
-    m_xPage1_NewDesign->connect_clicked(LINK(this,SdPublishingDlg,DesignHdl));
-    m_xPage1_OldDesign->connect_clicked(LINK(this,SdPublishingDlg,DesignHdl));
+    m_xPage1_NewDesign->connect_toggled(LINK(this,SdPublishingDlg,DesignHdl));
+    m_xPage1_OldDesign->connect_toggled(LINK(this,SdPublishingDlg,DesignHdl));
     m_xPage1_Designs->connect_changed(LINK(this,SdPublishingDlg,DesignSelectHdl));
     m_xPage1_DelDesign->connect_clicked(LINK(this,SdPublishingDlg,DesignDeleteHdl));
 
-    m_xPage2_Standard->connect_clicked(LINK(this,SdPublishingDlg,BaseHdl));
-    m_xPage2_Frames->connect_clicked(LINK(this,SdPublishingDlg,BaseHdl));
-    m_xPage2_SingleDocument->connect_clicked(LINK(this,SdPublishingDlg,BaseHdl));
-    m_xPage2_Kiosk->connect_clicked(LINK(this,SdPublishingDlg,BaseHdl));
-    m_xPage2_WebCast->connect_clicked(LINK(this,SdPublishingDlg,BaseHdl));
+    m_xPage2_Standard->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl));
+    m_xPage2_Frames->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl));
+    m_xPage2_SingleDocument->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl));
+    m_xPage2_Kiosk->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl));
+    m_xPage2_WebCast->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl));
 
     m_xPage2_Content->connect_toggled(LINK(this,SdPublishingDlg,ContentHdl));
 
-    m_xPage2_ASP->connect_clicked(LINK(this,SdPublishingDlg,WebServerHdl));
-    m_xPage2_PERL->connect_clicked(LINK(this,SdPublishingDlg,WebServerHdl));
+    m_xPage2_ASP->connect_toggled(LINK(this,SdPublishingDlg,WebServerHdl));
+    m_xPage2_PERL->connect_toggled(LINK(this,SdPublishingDlg,WebServerHdl));
     m_xPage2_Index->set_text("index" STR_HTMLEXP_DEFAULT_EXTENSION);
     m_xPage2_CGI->set_text("/cgi-bin/");
 
-    m_xPage3_Png->connect_clicked(LINK(this,SdPublishingDlg, GfxFormatHdl));
-    m_xPage3_Gif->connect_clicked(LINK(this,SdPublishingDlg, GfxFormatHdl));
-    m_xPage3_Jpg->connect_clicked(LINK(this,SdPublishingDlg, GfxFormatHdl));
+    m_xPage3_Png->connect_toggled(LINK(this,SdPublishingDlg, GfxFormatHdl));
+    m_xPage3_Gif->connect_toggled(LINK(this,SdPublishingDlg, GfxFormatHdl));
+    m_xPage3_Jpg->connect_toggled(LINK(this,SdPublishingDlg, GfxFormatHdl));
     m_xPage3_Quality->set_sensitive(false);
 
-    m_xPage3_Resolution_1->connect_clicked(LINK(this,SdPublishingDlg, ResolutionHdl ));
-    m_xPage3_Resolution_2->connect_clicked(LINK(this,SdPublishingDlg, ResolutionHdl ));
-    m_xPage3_Resolution_3->connect_clicked(LINK(this,SdPublishingDlg, ResolutionHdl ));
-    m_xPage3_Resolution_4->connect_clicked(LINK(this, SdPublishingDlg, ResolutionHdl));
+    m_xPage3_Resolution_1->connect_toggled(LINK(this,SdPublishingDlg, ResolutionHdl ));
+    m_xPage3_Resolution_2->connect_toggled(LINK(this,SdPublishingDlg, ResolutionHdl ));
+    m_xPage3_Resolution_3->connect_toggled(LINK(this,SdPublishingDlg, ResolutionHdl ));
+    m_xPage3_Resolution_4->connect_toggled(LINK(this, SdPublishingDlg, ResolutionHdl));
 
-    m_xPage2_ChgDefault->connect_clicked(LINK(this,SdPublishingDlg, SlideChgHdl));
-    m_xPage2_ChgAuto->connect_clicked(LINK(this,SdPublishingDlg, SlideChgHdl));
+    m_xPage2_ChgDefault->connect_toggled(LINK(this,SdPublishingDlg, SlideChgHdl));
+    m_xPage2_ChgAuto->connect_toggled(LINK(this,SdPublishingDlg, SlideChgHdl));
 
     m_xPage5_Buttons->SetSelectHdl(LINK(this,SdPublishingDlg, ButtonsHdl ));
     m_xPage5_Buttons->SetStyle( m_xPage5_Buttons->GetStyle() | WB_VSCROLL );
@@ -835,9 +835,12 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams )
 }
 
 // Clickhandler for the radiobuttons of the design-selection
-IMPL_LINK( SdPublishingDlg, DesignHdl, weld::Button&, rButton, void )
+IMPL_LINK( SdPublishingDlg, DesignHdl, weld::ToggleButton&, rButton, void )
 {
-    if (&rButton == m_xPage1_NewDesign.get())
+    if (!rButton.get_active())
+        return;
+
+    if (m_xPage1_NewDesign->get_active())
     {
         m_xPage1_NewDesign->set_active(true); // because of DesignDeleteHdl
         m_xPage1_OldDesign->set_active(false);
@@ -901,27 +904,35 @@ IMPL_LINK_NOARG(SdPublishingDlg, DesignDeleteHdl, weld::Button&, void)
 }
 
 // Clickhandler for the other servertypes
-IMPL_LINK( SdPublishingDlg, WebServerHdl, weld::Button&, rButton, void )
+IMPL_LINK(SdPublishingDlg, WebServerHdl, weld::ToggleButton&, rButton, void)
 {
-    bool bASP = &rButton == m_xPage2_ASP.get();
+    if (!rButton.get_active())
+        return;
 
+    bool bASP = m_xPage2_ASP->get_active();
     m_xPage2_ASP->set_sensitive( bASP );
     m_xPage2_PERL->set_sensitive( !bASP );
     UpdatePage();
 }
 
 // Clickhandler for the Radiobuttons of the graphicformat choice
-IMPL_LINK( SdPublishingDlg, GfxFormatHdl, weld::Button&, rButton, void )
+IMPL_LINK(SdPublishingDlg, GfxFormatHdl, weld::ToggleButton&, rButton, void)
 {
-    m_xPage3_Png->set_sensitive( &rButton == m_xPage3_Png.get() );
-    m_xPage3_Gif->set_sensitive( &rButton == m_xPage3_Gif.get() );
-    m_xPage3_Jpg->set_sensitive( &rButton == m_xPage3_Jpg.get() );
-    m_xPage3_Quality->set_sensitive(&rButton == m_xPage3_Jpg.get());
+    if (!rButton.get_active())
+        return;
+
+    m_xPage3_Png->set_sensitive(m_xPage3_Png->get_active());
+    m_xPage3_Gif->set_sensitive(m_xPage3_Gif->get_active());
+    m_xPage3_Jpg->set_sensitive(m_xPage3_Jpg->get_active());
+    m_xPage3_Quality->set_sensitive(m_xPage3_Jpg->get_active());
 }
 
 // Clickhandler for the Radiobuttons Standard/Frames
-IMPL_LINK_NOARG(SdPublishingDlg, BaseHdl, weld::Button&, void)
+IMPL_LINK(SdPublishingDlg, BaseHdl, weld::ToggleButton&, rButton, void)
 {
+    if (!rButton.get_active())
+        return;
+
     UpdatePage();
 }
 
@@ -947,12 +958,14 @@ IMPL_LINK_NOARG(SdPublishingDlg, ContentHdl, weld::ToggleButton&, void)
 }
 
 // Clickhandler for the Resolution Radiobuttons
-IMPL_LINK( SdPublishingDlg, ResolutionHdl, weld::Button&, rButton, void )
+IMPL_LINK( SdPublishingDlg, ResolutionHdl, weld::ToggleButton&, rButton, void )
 {
-    m_xPage3_Resolution_1->set_sensitive(&rButton == m_xPage3_Resolution_1.get());
-    m_xPage3_Resolution_2->set_sensitive(&rButton == m_xPage3_Resolution_2.get());
-    m_xPage3_Resolution_3->set_sensitive(&rButton == m_xPage3_Resolution_3.get());
-    m_xPage3_Resolution_4->set_sensitive(&rButton == m_xPage3_Resolution_4.get());
+    if (!rButton.get_active())
+        return;
+    m_xPage3_Resolution_1->set_sensitive(m_xPage3_Resolution_1->get_active());
+    m_xPage3_Resolution_2->set_sensitive(m_xPage3_Resolution_2->get_active());
+    m_xPage3_Resolution_3->set_sensitive(m_xPage3_Resolution_3->get_active());
+    m_xPage3_Resolution_4->set_sensitive(m_xPage3_Resolution_4->get_active());
 }
 
 // Clickhandler for the ValueSet with the bitmap-buttons
@@ -1004,8 +1017,10 @@ IMPL_LINK( SdPublishingDlg, ColorHdl, weld::Button&, rButton, void)
     m_xPage6_Preview->Invalidate();
 }
 
-IMPL_LINK_NOARG(SdPublishingDlg, SlideChgHdl, weld::Button&, void)
+IMPL_LINK(SdPublishingDlg, SlideChgHdl, weld::ToggleButton&, rButton, void)
 {
+    if (!rButton.get_active())
+        return;
     UpdatePage();
 }
 
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index bf4fb696e12a..7db0b22562ef 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -64,16 +64,16 @@ SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* pWindow, const SfxI
     m_xFormatter->SetExtFormat(ExtTimeFieldFormat::LongDuration);
     m_xFormatter->EnableEmptyField(false);
 
-    Link<weld::Button&,void> aLink( LINK( this, SdStartPresentationDlg, ChangeRangeHdl ) );
+    Link<weld::ToggleButton&,void> aLink( LINK( this, SdStartPresentationDlg, ChangeRangeHdl ) );
 
-    m_xRbtAll->connect_clicked( aLink );
-    m_xRbtAtDia->connect_clicked( aLink );
-    m_xRbtCustomshow->connect_clicked( aLink );
+    m_xRbtAll->connect_toggled( aLink );
+    m_xRbtAtDia->connect_toggled( aLink );
+    m_xRbtCustomshow->connect_toggled( aLink );
 
     aLink = LINK( this, SdStartPresentationDlg, ClickWindowPresentationHdl );
-    m_xRbtStandard->connect_clicked( aLink );
-    m_xRbtWindow->connect_clicked( aLink );
-    m_xRbtAuto->connect_clicked( aLink );
+    m_xRbtStandard->connect_toggled( aLink );
+    m_xRbtWindow->connect_toggled( aLink );
+    m_xRbtAuto->connect_toggled( aLink );
 
     m_xTmfPause->connect_value_changed( LINK( this, SdStartPresentationDlg, ChangePauseHdl ) );
 
@@ -277,7 +277,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr )
 /**
  *      Handler: Enabled/Disabled Listbox "Dias"
  */
-IMPL_LINK_NOARG(SdStartPresentationDlg, ChangeRangeHdl, weld::Button&, void)
+IMPL_LINK_NOARG(SdStartPresentationDlg, ChangeRangeHdl, weld::ToggleButton&, void)
 {
     m_xLbDias->set_sensitive( m_xRbtAtDia->get_active() );
     m_xLbCustomshow->set_sensitive( m_xRbtCustomshow->get_active() );
@@ -286,12 +286,11 @@ IMPL_LINK_NOARG(SdStartPresentationDlg, ChangeRangeHdl, weld::Button&, void)
 /**
  *      Handler: Enabled/Disabled Checkbox "AlwaysOnTop"
  */
-IMPL_LINK_NOARG(SdStartPresentationDlg, ClickWindowPresentationHdl, weld::Button&, void)
+IMPL_LINK_NOARG(SdStartPresentationDlg, ClickWindowPresentationHdl, weld::ToggleButton&, void)
 {
     const bool bAuto = m_xRbtAuto->get_active();
     const bool bWindow = m_xRbtWindow->get_active();
 
-    // m_xFtPause.set_sensitive( bAuto );
     m_xTmfPause->set_sensitive( bAuto );
     m_xCbxAutoLogo->set_sensitive( bAuto && ( m_xFormatter->GetTime().GetMSFromTime() > 0 ) );
 
diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx
index a24d91fbfeb6..99286b9cbc37 100644
--- a/sd/source/ui/inc/present.hxx
+++ b/sd/source/ui/inc/present.hxx
@@ -63,8 +63,8 @@ private:
     std::unique_ptr<weld::Label> m_xMonitorExternal;
     std::unique_ptr<weld::Label> m_xExternal;
 
-    DECL_LINK(ChangeRangeHdl, weld::Button&, void);
-    DECL_LINK(ClickWindowPresentationHdl, weld::Button&, void);
+    DECL_LINK(ChangeRangeHdl, weld::ToggleButton&, void);
+    DECL_LINK(ClickWindowPresentationHdl, weld::ToggleButton&, void);
     void ChangePause();
     DECL_LINK(ChangePauseHdl, weld::FormattedSpinButton&, void);
 
diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx
index 042d6d728c55..cfd521e4a1ca 100644
--- a/sd/source/ui/inc/pubdlg.hxx
+++ b/sd/source/ui/inc/pubdlg.hxx
@@ -183,17 +183,17 @@ private:
     DECL_LINK(NextPageHdl, weld::Button&, void);
     DECL_LINK(LastPageHdl, weld::Button&, void);
 
-    DECL_LINK(DesignHdl, weld::Button&, void);
+    DECL_LINK(DesignHdl, weld::ToggleButton&, void);
     DECL_LINK(DesignSelectHdl, weld::TreeView&, void);
     DECL_LINK(DesignDeleteHdl, weld::Button&, void);
-    DECL_LINK(BaseHdl, weld::Button&, void);
+    DECL_LINK(BaseHdl, weld::ToggleButton&, void);
     DECL_LINK(ContentHdl, weld::ToggleButton&, void);
-    DECL_LINK(GfxFormatHdl, weld::Button&, void);
-    DECL_LINK(ResolutionHdl, weld::Button&, void);
+    DECL_LINK(GfxFormatHdl, weld::ToggleButton&, void);
+    DECL_LINK(ResolutionHdl, weld::ToggleButton&, void);
     DECL_LINK(ButtonsHdl, ValueSet*, void);
     DECL_LINK(ColorHdl, weld::Button&, void);
-    DECL_LINK(WebServerHdl, weld::Button&, void);
-    DECL_LINK(SlideChgHdl, weld::Button&, void);
+    DECL_LINK(WebServerHdl, weld::ToggleButton&, void);
+    DECL_LINK(SlideChgHdl, weld::ToggleButton&, void);
 
 public:
     SdPublishingDlg(weld::Window* pWindow, DocumentType eDocType);


More information about the Libreoffice-commits mailing list