include/sfx2/printopt.hxx       |    6 +++---
 include/sfx2/templatedlg.hxx    |    4 ++--
 sfx2/source/dialog/printopt.cxx |   12 ++++++------
 sfx2/source/dialog/templdlg.cxx |    4 ++--
 sfx2/source/dialog/versdlg.cxx  |   16 ++++++++++------
 sfx2/source/doc/templatedlg.cxx |    8 ++++----
 sfx2/source/inc/templdgi.hxx    |    2 +-
 sfx2/source/inc/versdlg.hxx     |    1 +
 8 files changed, 29 insertions(+), 24 deletions(-)

New commits:
commit 747394659c5f0aa71053d84fc9fc4bee75fc34ef
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed May 19 14:16:46 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed May 19 17:07:09 2021 +0200

    use toggle instead of click for ToggleButton
    
    Change-Id: I8a1c6620cf009807cc43766b0cc972523e87e9c6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115811
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index d93284f345a5..2a9992d26daf 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -60,9 +60,9 @@ private:
                         DECL_DLLPRIVATE_LINK( ToggleOutputPrinterRBHdl, 
weld::ToggleButton&, void );
                         DECL_DLLPRIVATE_LINK( ToggleOutputPrintFileRBHdl, 
weld::ToggleButton&, void);
 
-                        DECL_DLLPRIVATE_LINK( ClickReduceTransparencyCBHdl, 
weld::Button&, void );
-                        DECL_DLLPRIVATE_LINK( ClickReduceGradientsCBHdl, 
weld::Button&, void );
-                        DECL_DLLPRIVATE_LINK( ClickReduceBitmapsCBHdl, 
weld::Button&, void );
+                        DECL_DLLPRIVATE_LINK( ClickReduceTransparencyCBHdl, 
weld::ToggleButton&, void );
+                        DECL_DLLPRIVATE_LINK( ClickReduceGradientsCBHdl, 
weld::ToggleButton&, void );
+                        DECL_DLLPRIVATE_LINK( ClickReduceBitmapsCBHdl, 
weld::ToggleButton&, void );
 
                         DECL_DLLPRIVATE_LINK( 
ToggleReduceGradientsStripesRBHdl, weld::ToggleButton&, void );
                         DECL_DLLPRIVATE_LINK( 
ToggleReduceBitmapsResolutionRBHdl, weld::ToggleButton&, void );
diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index 05a693611603..c83b2ab05880 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -86,8 +86,8 @@ protected:
     DECL_LINK(ImplUpdateDataHdl, Timer*, void);
     DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
 
-    DECL_LINK(ListViewHdl, weld::Button&, void);
-    DECL_LINK(ThumbnailViewHdl, weld::Button&, void);
+    DECL_LINK(ListViewHdl, weld::ToggleButton&, void);
+    DECL_LINK(ThumbnailViewHdl, weld::ToggleButton&, void);
     DECL_LINK(FocusRectLocalHdl, weld::Widget&, tools::Rectangle);
     DECL_LINK(FocusRectSearchHdl, weld::Widget&, tools::Rectangle);
 
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 5f4025fb57c0..2b106f9c5081 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -72,9 +72,9 @@ 
SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage(weld::Container* pPag
     m_xPrinterOutputRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
     m_xPrintFileOutputRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
 
-    m_xReduceTransparencyCB->connect_clicked( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
-    m_xReduceGradientsCB->connect_clicked( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
-    m_xReduceBitmapsCB->connect_clicked( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
+    m_xReduceTransparencyCB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
+    m_xReduceGradientsCB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
+    m_xReduceBitmapsCB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
 
     m_xReduceGradientsStripesRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl ) );
     m_xReduceBitmapsResolutionRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl ) );
@@ -216,7 +216,7 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( 
PrinterOptions* pCurrentOpt
     }
 }
 
-IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, 
weld::Button&, void )
+IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, 
weld::ToggleButton&, void )
 {
     const bool bReduceTransparency = m_xReduceTransparencyCB->get_active();
 
@@ -226,7 +226,7 @@ IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, 
ClickReduceTransparencyCBHdl, wel
     m_xTransparencyCB->set_sensitive( !bReduceTransparency );
 }
 
-IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, 
weld::Button&, void )
+IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, 
weld::ToggleButton&, void )
 {
     const bool bEnable = m_xReduceGradientsCB->get_active();
 
@@ -237,7 +237,7 @@ IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, 
ClickReduceGradientsCBHdl, weld::
     ToggleReduceGradientsStripesRBHdl(*m_xReduceGradientsStripesRB);
 }
 
-IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, 
weld::Button&, void )
+IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, 
weld::ToggleButton&, void )
 {
     const bool bEnable = m_xReduceBitmapsCB->get_active();
 
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 54ae8fc0e2db..ed55c859fb2e 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -745,7 +745,7 @@ void SfxCommonTemplateDialog_Impl::Initialize()
     mxTreeBox->connect_popup_menu(LINK(this, SfxCommonTemplateDialog_Impl, 
PopupTreeMenuHdl));
     mxTreeBox->connect_key_press(LINK(this, SfxCommonTemplateDialog_Impl, 
KeyInputHdl));
     mxTreeBox->connect_drag_begin(LINK(this, SfxCommonTemplateDialog_Impl, 
DragBeginHdl));
-    mxPreviewCheckbox->connect_clicked(LINK(this, 
SfxCommonTemplateDialog_Impl, PreviewHdl));
+    mxPreviewCheckbox->connect_toggled(LINK(this, 
SfxCommonTemplateDialog_Impl, PreviewHdl));
     m_xTreeView1DropTargetHelper.reset(new TreeViewDropTarget(*this, 
*mxFmtLb));
     m_xTreeView2DropTargetHelper.reset(new TreeViewDropTarget(*this, 
*mxTreeBox));
 
@@ -1935,7 +1935,7 @@ IMPL_LINK_NOARG(SfxCommonTemplateDialog_Impl, 
TreeListApplyHdl, weld::TreeView&,
     return true;
 }
 
-IMPL_LINK_NOARG(SfxCommonTemplateDialog_Impl, PreviewHdl, weld::Button&, void)
+IMPL_LINK_NOARG(SfxCommonTemplateDialog_Impl, PreviewHdl, weld::ToggleButton&, 
void)
 {
     std::shared_ptr<comphelper::ConfigurationChanges> batch( 
comphelper::ConfigurationChanges::create() );
     bool bCustomPreview = mxPreviewCheckbox->get_active();
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index a59040ee9a8d..2501df8ed480 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -170,7 +170,7 @@ SfxVersionDialog::SfxVersionDialog(weld::Window* pParent, 
SfxViewFrame* pVwFrame
     m_xDeleteButton->connect_clicked( aClickLink );
     m_xCompareButton->connect_clicked( aClickLink );
     m_xOpenButton->connect_clicked( aClickLink );
-    m_xSaveCheckBox->connect_clicked( aClickLink );
+    m_xSaveCheckBox->connect_toggled(LINK(this, SfxVersionDialog, 
ToggleHdl_Impl));
     m_xCmisButton->connect_clicked( aClickLink );
 
     m_xVersionBox->connect_changed( LINK( this, SfxVersionDialog, 
SelectHdl_Impl ) );
@@ -312,11 +312,7 @@ IMPL_LINK(SfxVersionDialog, ButtonHdl_Impl, weld::Button&, 
rButton, void)
 
     int nEntry = m_xVersionBox->get_selected_index();
 
-    if (&rButton == m_xSaveCheckBox.get())
-    {
-        m_bIsSaveVersionOnClose = m_xSaveCheckBox->get_active();
-    }
-    else if (&rButton == m_xSaveButton.get())
+    if (&rButton == m_xSaveButton.get())
     {
         SfxVersionInfo aInfo;
         aInfo.aAuthor = SvtUserOptions().GetFullName();
@@ -380,6 +376,14 @@ IMPL_LINK(SfxVersionDialog, ButtonHdl_Impl, weld::Button&, 
rButton, void)
     }
 }
 
+IMPL_LINK(SfxVersionDialog, ToggleHdl_Impl, weld::ToggleButton&, rButton, void)
+{
+    if (&rButton == m_xSaveCheckBox.get())
+    {
+        m_bIsSaveVersionOnClose = m_xSaveCheckBox->get_active();
+    }
+}
+
 SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl(weld::Window *pParent, 
SfxVersionInfo& rInfo, bool bEdit)
     : SfxDialogController(pParent, "sfx/ui/versioncommentdialog.ui", 
"VersionCommentDialog")
     , m_rInfo(rInfo)
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 413ba517004c..47348dfe15f1 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -221,8 +221,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
         mxMoreTemplatesButton->set_sensitive(false);
     else
         mxMoreTemplatesButton->connect_clicked(LINK(this, 
SfxTemplateManagerDlg, LinkClickHdl));
-    mxListViewButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, 
ListViewHdl));
-    mxThumbnailViewButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, 
ThumbnailViewHdl));
+    mxListViewButton->connect_toggled(LINK(this, SfxTemplateManagerDlg, 
ListViewHdl));
+    mxThumbnailViewButton->connect_toggled(LINK(this, SfxTemplateManagerDlg, 
ThumbnailViewHdl));
 
     mxSearchFilter->connect_changed(LINK(this, SfxTemplateManagerDlg, 
SearchUpdateHdl));
     mxSearchFilter->connect_focus_in(LINK( this, SfxTemplateManagerDlg, 
GetFocusHdl ));
@@ -819,7 +819,7 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, LoseFocusHdl, 
weld::Widget&, void)
     }
 }
 
