[Libreoffice-commits] core.git: sc/source sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu May 20 15:03:02 UTC 2021
sc/source/ui/dbgui/dpgroupdlg.cxx | 16 +++++++++-------
sc/source/ui/dbgui/pvfundlg.cxx | 25 +++++++++++++++----------
sc/source/ui/dbgui/scuiasciiopt.cxx | 30 +++++++++++++++++-------------
sc/source/ui/inc/dpgroupdlg.hxx | 2 +-
sc/source/ui/inc/instbdlg.hxx | 2 +-
sc/source/ui/inc/pvfundlg.hxx | 4 ++--
sc/source/ui/inc/scuiasciiopt.hxx | 3 ++-
sc/source/ui/inc/tpcalc.hxx | 2 +-
sc/source/ui/inc/tpformula.hxx | 1 +
sc/source/ui/miscdlgs/instbdlg.cxx | 9 ++++++---
sc/source/ui/optdlg/tpcalc.cxx | 16 +++++++++-------
sc/source/ui/optdlg/tpformula.cxx | 20 ++++++++++++++------
sw/source/ui/config/optpage.cxx | 13 ++++++++-----
sw/source/ui/fldui/javaedit.cxx | 21 ++++++++++++++-------
sw/source/uibase/inc/javaedit.hxx | 3 ++-
sw/source/uibase/inc/optpage.hxx | 2 +-
16 files changed, 103 insertions(+), 66 deletions(-)
New commits:
commit 253f7af7bcd2337a06c027852286616ff91d2e3f
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 20 12:56:31 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 20 17:02:12 2021 +0200
use toggle instead of click for RadioButton
Change-Id: Ia43c3ccae0dcbfb0c522a8c13db6fbfb72bfa4f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115877
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx
index f86199f1acc2..d260b4337680 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.cxx
+++ b/sc/source/ui/dbgui/dpgroupdlg.cxx
@@ -233,7 +233,7 @@ ScDPDateGroupDlg::ScDPDateGroupDlg(weld::Window* pParent,
if( rInfo.mbDateValues )
{
mxRbNumDays->set_active(true);
- ClickHdl(*mxRbNumDays );
+ ToggleHdl(*mxRbNumDays );
double fNumDays = rInfo.mfStep;
if( fNumDays < 1.0 )
@@ -245,7 +245,7 @@ ScDPDateGroupDlg::ScDPDateGroupDlg(weld::Window* pParent,
else
{
mxRbUnits->set_active(true);
- ClickHdl(*mxRbUnits);
+ ToggleHdl(*mxRbUnits);
}
/* Set the initial focus, currently it is somewhere after calling all the radio
@@ -259,8 +259,8 @@ ScDPDateGroupDlg::ScDPDateGroupDlg(weld::Window* pParent,
else if( mxLbUnits->get_sensitive() )
mxLbUnits->grab_focus();
- mxRbNumDays->connect_clicked( LINK( this, ScDPDateGroupDlg, ClickHdl ) );
- mxRbUnits->connect_clicked( LINK( this, ScDPDateGroupDlg, ClickHdl ) );
+ mxRbNumDays->connect_toggled( LINK( this, ScDPDateGroupDlg, ToggleHdl ) );
+ mxRbUnits->connect_toggled( LINK( this, ScDPDateGroupDlg, ToggleHdl ) );
mxLbUnits->connect_toggled( LINK( this, ScDPDateGroupDlg, CheckHdl ) );
}
@@ -302,9 +302,11 @@ sal_Int32 ScDPDateGroupDlg::GetDatePart() const
return nDatePart;
}
-IMPL_LINK(ScDPDateGroupDlg, ClickHdl, weld::Button&, rButton, void)
+IMPL_LINK(ScDPDateGroupDlg, ToggleHdl, weld::ToggleButton&, rButton, void)
{
- if (&rButton == mxRbNumDays.get())
+ if (!rButton.get_active())
+ return;
+ if (mxRbNumDays->get_active())
{
mxLbUnits->set_sensitive(false);
// enable and set focus to edit field on clicking "num of days" radio button
@@ -312,7 +314,7 @@ IMPL_LINK(ScDPDateGroupDlg, ClickHdl, weld::Button&, rButton, void)
mxEdNumDays->grab_focus();
mxBtnOk->set_sensitive(true);
}
- else if (&rButton == mxRbUnits.get())
+ else if (mxRbUnits->get_active())
{
mxEdNumDays->set_sensitive(false);
// enable and set focus to listbox on clicking "units" radio button
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 43f4e33274a1..6c1e006ecbc5 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -527,9 +527,9 @@ void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
mxFtName->set_label(rLabelData.getDisplayName());
// radio buttons
- mxRbNone->connect_clicked( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
- mxRbAuto->connect_clicked( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
- mxRbUser->connect_clicked( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
+ mxRbNone->connect_toggled( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
+ mxRbAuto->connect_toggled( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
+ mxRbUser->connect_toggled( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
weld::RadioButton* pRBtn = nullptr;
switch( rFuncData.mnFuncMask )
@@ -562,9 +562,11 @@ IMPL_LINK(ScDPSubtotalDlg, ButtonClicked, weld::Button&, rButton, void)
response(RET_CANCEL);
}
-IMPL_LINK(ScDPSubtotalDlg, RadioClickHdl, weld::Button&, rBtn, void)
+IMPL_LINK(ScDPSubtotalDlg, RadioClickHdl, weld::ToggleButton&, rBtn, void)
{
- mxLbFunc->set_sensitive(&rBtn == mxRbUser.get());
+ if (!rBtn.get_active())
+ return;
+ mxLbFunc->set_sensitive(mxRbUser->get_active());
}
IMPL_LINK_NOARG(ScDPSubtotalDlg, DblClickHdl, weld::TreeView&, bool)
@@ -765,9 +767,9 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou
m_xLbSortBy->set_active(nSortPos);
// sorting mode
- m_xRbSortAsc->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
- m_xRbSortDesc->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
- m_xRbSortMan->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
+ m_xRbSortAsc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
+ m_xRbSortDesc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
+ m_xRbSortMan->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
weld::RadioButton* pRBtn = nullptr;
switch( nSortMode )
@@ -874,9 +876,12 @@ IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, weld::Button&, rButton, void)
response(RET_CANCEL);
}
-IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Button&, rBtn, void)
+IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::ToggleButton&, rBtn, void)
{
- m_xLbSortBy->set_sensitive(&rBtn != m_xRbSortMan.get());
+ if (!rBtn.get_active())
+ return;
+
+ m_xLbSortBy->set_sensitive(m_xRbSortMan->get_active());
}
IMPL_LINK(ScDPSubtotalOptDlg, CheckHdl, weld::ToggleButton&, rCBox, void)
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 34cedba0824c..1347bf645112 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -493,11 +493,11 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
mxTableBox->InitTypes( *mxLbType );
mxTableBox->SetColTypeHdl( LINK( this, ScImportAsciiDlg, ColTypeHdl ) );
- mxRbSeparated->connect_clicked( LINK( this, ScImportAsciiDlg, RbSepFixHdl ) );
- mxRbFixed->connect_clicked( LINK( this, ScImportAsciiDlg, RbSepFixHdl ) );
+ mxRbSeparated->connect_toggled( LINK( this, ScImportAsciiDlg, RbSepFixHdl ) );
+ mxRbFixed->connect_toggled( LINK( this, ScImportAsciiDlg, RbSepFixHdl ) );
SetupSeparatorCtrls();
- RbSepFixHdl(*mxRbFixed);
+ RbSepFix();
UpdateVertical();
@@ -696,17 +696,21 @@ void ScImportAsciiDlg::UpdateVertical()
mpDatStream->SetStreamCharSet(meCharSet);
}
-IMPL_LINK(ScImportAsciiDlg, RbSepFixHdl, weld::Button&, rButton, void)
+void ScImportAsciiDlg::RbSepFix()
{
- if (&rButton == mxRbFixed.get() || &rButton == mxRbSeparated.get())
- {
- weld::WaitObject aWaitObj(m_xDialog.get());
- if( mxRbFixed->get_active() )
- mxTableBox->SetFixedWidthMode();
- else
- mxTableBox->SetSeparatorsMode();
- SetupSeparatorCtrls();
- }
+ weld::WaitObject aWaitObj(m_xDialog.get());
+ if( mxRbFixed->get_active() )
+ mxTableBox->SetFixedWidthMode();
+ else
+ mxTableBox->SetSeparatorsMode();
+ SetupSeparatorCtrls();
+}
+
+IMPL_LINK(ScImportAsciiDlg, RbSepFixHdl, weld::ToggleButton&, rButton, void)
+{
+ if (!rButton.get_active())
+ return;
+ RbSepFix();
}
IMPL_LINK(ScImportAsciiDlg, SeparatorClickHdl, weld::ToggleButton&, rCtrl, void)
diff --git a/sc/source/ui/inc/dpgroupdlg.hxx b/sc/source/ui/inc/dpgroupdlg.hxx
index c0c19b8a9558..0682282b1c3a 100644
--- a/sc/source/ui/inc/dpgroupdlg.hxx
+++ b/sc/source/ui/inc/dpgroupdlg.hxx
@@ -115,7 +115,7 @@ public:
sal_Int32 GetDatePart() const;
private:
- DECL_LINK(ClickHdl, weld::Button&, void);
+ DECL_LINK(ToggleHdl, weld::ToggleButton&, void);
DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
void Check();
diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index 3bc578717296..6e97085b416d 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -83,7 +83,7 @@ private:
void DoEnable_Impl();
DECL_LINK( BrowseHdl_Impl, weld::Button&, void );
- DECL_LINK( ChoiceHdl_Impl, weld::Button&, void );
+ DECL_LINK( ChoiceHdl_Impl, weld::ToggleButton&, void );
DECL_LINK( SelectHdl_Impl, weld::TreeView&, void );
DECL_LINK( CountHdl_Impl, weld::SpinButton&, void );
DECL_LINK( DoEnterHdl, weld::Button&, void );
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index 527999b609d3..e0fc34011173 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -109,7 +109,7 @@ private:
void CloseSubdialog();
DECL_LINK( DblClickHdl, weld::TreeView&, bool );
- DECL_LINK( RadioClickHdl, weld::Button&, void );
+ DECL_LINK( RadioClickHdl, weld::ToggleButton&, void );
DECL_LINK( ClickHdl, weld::Button&, void );
DECL_LINK( ButtonClicked, weld::Button&, void );
@@ -151,7 +151,7 @@ private:
/** Searches for a listbox entry, starts search at specified position. */
sal_Int32 FindListBoxEntry( const weld::ComboBox& rLBox, std::u16string_view rEntry, sal_Int32 nStartPos ) const;
- DECL_LINK( RadioClickHdl, weld::Button&, void );
+ DECL_LINK( RadioClickHdl, weld::ToggleButton&, void );
DECL_LINK( CheckHdl, weld::ToggleButton&, void );
DECL_LINK( SelectHdl, weld::ComboBox&, void );
DECL_LINK( ButtonClicked, weld::Button&, void );
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index a522a50c81b2..184e37dc9bf3 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -102,10 +102,11 @@ private:
bool GetLine( sal_uLong nLine, OUString &rText, sal_Unicode& rcDetectSep );
void UpdateVertical();
inline bool Seek( sal_uLong nPos ); // synced to and from mnStreamPos
+ void RbSepFix();
DECL_LINK( CharSetHdl, weld::ComboBox&, void );
DECL_LINK( FirstRowHdl, weld::SpinButton&, void );
- DECL_LINK( RbSepFixHdl, weld::Button&, void );
+ DECL_LINK( RbSepFixHdl, weld::ToggleButton&, void );
DECL_LINK( SeparatorEditHdl, weld::Entry&, void );
DECL_LINK( SeparatorClickHdl, weld::ToggleButton&, void );
DECL_LINK( SeparatorComboBoxHdl, weld::ComboBox&, void );
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index e413e9f71d16..4ecdec717a19 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -67,7 +67,7 @@ private:
void Init();
// Handler:
- DECL_LINK( RadioClickHdl, weld::Button&, void );
+ DECL_LINK( RadioClickHdl, weld::ToggleButton&, void );
DECL_LINK( CheckClickHdl, weld::ToggleButton&, void );
};
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 7ae53e0c354a..77d6567694c7 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -46,6 +46,7 @@ private:
bool IsValidSeparator(const OUString& rSep) const;
DECL_LINK(ButtonHdl, weld::Button&, void);
+ DECL_LINK(ToggleHdl, weld::ToggleButton&, void);
DECL_LINK(SepInsertTextHdl, OUString&, bool);
DECL_LINK(ColSepInsertTextHdl, OUString&, bool);
DECL_LINK(RowSepInsertTextHdl, OUString&, bool);
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index a2f19ab05c8b..6ccdc01991be 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -72,8 +72,8 @@ void ScInsertTableDlg::Init_Impl( bool bFromFile )
{
m_xLbTables->set_selection_mode(SelectionMode::Multiple);
m_xBtnBrowse->connect_clicked( LINK( this, ScInsertTableDlg, BrowseHdl_Impl ) );
- m_xBtnNew->connect_clicked( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
- m_xBtnFromFile->connect_clicked( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
+ m_xBtnNew->connect_toggled( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
+ m_xBtnFromFile->connect_toggled( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
m_xLbTables->connect_changed( LINK( this, ScInsertTableDlg, SelectHdl_Impl ) );
m_xNfCount->connect_value_changed( LINK( this, ScInsertTableDlg, CountHdl_Impl));
m_xBtnOk->connect_clicked( LINK( this, ScInsertTableDlg, DoEnterHdl ));
@@ -249,8 +249,11 @@ IMPL_LINK_NOARG(ScInsertTableDlg, CountHdl_Impl, weld::SpinButton&, void)
DoEnable_Impl();
}
-IMPL_LINK_NOARG(ScInsertTableDlg, ChoiceHdl_Impl, weld::Button&, void)
+IMPL_LINK(ScInsertTableDlg, ChoiceHdl_Impl, weld::ToggleButton&, rButton, void)
{
+ if (!rButton.get_active())
+ return;
+
if ( m_xBtnNew->get_active() )
SetNewTable_Impl();
else
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 54fb769a6234..57a78e15e382 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -71,9 +71,9 @@ void ScTpCalcOptions::Init()
{
m_xBtnIterate->connect_toggled( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
m_xBtnGeneralPrec->connect_toggled( LINK(this, ScTpCalcOptions, CheckClickHdl) );
- m_xBtnDateStd->connect_clicked( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
- m_xBtnDateSc10->connect_clicked( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
- m_xBtnDate1904->connect_clicked( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
+ m_xBtnDateStd->connect_toggled( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
+ m_xBtnDateSc10->connect_toggled( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
+ m_xBtnDate1904->connect_toggled( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
m_xBtnThread->connect_toggled( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
}
@@ -222,17 +222,19 @@ DeactivateRC ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
// Handler:
-IMPL_LINK( ScTpCalcOptions, RadioClickHdl, weld::Button&, rBtn, void )
+IMPL_LINK( ScTpCalcOptions, RadioClickHdl, weld::ToggleButton&, rBtn, void )
{
- if (&rBtn == m_xBtnDateStd.get())
+ if (!rBtn.get_active())
+ return;
+ if (m_xBtnDateStd->get_active())
{
pLocalOptions->SetDate( 30, 12, 1899 );
}
- else if (&rBtn == m_xBtnDateSc10.get())
+ else if (m_xBtnDateSc10->get_active())
{
pLocalOptions->SetDate( 1, 1, 1900 );
}
- else if (&rBtn == m_xBtnDate1904.get())
+ else if (m_xBtnDate1904->get_active())
{
pLocalOptions->SetDate( 1, 1, 1904 );
}
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 440a509f853d..ba3663d95b8d 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -52,10 +52,12 @@ ScTpFormulaOptions::ScTpFormulaOptions(weld::Container* pPage, weld::DialogContr
Link<weld::Button&,void> aLink2 = LINK( this, ScTpFormulaOptions, ButtonHdl );
mxBtnSepReset->connect_clicked(aLink2);
- mxBtnCustomCalcDefault->connect_clicked(aLink2);
- mxBtnCustomCalcCustom->connect_clicked(aLink2);
mxBtnCustomCalcDetails->connect_clicked(aLink2);
+ Link<weld::ToggleButton&,void> aToggleLink = LINK( this, ScTpFormulaOptions, ToggleHdl );
+ mxBtnCustomCalcDefault->connect_toggled(aToggleLink);
+ mxBtnCustomCalcCustom->connect_toggled(aToggleLink);
+
mxEdSepFuncArg->connect_insert_text(LINK( this, ScTpFormulaOptions, SepInsertTextHdl ));
mxEdSepArrayCol->connect_insert_text(LINK( this, ScTpFormulaOptions, ColSepInsertTextHdl ));
mxEdSepArrayRow->connect_insert_text(LINK( this, ScTpFormulaOptions, RowSepInsertTextHdl ));
@@ -171,14 +173,20 @@ IMPL_LINK( ScTpFormulaOptions, ButtonHdl, weld::Button&, rBtn, void )
{
if (&rBtn == mxBtnSepReset.get())
ResetSeparators();
- else if (&rBtn == mxBtnCustomCalcDefault.get())
- UpdateCustomCalcRadioButtons(true);
- else if (&rBtn == mxBtnCustomCalcCustom.get())
- UpdateCustomCalcRadioButtons(false);
else if (&rBtn == mxBtnCustomCalcDetails.get())
LaunchCustomCalcSettings();
}
+IMPL_LINK( ScTpFormulaOptions, ToggleHdl, weld::ToggleButton&, rBtn, void )
+{
+ if (!rBtn.get_active())
+ return;
+ if (mxBtnCustomCalcDefault->get_active())
+ UpdateCustomCalcRadioButtons(true);
+ else if (mxBtnCustomCalcCustom->get_active())
+ UpdateCustomCalcRadioButtons(false);
+}
+
IMPL_LINK(ScTpFormulaOptions, SepInsertTextHdl, OUString&, rTest, bool)
{
if (!IsValidSeparator(rTest) && !maOldSepValue.isEmpty())
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 8b2352350a31..cb68fc883c63 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -2017,10 +2017,10 @@ SwCompareOptionsTabPage::SwCompareOptionsTabPage(weld::Container* pPage, weld::D
, m_xLenNF(m_xBuilder->weld_spin_button("ignorelen"))
, m_xStoreRsidCB(m_xBuilder->weld_check_button("storeRSID"))
{
- Link<weld::Button&,void> aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) );
- m_xAutoRB->connect_clicked( aLnk );
- m_xWordRB->connect_clicked( aLnk );
- m_xCharRB->connect_clicked( aLnk );
+ Link<weld::ToggleButton&,void> aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) );
+ m_xAutoRB->connect_toggled( aLnk );
+ m_xWordRB->connect_toggled( aLnk );
+ m_xCharRB->connect_toggled( aLnk );
m_xIgnoreCB->connect_toggled( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) );
}
@@ -2125,8 +2125,11 @@ void SwCompareOptionsTabPage::Reset( const SfxItemSet* )
m_xStoreRsidCB->save_state();
}
-IMPL_LINK_NOARG(SwCompareOptionsTabPage, ComparisonHdl, weld::Button&, void)
+IMPL_LINK(SwCompareOptionsTabPage, ComparisonHdl, weld::ToggleButton&, rButton, void)
{
+ if (!rButton.get_active())
+ return;
+
bool bChecked = !m_xAutoRB->get_active();
m_xRsidCB->set_sensitive( bChecked );
m_xIgnoreCB->set_sensitive( bChecked );
diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx
index bfec3202309c..4cd9f3a39c85 100644
--- a/sw/source/ui/fldui/javaedit.cxx
+++ b/sw/source/ui/fldui/javaedit.cxx
@@ -53,9 +53,9 @@ SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh)
m_xNextBtn->connect_clicked( LINK( this, SwJavaEditDialog, NextHdl ) );
m_xOKBtn->connect_clicked( LINK( this, SwJavaEditDialog, OKHdl ) );
- Link<weld::Button&,void> aLk = LINK(this, SwJavaEditDialog, RadioButtonHdl);
- m_xUrlRB->connect_clicked(aLk);
- m_xEditRB->connect_clicked(aLk);
+ Link<weld::ToggleButton&,void> aLk = LINK(this, SwJavaEditDialog, RadioButtonHdl);
+ m_xUrlRB->connect_toggled(aLk);
+ m_xEditRB->connect_toggled(aLk);
m_xUrlPB->connect_clicked(LINK(this, SwJavaEditDialog, InsertFileHdl));
m_pMgr.reset(new SwFieldMgr(m_pSh));
@@ -68,7 +68,7 @@ SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh)
if (!m_bNew)
m_xDialog->set_title(SwResId(STR_JAVA_EDIT));
- RadioButtonHdl(*m_xUrlRB);
+ UpdateFromRadioButtons();
}
SwJavaEditDialog::~SwJavaEditDialog()
@@ -86,7 +86,7 @@ IMPL_LINK_NOARG(SwJavaEditDialog, PrevHdl, weld::Button&, void)
m_pMgr->GoPrev();
m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField());
CheckTravel();
- RadioButtonHdl(*m_xUrlRB);
+ UpdateFromRadioButtons();
}
IMPL_LINK_NOARG(SwJavaEditDialog, NextHdl, weld::Button&, void)
@@ -97,7 +97,7 @@ IMPL_LINK_NOARG(SwJavaEditDialog, NextHdl, weld::Button&, void)
m_pMgr->GoNext();
m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField());
CheckTravel();
- RadioButtonHdl(*m_xUrlRB);
+ UpdateFromRadioButtons();
}
IMPL_LINK_NOARG(SwJavaEditDialog, OKHdl, weld::Button&, void)
@@ -197,7 +197,14 @@ bool SwJavaEditDialog::IsUpdate() const
return m_pField && ( sal_uInt32(m_bIsUrl ? 1 : 0) != m_pField->GetFormat() || m_pField->GetPar2() != m_aType || m_pField->GetPar1() != m_aText );
}
-IMPL_LINK_NOARG(SwJavaEditDialog, RadioButtonHdl, weld::Button&, void)
+IMPL_LINK(SwJavaEditDialog, RadioButtonHdl, weld::ToggleButton&, rButton, void)
+{
+ if (!rButton.get_active())
+ return;
+ UpdateFromRadioButtons();
+}
+
+void SwJavaEditDialog::UpdateFromRadioButtons()
{
bool bEnable = m_xUrlRB->get_active();
m_xUrlPB->set_sensitive(bEnable);
diff --git a/sw/source/uibase/inc/javaedit.hxx b/sw/source/uibase/inc/javaedit.hxx
index ece6743377ac..74130d40284f 100644
--- a/sw/source/uibase/inc/javaedit.hxx
+++ b/sw/source/uibase/inc/javaedit.hxx
@@ -53,10 +53,11 @@ private:
DECL_LINK(OKHdl, weld::Button&, void);
DECL_LINK(PrevHdl, weld::Button&, void);
DECL_LINK(NextHdl, weld::Button&, void);
- DECL_LINK(RadioButtonHdl, weld::Button&, void);
+ DECL_LINK(RadioButtonHdl, weld::ToggleButton&, void);
DECL_LINK(InsertFileHdl, weld::Button&, void);
DECL_LINK(DlgClosedHdl, sfx2::FileDialogHelper *, void);
+ void UpdateFromRadioButtons();
void CheckTravel();
void SetField();
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 832fd87b0733..8ca8bf3fc55b 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -376,7 +376,7 @@ class SwCompareOptionsTabPage : public SfxTabPage
std::unique_ptr<weld::SpinButton> m_xLenNF;
std::unique_ptr<weld::CheckButton> m_xStoreRsidCB;
- DECL_LINK(ComparisonHdl, weld::Button&, void);
+ DECL_LINK(ComparisonHdl, weld::ToggleButton&, void);
DECL_LINK(IgnoreHdl, weld::ToggleButton&, void);
public:
More information about the Libreoffice-commits
mailing list