summaryrefslogtreecommitdiff
path: root/sw/source/ui/misc/num.cxx
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 /sw/source/ui/misc/num.cxx
parentfa21f301ddef575baad9a3aa8564199285e6d90b (diff)
convert Link<> to typed
Change-Id: I2ef1e5fe5c6dc65c254b3a16b0b12fca5caba16e
Diffstat (limited to 'sw/source/ui/misc/num.cxx')
-rw-r--r--sw/source/ui/misc/num.cxx40
1 files changed, 18 insertions, 22 deletions
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 46708058d1e2..569b42efa367 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -115,7 +115,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(vcl::Window* pParent,
m_pAlign2LB->SetDropDownLineCount( m_pAlign2LB->GetEntryCount() );
m_pAlign2FT->SetText( m_pAlignFT->GetText() );
- Link<> aLk = LINK(this, SwNumPositionTabPage, DistanceHdl);
+ Link<SpinField&,void> aLk = LINK(this, SwNumPositionTabPage, DistanceHdl);
Link<Control&,void> aLk2 = LINK(this, SwNumPositionTabPage, DistanceLoseFocusHdl);
m_pDistBorderMF->SetUpHdl(aLk);
m_pDistNumMF->SetUpHdl(aLk);
@@ -660,20 +660,21 @@ IMPL_LINK_TYPED( SwNumPositionTabPage, LevelHdl, ListBox&, rBox, void )
IMPL_LINK_TYPED( SwNumPositionTabPage, DistanceLoseFocusHdl, Control&, rControl, void )
{
- DistanceHdl(static_cast<MetricField*>(&rControl));
+ DistanceHdl(static_cast<SpinField&>(rControl));
}
-IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pField )
+IMPL_LINK_TYPED( SwNumPositionTabPage, DistanceHdl, SpinField&, rSpin, void )
{
if(bInInintControl)
- return 0;
- long nValue = static_cast< long >(pField->Denormalize(pField->GetValue(FUNIT_TWIP)));
+ return;
+ MetricField& rField = static_cast<MetricField&>(rSpin);
+ long nValue = static_cast< long >(rField.Denormalize(rField.GetValue(FUNIT_TWIP)));
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
if(nActNumLvl & nMask)
{
SwNumFormat aNumFormat( pActNum->Get( i ) );
- if(pField == m_pDistBorderMF)
+ if(&rField == m_pDistBorderMF)
{
if(m_pRelativeCB->IsChecked() && m_pRelativeCB->IsEnabled())
@@ -697,11 +698,11 @@ IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pField )
aNumFormat.SetAbsLSpace( (short)nValue - aNumFormat.GetFirstLineOffset());
}
}
- else if (pField == m_pDistNumMF)
+ else if (&rField == m_pDistNumMF)
{
aNumFormat.SetCharTextDistance( nValue );
}
- else if (pField == m_pIndentMF)
+ else if (&rField == m_pIndentMF)
{
// now AbsLSpace also has to be modified by FirstLineOffset
long nDiff = nValue + aNumFormat.GetFirstLineOffset();
@@ -718,8 +719,6 @@ IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pField )
SetModified();
if(!m_pDistBorderMF->IsEnabled())
m_pDistBorderMF->SetText(aEmptyOUStr);
-
- return 0;
}
IMPL_LINK_TYPED( SwNumPositionTabPage, RelativeHdl, Button *, pBox, void )
@@ -819,10 +818,11 @@ IMPL_LINK_NOARG_TYPED(SwNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox&, v
SetModified();
}
-IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pField )
+IMPL_LINK_TYPED( SwNumPositionTabPage, ListtabPosHdl_Impl, SpinField&, rSpin, void )
{
+ MetricField& rField = static_cast<MetricField&>(rSpin);
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(pField->Denormalize(pField->GetValue(FUNIT_TWIP)));
+ const long nValue = static_cast< long >(rField.Denormalize(rField.GetValue(FUNIT_TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -838,14 +838,13 @@ IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pField )
}
SetModified();
-
- return 0;
}
-IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pField )
+IMPL_LINK_TYPED( SwNumPositionTabPage, AlignAtHdl_Impl, SpinField&, rSpin, void )
{
+ MetricField& rField = static_cast<MetricField&>(rSpin);
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(pField->Denormalize(pField->GetValue(FUNIT_TWIP)));
+ const long nValue = static_cast< long >(rField.Denormalize(rField.GetValue(FUNIT_TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -862,14 +861,13 @@ IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pField )
}
SetModified();
-
- return 0;
}
-IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pField )
+IMPL_LINK_TYPED( SwNumPositionTabPage, IndentAtHdl_Impl, SpinField&, rSpin, void )
{
+ MetricField& rField = static_cast<MetricField&>(rSpin);
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(pField->Denormalize(pField->GetValue(FUNIT_TWIP)));
+ const long nValue = static_cast< long >(rField.Denormalize(rField.GetValue(FUNIT_TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -889,8 +887,6 @@ IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pField )
}
SetModified();
-
- return 0;
}
IMPL_LINK_NOARG_TYPED(SwNumPositionTabPage, StandardHdl, Button*, void)