diff options
Diffstat (limited to 'sw/source/ui/misc/num.cxx')
-rw-r--r-- | sw/source/ui/misc/num.cxx | 40 |
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) |