summaryrefslogtreecommitdiff
path: root/sw/source/ui/frmdlg
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-19 09:11:34 +0200
committerNoel Grandin <noel@peralex.com>2015-08-26 11:15:35 +0200
commit167bc621ef825ed5b961502fe9324a675ee34e42 (patch)
tree523838d8adc14a62f846529ee6eab3343b2fe87b /sw/source/ui/frmdlg
parent46a27805fb707544a844a961a3743b8b992282f0 (diff)
Convert vcl Button Link<> click handler to typed Link<Button*,void>
Change-Id: Ie80dfb003118d40741549c41ebcc7eda4819f05b
Diffstat (limited to 'sw/source/ui/frmdlg')
-rw-r--r--sw/source/ui/frmdlg/column.cxx13
-rw-r--r--sw/source/ui/frmdlg/cption.cxx7
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx57
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx21
4 files changed, 40 insertions, 58 deletions
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 8dadbbafcf74..afc851598507 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -293,7 +293,7 @@ IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox)
return 0;
}
-IMPL_LINK_NOARG(SwColumnDlg, OkHdl)
+IMPL_LINK_NOARG_TYPED(SwColumnDlg, OkHdl, Button*, void)
{
// evaluate current selection
SfxItemSet* pSet = 0;
@@ -371,7 +371,6 @@ IMPL_LINK_NOARG(SwColumnDlg, OkHdl)
rWrtShell.EndAction();
}
EndDialog(RET_OK);
- return 0;
}
#if OSL_DEBUG_LEVEL < 2
@@ -1076,8 +1075,9 @@ IMPL_LINK( SwColumnPage, EdModify, MetricField *, pMetricField )
// Handler behind the Checkbox for automatic width. When the box is checked
// no expicit values for the column width can be entered.
-IMPL_LINK( SwColumnPage, AutoWidthHdl, CheckBox *, pBox )
+IMPL_LINK_TYPED( SwColumnPage, AutoWidthHdl, Button*, pButton, void )
{
+ CheckBox* pBox = static_cast<CheckBox*>(pButton);
long nDist = static_cast< long >(aDistEd1.DenormalizePercent(aDistEd1.GetValue(FUNIT_TWIP)));
pColMgr->SetCount(nCols, (sal_uInt16)nDist);
for(sal_uInt16 i = 0; i < nCols; i++)
@@ -1090,11 +1090,10 @@ IMPL_LINK( SwColumnPage, AutoWidthHdl, CheckBox *, pBox )
pColMgr->SetAutoWidth(pBox->IsChecked(), sal_uInt16(nDist));
UpdateCols();
Update(NULL);
- return 0;
}
// scroll up the contents of the edits
-IMPL_LINK_NOARG(SwColumnPage, Up)
+IMPL_LINK_NOARG_TYPED(SwColumnPage, Up, Button*, void)
{
if( nFirstVis )
{
@@ -1102,11 +1101,10 @@ IMPL_LINK_NOARG(SwColumnPage, Up)
SetLabels( nFirstVis );
Update(NULL);
}
- return 0;
}
// scroll down the contents of the edits.
-IMPL_LINK_NOARG(SwColumnPage, Down)
+IMPL_LINK_NOARG_TYPED(SwColumnPage, Down, Button*, void)
{
if( nFirstVis + nVisCols < nCols )
{
@@ -1114,7 +1112,6 @@ IMPL_LINK_NOARG(SwColumnPage, Down)
SetLabels( nFirstVis );
Update(NULL);
}
- return 0;
}
// relict from ancient times - now directly without time handler; triggered by
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 76eba6969af3..d68c0b6c9d1d 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -280,7 +280,7 @@ void SwCaptionDialog::Apply()
our_aSepTextSave = m_pSepEdit->GetText();
}
-IMPL_LINK( SwCaptionDialog, OptionHdl, Button*, pButton )
+IMPL_LINK_TYPED( SwCaptionDialog, OptionHdl, Button*, pButton, void )
{
OUString sFieldTypeName = m_pCategoryBox->GetText();
if(sFieldTypeName == m_sNone)
@@ -300,7 +300,6 @@ IMPL_LINK( SwCaptionDialog, OptionHdl, Button*, pButton )
ApplyCaptionOrder();
}
DrawSample();
- return 0;
}
IMPL_LINK_NOARG(SwCaptionDialog, SelectHdl)
@@ -334,13 +333,11 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl)
return 0;
}
-IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl)
+IMPL_LINK_NOARG_TYPED(SwCaptionDialog, CaptionHdl, Button*, void)
{
SfxItemSet aSet( rView.GetDocShell()->GetDoc()->GetAttrPool() );
ScopedVclPtrInstance< SwCaptionOptDlg > aDlg( this, aSet );
aDlg->Execute();
-
- return 0;
}
void SwCaptionDialog::DrawSample()
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index a6ac4ab1aebf..582537cd6638 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -682,7 +682,7 @@ SwFrmPage::SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet)
m_aHeightED.SetLoseFocusHdl( aLk );
m_pAtHorzPosED->SetLoseFocusHdl( aLk );
m_pAtVertPosED->SetLoseFocusHdl( aLk );
- m_pFollowTextFlowCB->SetClickHdl( aLk );
+ m_pFollowTextFlowCB->SetClickHdl( LINK(this, SwFrmPage, RangeModifyClickHdl) );
aLk = LINK(this, SwFrmPage, ModifyHdl);
m_aWidthED.SetModifyHdl( aLk );
@@ -690,12 +690,12 @@ SwFrmPage::SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet)
m_pAtHorzPosED->SetModifyHdl( aLk );
m_pAtVertPosED->SetModifyHdl( aLk );
- aLk = LINK(this, SwFrmPage, AnchorTypeHdl);
- m_pAnchorAtPageRB->SetClickHdl( aLk );
- m_pAnchorAtParaRB->SetClickHdl( aLk );
- m_pAnchorAtCharRB->SetClickHdl( aLk );
- m_pAnchorAsCharRB->SetClickHdl( aLk );
- m_pAnchorAtFrameRB->SetClickHdl( aLk );
+ Link<Button*,void> aLk2 = LINK(this, SwFrmPage, AnchorTypeHdl);
+ m_pAnchorAtPageRB->SetClickHdl( aLk2 );
+ m_pAnchorAtParaRB->SetClickHdl( aLk2 );
+ m_pAnchorAtCharRB->SetClickHdl( aLk2 );
+ m_pAnchorAsCharRB->SetClickHdl( aLk2 );
+ m_pAnchorAtFrameRB->SetClickHdl( aLk2 );
m_pHorizontalDLB->SetSelectHdl(LINK(this, SwFrmPage, PosHdl));
m_pVerticalDLB-> SetSelectHdl(LINK(this, SwFrmPage, PosHdl));
@@ -705,9 +705,9 @@ SwFrmPage::SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet)
m_pMirrorPagesCB->SetClickHdl(LINK(this, SwFrmPage, MirrorHdl));
- aLk = LINK(this, SwFrmPage, RelSizeClickHdl);
- m_pRelWidthCB->SetClickHdl( aLk );
- m_pRelHeightCB->SetClickHdl( aLk );
+ aLk2 = LINK(this, SwFrmPage, RelSizeClickHdl);
+ m_pRelWidthCB->SetClickHdl( aLk2 );
+ m_pRelHeightCB->SetClickHdl( aLk2 );
m_pAutoWidthCB->SetClickHdl( LINK( this, SwFrmPage, AutoWidthClickHdl ) );
m_pAutoHeightCB->SetClickHdl( LINK( this, SwFrmPage, AutoHeightClickHdl ) );
@@ -1761,16 +1761,15 @@ SfxTabPage::sfxpg SwFrmPage::DeactivatePage(SfxItemSet * _pSet)
}
// swap left/right with inside/outside
-IMPL_LINK_NOARG(SwFrmPage, MirrorHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmPage, MirrorHdl, Button*, void)
{
RndStdIds eId = GetAnchor();
InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
-
- return 0;
}
-IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn )
+IMPL_LINK_TYPED( SwFrmPage, RelSizeClickHdl, Button *, p, void )
{
+ CheckBox* pBtn = static_cast<CheckBox*>(p);
if (pBtn == m_pRelWidthCB)
{
m_aWidthED.ShowPercent(pBtn->IsChecked());
@@ -1792,11 +1791,13 @@ IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn )
ModifyHdl(m_aWidthED.get());
else // pBtn == m_pRelHeightCB
ModifyHdl(m_aHeightED.get());
-
- return 0;
}
// range check
+IMPL_LINK_NOARG_TYPED(SwFrmPage, RangeModifyClickHdl, Button*, void)
+{
+ RangeModifyHdl(NULL);
+}
IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl)
{
if (bNoModifyHdl)
@@ -1918,7 +1919,7 @@ IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl)
return 0;
}
-IMPL_LINK_NOARG(SwFrmPage, AnchorTypeHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmPage, AnchorTypeHdl, Button*, void)
{
m_pMirrorPagesCB->Enable(!m_pAnchorAsCharRB->IsChecked());
@@ -1943,8 +1944,6 @@ IMPL_LINK_NOARG(SwFrmPage, AnchorTypeHdl)
EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
&& FLY_AS_CHAR == eId) );
-
- return 0;
}
IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
@@ -2082,27 +2081,24 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB )
return 0;
}
-IMPL_LINK_NOARG(SwFrmPage, RealSizeHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmPage, RealSizeHdl, Button*, void)
{
m_aWidthED.SetUserValue( m_aWidthED. NormalizePercent(aGrfSize.Width() ), FUNIT_TWIP);
m_aHeightED.SetUserValue(m_aHeightED.NormalizePercent(aGrfSize.Height()), FUNIT_TWIP);
fWidthHeightRatio = aGrfSize.Height() ? double(aGrfSize.Width()) / double(aGrfSize.Height()) : 1.0;
UpdateExample();
- return 0;
}
-IMPL_LINK_NOARG(SwFrmPage, AutoWidthClickHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmPage, AutoWidthClickHdl, Button*, void)
{
if( !IsInGraficMode() )
HandleAutoCB( m_pAutoWidthCB->IsChecked(), *m_pWidthFT, *m_pWidthAutoFT, *m_aWidthED.get() );
- return 0;
}
-IMPL_LINK_NOARG(SwFrmPage, AutoHeightClickHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmPage, AutoHeightClickHdl, Button*, void)
{
if( !IsInGraficMode() )
HandleAutoCB( m_pAutoHeightCB->IsChecked(), *m_pHeightFT, *m_pHeightAutoFT, *m_aWidthED.get() );
- return 0;
}
IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit )
@@ -2576,7 +2572,7 @@ SfxTabPage::sfxpg SwGrfExtPage::DeactivatePage(SfxItemSet *_pSet)
return LEAVE_PAGE;
}
-IMPL_LINK_NOARG(SwGrfExtPage, BrowseHdl)
+IMPL_LINK_NOARG_TYPED(SwGrfExtPage, BrowseHdl, Button*, void)
{
if(!pGrfDlg)
{
@@ -2619,10 +2615,9 @@ IMPL_LINK_NOARG(SwGrfExtPage, BrowseHdl)
m_pLeftPagesRB->Enable(bEnable);
m_pRightPagesRB->Enable(bEnable);
}
- return 0;
}
-IMPL_LINK_NOARG(SwGrfExtPage, MirrorHdl)
+IMPL_LINK_NOARG_TYPED(SwGrfExtPage, MirrorHdl, Button*, void)
{
bool bEnable = m_pMirrorHorzBox->IsChecked();
@@ -2635,8 +2630,6 @@ IMPL_LINK_NOARG(SwGrfExtPage, MirrorHdl)
if (!m_pAllPagesRB->IsChecked() && !m_pLeftPagesRB->IsChecked() && !m_pRightPagesRB->IsChecked())
m_pAllPagesRB->Check();
-
- return 0;
}
// example window
@@ -2851,7 +2844,7 @@ VclPtr<SfxTabPage> SwFrmURLPage::Create(vcl::Window *pParent, const SfxItemSet *
return VclPtr<SwFrmURLPage>::Create( pParent, *rSet );
}
-IMPL_LINK_NOARG(SwFrmURLPage, InsertFileHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmURLPage, InsertFileHdl, Button*, void)
{
FileDialogHelper aDlgHelper( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
uno::Reference < ui::dialogs::XFilePicker > xFP = aDlgHelper.GetFilePicker();
@@ -2870,8 +2863,6 @@ IMPL_LINK_NOARG(SwFrmURLPage, InsertFileHdl)
{
pURLED->SetText( xFP->getFiles().getConstArray()[0] );
}
-
- return 0;
}
SwFrmAddPage::SwFrmAddPage(vcl::Window *pParent, const SfxItemSet &rSet)
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index c7574f6cef03..d5f83eecfa9a 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -120,13 +120,13 @@ SwWrapTabPage::SwWrapTabPage(vcl::Window *pParent, const SfxItemSet &rSet)
m_pBottomMarginED->SetLastHdl(aLk);
m_pBottomMarginED->SetLoseFocusHdl(aLk);
- aLk = LINK(this, SwWrapTabPage, WrapTypeHdl);
- m_pNoWrapRB->SetClickHdl(aLk);
- m_pWrapLeftRB->SetClickHdl(aLk);
- m_pWrapRightRB->SetClickHdl(aLk);
- m_pWrapParallelRB->SetClickHdl(aLk);
- m_pWrapThroughRB->SetClickHdl(aLk);
- m_pIdealWrapRB->SetClickHdl(aLk);
+ Link<Button*,void> aLk2 = LINK(this, SwWrapTabPage, WrapTypeHdl);
+ m_pNoWrapRB->SetClickHdl(aLk2);
+ m_pWrapLeftRB->SetClickHdl(aLk2);
+ m_pWrapRightRB->SetClickHdl(aLk2);
+ m_pWrapParallelRB->SetClickHdl(aLk2);
+ m_pWrapThroughRB->SetClickHdl(aLk2);
+ m_pIdealWrapRB->SetClickHdl(aLk2);
ApplyImageList();
m_pWrapOutlineCB->SetClickHdl(LINK(this, SwWrapTabPage, ContourHdl));
}
@@ -612,7 +612,7 @@ IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit )
return 0;
}
-IMPL_LINK( SwWrapTabPage, WrapTypeHdl, RadioButton *, pBtn )
+IMPL_LINK_TYPED( SwWrapTabPage, WrapTypeHdl, Button *, pBtn, void )
{
bool bWrapThrough = (pBtn == m_pWrapThroughRB);
m_pWrapTransparentCB->Enable( bWrapThrough && !m_bHtmlMode );
@@ -624,10 +624,9 @@ IMPL_LINK( SwWrapTabPage, WrapTypeHdl, RadioButton *, pBtn )
(pBtn != m_pNoWrapRB) );
ContourHdl(0);
- return 0;
}
-IMPL_LINK_NOARG(SwWrapTabPage, ContourHdl)
+IMPL_LINK_NOARG_TYPED(SwWrapTabPage, ContourHdl, Button*, void)
{
bool bEnable = !(m_pWrapOutlineCB->IsChecked() && m_pWrapOutlineCB->IsEnabled());
@@ -639,8 +638,6 @@ IMPL_LINK_NOARG(SwWrapTabPage, ContourHdl)
m_bContourImage = !bEnable;
ApplyImageList();
}
-
- return 0;
}
void SwWrapTabPage::DataChanged( const DataChangedEvent& rDCEvt )