summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-13 15:51:37 +0200
committerNoel Grandin <noel@peralex.com>2015-10-15 10:32:29 +0200
commit74dbe58f1e5b6f4f281e13f348c8952b1086877a (patch)
treefda8bd8374592491d3e64b02e4f3ca13879cf2d4 /cui
parentfa21f301ddef575baad9a3aa8564199285e6d90b (diff)
convert Link<> to typed
Change-Id: I2ef1e5fe5c6dc65c254b3a16b0b12fca5caba16e
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/grfpage.hxx2
-rw-r--r--cui/source/inc/numpages.hxx8
-rw-r--r--cui/source/options/optgdlg.cxx13
-rw-r--r--cui/source/options/optgdlg.hxx2
-rw-r--r--cui/source/tabpages/grfpage.cxx31
-rw-r--r--cui/source/tabpages/numpages.cxx70
6 files changed, 58 insertions, 68 deletions
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index 89f13f053264..49ad01f2a9fd 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -97,7 +97,7 @@ class SvxGrfCropPage : public SfxTabPage
DECL_LINK( ZoomHdl, MetricField * );
DECL_LINK( SizeHdl, MetricField * );
- DECL_LINK( CropHdl, const MetricField * );
+ DECL_LINK_TYPED( CropHdl, SpinField&, void );
DECL_LINK_TYPED( CropLoseFocusHdl, Control&, void );
DECL_LINK( CropModifyHdl, MetricField * );
DECL_LINK_TYPED(OrigSizeHdl, Button*, void);
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index d4199a3cf2a4..8ffba711cc7c 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -429,7 +429,7 @@ class SvxNumPositionTabPage : public SfxTabPage
DECL_LINK_TYPED( LevelHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( EditModifyHdl_Impl, ListBox&, void);
- DECL_LINK( DistanceHdl_Impl, MetricField * );
+ DECL_LINK_TYPED( DistanceHdl_Impl, SpinField&, void );
DECL_LINK_TYPED( DistanceFocusHdl_Impl, Control&, void );
DECL_LINK_TYPED( RelativeHdl_Impl, Button*, void );
DECL_LINK_TYPED( StandardHdl_Impl, Button*, void);
@@ -438,9 +438,9 @@ class SvxNumPositionTabPage : public SfxTabPage
void ShowControlsDependingOnPosAndSpaceMode();
DECL_LINK_TYPED(LabelFollowedByHdl_Impl, ListBox&, void);
- DECL_LINK( ListtabPosHdl_Impl, MetricField* );
- DECL_LINK( AlignAtHdl_Impl, MetricField* );
- DECL_LINK( IndentAtHdl_Impl, MetricField* );
+ DECL_LINK_TYPED( ListtabPosHdl_Impl, SpinField&, void );
+ DECL_LINK_TYPED( AlignAtHdl_Impl, SpinField&, void );
+ DECL_LINK_TYPED( IndentAtHdl_Impl, SpinField&, void );
public:
SvxNumPositionTabPage(vcl::Window* pParent,
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 0764524c0b6d..4c216c9a52c2 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -287,12 +287,12 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_aStrDateInfo = m_pToYearFT->GetText();
m_pYearValueField->SetModifyHdl( LINK( this, OfaMiscTabPage, TwoFigureHdl ) );
- Link<> aLink = LINK( this, OfaMiscTabPage, TwoFigureConfigHdl );
+ Link<SpinField&,void> aLink = LINK( this, OfaMiscTabPage, TwoFigureConfigHdl );
m_pYearValueField->SetDownHdl( aLink );
m_pYearValueField->SetUpHdl( aLink );
m_pYearValueField->SetLoseFocusHdl( LINK( this, OfaMiscTabPage, TwoFigureConfigFocusHdl ) );
m_pYearValueField->SetFirstHdl( aLink );
- TwoFigureConfigHdl(m_pYearValueField);
+ TwoFigureConfigHdl(*m_pYearValueField);
SetExchangeSupport();
}
@@ -400,7 +400,7 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
if ( SfxItemState::SET == rSet->GetItemState( SID_ATTR_YEAR2000, false, &pItem ) )
{
m_pYearValueField->SetValue( static_cast<const SfxUInt16Item*>(pItem)->GetValue() );
- TwoFigureConfigHdl(m_pYearValueField);
+ TwoFigureConfigHdl(*m_pYearValueField);
}
else
{
@@ -435,16 +435,15 @@ IMPL_LINK( OfaMiscTabPage, TwoFigureHdl, NumericField*, pEd )
IMPL_LINK_TYPED( OfaMiscTabPage, TwoFigureConfigFocusHdl, Control&, rControl, void )
{
- TwoFigureConfigHdl(static_cast<NumericField*>(&rControl));
+ TwoFigureConfigHdl(static_cast<SpinField&>(rControl));
}
-IMPL_LINK( OfaMiscTabPage, TwoFigureConfigHdl, NumericField*, pEd )
+IMPL_LINK_TYPED( OfaMiscTabPage, TwoFigureConfigHdl, SpinField&, rEd, void )
{
sal_Int64 nNum = m_pYearValueField->GetValue();
OUString aOutput(OUString::number(nNum));
m_pYearValueField->SetText(aOutput);
m_pYearValueField->SetSelection( Selection( 0, aOutput.getLength() ) );
- TwoFigureHdl( pEd );
- return 0;
+ TwoFigureHdl( static_cast<NumericField*>(&rEd) );
}
class CanvasSettings
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 5efcbc243cd0..4d803ba3c8dd 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -59,7 +59,7 @@ private:
VclPtr<CheckBox> m_pCollectUsageInfo;
DECL_LINK( TwoFigureHdl, NumericField* );
- DECL_LINK( TwoFigureConfigHdl, NumericField* );
+ DECL_LINK_TYPED( TwoFigureConfigHdl, SpinField&, void );
DECL_LINK_TYPED( TwoFigureConfigFocusHdl, Control&, void );
#ifdef WNT
DECL_LINK( OnFileDlgToggled, void* );
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index d085a99e0896..be6df3cd25a0 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -95,15 +95,15 @@ SvxGrfCropPage::SvxGrfCropPage ( vcl::Window *pParent, const SfxItemSet &rSet )
m_pWidthZoomMF->SetModifyHdl( aLk );
m_pHeightZoomMF->SetModifyHdl( aLk );
- aLk = LINK(this, SvxGrfCropPage, CropHdl);
- m_pLeftMF->SetDownHdl( aLk );
- m_pRightMF->SetDownHdl( aLk );
- m_pTopMF->SetDownHdl( aLk );
- m_pBottomMF->SetDownHdl( aLk );
- m_pLeftMF->SetUpHdl( aLk );
- m_pRightMF->SetUpHdl( aLk );
- m_pTopMF->SetUpHdl( aLk );
- m_pBottomMF->SetUpHdl( aLk );
+ Link<SpinField&,void> aLk3 = LINK(this, SvxGrfCropPage, CropHdl);
+ m_pLeftMF->SetDownHdl( aLk3 );
+ m_pRightMF->SetDownHdl( aLk3 );
+ m_pTopMF->SetDownHdl( aLk3 );
+ m_pBottomMF->SetDownHdl( aLk3 );
+ m_pLeftMF->SetUpHdl( aLk3 );
+ m_pRightMF->SetUpHdl( aLk3 );
+ m_pTopMF->SetUpHdl( aLk3 );
+ m_pBottomMF->SetUpHdl( aLk3 );
aLk = LINK(this, SvxGrfCropPage, CropModifyHdl);
m_pLeftMF->SetModifyHdl( aLk );
@@ -483,7 +483,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField )
description: evaluate border
--------------------------------------------------------------------*/
-IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField )
+IMPL_LINK_TYPED( SvxGrfCropPage, CropHdl, SpinField&, rField, void )
{
SfxItemPool* pPool = GetItemSet().GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
@@ -491,7 +491,7 @@ IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField )
SID_ATTR_GRAF_CROP ) ) );
bool bZoom = m_pZoomConstRB->IsChecked();
- if( pField == m_pLeftMF || pField == m_pRightMF )
+ if( &rField == m_pLeftMF || &rField == m_pRightMF )
{
long nLeft = lcl_GetValue( *m_pLeftMF, eUnit );
long nRight = lcl_GetValue( *m_pRightMF, eUnit );
@@ -499,7 +499,7 @@ IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField )
if(bZoom && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom )
/ 100 >= aPageSize.Width() ) )
{
- if(pField == m_pLeftMF)
+ if(&rField == m_pLeftMF)
{
nLeft = aOrigSize.Width() -
( aPageSize.Width() * 100 / nWidthZoom + nRight );
@@ -536,7 +536,7 @@ IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField )
if(bZoom && ( ( ( aOrigSize.Height() - (nTop + nBottom )) * nHeightZoom)
/ 100 >= aPageSize.Height()))
{
- if(pField == m_pTopMF)
+ if(&rField == m_pTopMF)
{
nTop = aOrigSize.Height() -
( aPageSize.Height() * 100 / nHeightZoom + nBottom);
@@ -562,7 +562,6 @@ IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField )
if(!bZoom)
CalcZoom();
CalcMinMaxBorder();
- return 0;
}
/*--------------------------------------------------------------------
description: set original size
@@ -734,7 +733,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
IMPL_LINK_NOARG_TYPED(SvxGrfCropPage, Timeout, Timer *, void)
{
DBG_ASSERT(pLastCropField,"Timeout ohne Feld?");
- CropHdl(pLastCropField);
+ CropHdl(*pLastCropField);
pLastCropField = 0;
}
@@ -743,7 +742,7 @@ IMPL_LINK_TYPED( SvxGrfCropPage, CropLoseFocusHdl, Control&, rControl, void )
{
MetricField* pField = static_cast<MetricField*>(&rControl);
aTimer.Stop();
- CropHdl(pField);
+ CropHdl(*pField);
pLastCropField = 0;
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index fe69953ca189..36e3f71135cc 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2785,37 +2785,37 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(vcl::Window* pParent,
}
m_pAlign2LB->SetDropDownLineCount( m_pAlign2LB->GetEntryCount() );
- Link<> aLk = LINK(this, SvxNumPositionTabPage, DistanceHdl_Impl);
+ Link<SpinField&,void> aLk3 = LINK(this, SvxNumPositionTabPage, DistanceHdl_Impl);
Link<Control&,void> aLk2 = LINK(this, SvxNumPositionTabPage, DistanceFocusHdl_Impl);
- m_pDistBorderMF->SetUpHdl(aLk);
- m_pDistBorderMF->SetDownHdl(aLk);
+ m_pDistBorderMF->SetUpHdl(aLk3);
+ m_pDistBorderMF->SetDownHdl(aLk3);
m_pDistBorderMF->SetLoseFocusHdl(aLk2);
- m_pDistNumMF->SetUpHdl(aLk);
- m_pDistNumMF->SetDownHdl(aLk);
+ m_pDistNumMF->SetUpHdl(aLk3);
+ m_pDistNumMF->SetDownHdl(aLk3);
m_pDistNumMF->SetLoseFocusHdl(aLk2);
- m_pIndentMF->SetUpHdl(aLk);
- m_pIndentMF->SetDownHdl(aLk);
+ m_pIndentMF->SetUpHdl(aLk3);
+ m_pIndentMF->SetDownHdl(aLk3);
m_pIndentMF->SetLoseFocusHdl(aLk2);
m_pLabelFollowedByLB->SetDropDownLineCount( m_pLabelFollowedByLB->GetEntryCount() );
m_pLabelFollowedByLB->SetSelectHdl( LINK(this, SvxNumPositionTabPage, LabelFollowedByHdl_Impl) );
- aLk = LINK(this, SvxNumPositionTabPage, ListtabPosHdl_Impl);
- m_pListtabMF->SetUpHdl(aLk);
- m_pListtabMF->SetDownHdl(aLk);
+ aLk3 = LINK(this, SvxNumPositionTabPage, ListtabPosHdl_Impl);
+ m_pListtabMF->SetUpHdl(aLk3);
+ m_pListtabMF->SetDownHdl(aLk3);
m_pListtabMF->SetLoseFocusHdl(aLk2);
- aLk = LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl);
- m_pAlignedAtMF->SetUpHdl(aLk);
- m_pAlignedAtMF->SetDownHdl(aLk);
+ aLk3 = LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl);
+ m_pAlignedAtMF->SetUpHdl(aLk3);
+ m_pAlignedAtMF->SetDownHdl(aLk3);
m_pAlignedAtMF->SetLoseFocusHdl(aLk2);
- aLk = LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl);
- m_pIndentAtMF->SetUpHdl(aLk);
- m_pIndentAtMF->SetDownHdl(aLk);
+ aLk3 = LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl);
+ m_pIndentAtMF->SetUpHdl(aLk3);
+ m_pIndentAtMF->SetDownHdl(aLk3);
m_pIndentAtMF->SetLoseFocusHdl(aLk2);
m_pLevelLB->EnableMultiSelection(true);
@@ -3137,8 +3137,8 @@ SfxTabPage::sfxpg SvxNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet)
if(_pSet)
{
if(m_pDistBorderMF->IsEnabled())
- DistanceHdl_Impl(m_pDistBorderMF);
- DistanceHdl_Impl(m_pIndentMF);
+ DistanceHdl_Impl(*m_pDistBorderMF);
+ DistanceHdl_Impl(*m_pIndentMF);
FillItemSet(_pSet);
}
return LEAVE_PAGE;
@@ -3383,20 +3383,20 @@ IMPL_LINK_TYPED( SvxNumPositionTabPage, LevelHdl_Impl, ListBox&, rBox, void )
IMPL_LINK_TYPED( SvxNumPositionTabPage, DistanceFocusHdl_Impl, Control&, rControl, void )
{
- DistanceHdl_Impl(static_cast<MetricField*>(&rControl));
+ DistanceHdl_Impl(static_cast<SpinField&>(rControl));
}
-IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, MetricField *, pFld )
+IMPL_LINK_TYPED( SvxNumPositionTabPage, DistanceHdl_Impl, SpinField&, rFld, void )
{
if(bInInintControl)
- return 0;
- long nValue = GetCoreValue(*pFld, eCoreUnit);
+ return;
+ long nValue = GetCoreValue(static_cast<MetricField&>(rFld), eCoreUnit);
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
if(nActNumLvl & nMask)
{
SvxNumberFormat aNumFmt( pActNum->GetLevel( i ) );
- if (pFld == m_pDistBorderMF)
+ if (&rFld == m_pDistBorderMF)
{
if(m_pRelativeCB->IsChecked())
@@ -3420,11 +3420,11 @@ IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, MetricField *, pFld )
aNumFmt.SetAbsLSpace( (short)nValue - aNumFmt.GetFirstLineOffset());
}
}
- else if (pFld == m_pDistNumMF)
+ else if (&rFld == m_pDistNumMF)
{
aNumFmt.SetCharTextDistance( (short)nValue );
}
- else if (pFld == m_pIndentMF)
+ else if (&rFld == m_pIndentMF)
{
// together with the FirstLineOffset the AbsLSpace must be changed, too
long nDiff = nValue + aNumFmt.GetFirstLineOffset();
@@ -3443,8 +3443,6 @@ IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, MetricField *, pFld )
{
m_pDistBorderMF->SetText("");
}
-
- return 0;
}
IMPL_LINK_TYPED( SvxNumPositionTabPage, RelativeHdl_Impl, Button*, pBox, void )
@@ -3545,10 +3543,10 @@ IMPL_LINK_NOARG_TYPED(SvxNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox&,
SetModified();
}
-IMPL_LINK( SvxNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld )
+IMPL_LINK_TYPED( SvxNumPositionTabPage, ListtabPosHdl_Impl, SpinField&, rFld, void )
{
// determine value to be set at the chosen list levels
- const long nValue = GetCoreValue( *pFld, eCoreUnit );
+ const long nValue = GetCoreValue( static_cast<MetricField&>(rFld), eCoreUnit );
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -3564,14 +3562,12 @@ IMPL_LINK( SvxNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld )
}
SetModified();
-
- return 0;
}
-IMPL_LINK( SvxNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld )
+IMPL_LINK_TYPED( SvxNumPositionTabPage, AlignAtHdl_Impl, SpinField&, rFld, void )
{
// determine value to be set at the chosen list levels
- const long nValue = GetCoreValue( *pFld, eCoreUnit );
+ const long nValue = GetCoreValue( static_cast<MetricField&>(rFld), eCoreUnit );
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -3588,14 +3584,12 @@ IMPL_LINK( SvxNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld )
}
SetModified();
-
- return 0;
}
-IMPL_LINK( SvxNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld )
+IMPL_LINK_TYPED( SvxNumPositionTabPage, IndentAtHdl_Impl, SpinField&, rFld, void )
{
// determine value to be set at the chosen list levels
- const long nValue = GetCoreValue( *pFld, eCoreUnit );
+ const long nValue = GetCoreValue( static_cast<MetricField&>(rFld), eCoreUnit );
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -3615,8 +3609,6 @@ IMPL_LINK( SvxNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld )
}
SetModified();
-
- return 0;
}
IMPL_LINK_NOARG_TYPED(SvxNumPositionTabPage, StandardHdl_Impl, Button*, void)