-IMPL_LINK_NOARG ( SfxTemplateManagerDlg, ListViewHdl, weld::Button&, void )
+IMPL_LINK_NOARG ( SfxTemplateManagerDlg, ListViewHdl, weld::ToggleButton&, 
void )
 {
     setTemplateViewMode(TemplateViewMode::eListView);
 
@@ -829,7 +829,7 @@ IMPL_LINK_NOARG ( SfxTemplateManagerDlg, ListViewHdl, 
weld::Button&, void )
         mxSearchView->ListView::grab_focus();
 }
 
-IMPL_LINK_NOARG ( SfxTemplateManagerDlg, ThumbnailViewHdl, weld::Button&, void 
)
+IMPL_LINK_NOARG ( SfxTemplateManagerDlg, ThumbnailViewHdl, 
weld::ToggleButton&, void )
 {
     setTemplateViewMode(TemplateViewMode::eThumbnailView);
     bMakeSelItemVisible = true;
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 39b9b33eabb9..909425a5539e 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -132,7 +132,7 @@ protected:
     DECL_LINK(TreeListApplyHdl, weld::TreeView&, bool);
     DECL_LINK(MousePressHdl, const MouseEvent&, bool);
     DECL_LINK(TimeOut, Timer*, void );
-    DECL_LINK(PreviewHdl, weld::Button&, void);
+    DECL_LINK(PreviewHdl, weld::ToggleButton&, void);
     DECL_LINK(PopupFlatMenuHdl, const CommandEvent&, bool);
     DECL_LINK(PopupTreeMenuHdl, const CommandEvent&, bool);
     DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
diff --git a/sfx2/source/inc/versdlg.hxx b/sfx2/source/inc/versdlg.hxx
index 1e173467d7a8..c94da8af0405 100644
--- a/sfx2/source/inc/versdlg.hxx
+++ b/sfx2/source/inc/versdlg.hxx
@@ -44,6 +44,7 @@ class SfxVersionDialog : public SfxDialogController
     DECL_LINK(DClickHdl_Impl, weld::TreeView&, bool);
     DECL_LINK(SelectHdl_Impl, weld::TreeView&, void);
     DECL_LINK(ButtonHdl_Impl, weld::Button&, void);
+    DECL_LINK(ToggleHdl_Impl, weld::ToggleButton&, void);
     void Init_Impl();
     void Open_Impl();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to