diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-09-24 13:53:17 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-09-24 16:19:37 +0000 |
commit | e85b2333bce7b1dcae73861df6d90b48b9f4efe5 (patch) | |
tree | 21d066cecfbfda9ace96b26953ddcc3ae1764001 /svx | |
parent | ff6462e6307e6924dc6c8178043ae9032f4b4152 (diff) |
convert Link<> to typed
Change-Id: I59d325c3b051690303a5841907317122fa1ec98b
Reviewed-on: https://gerrit.libreoffice.org/18825
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/_bmpmask.cxx | 7 | ||||
-rw-r--r-- | svx/source/dialog/dialcontrol.cxx | 19 | ||||
-rw-r--r-- | svx/source/dialog/hdft.cxx | 18 | ||||
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 12 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 18 |
5 files changed, 44 insertions, 30 deletions
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 739c1c7dba3a..2b3e3f99a0d6 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -174,7 +174,7 @@ public: DECL_LINK_TYPED( PipetteHdl, ToolBox*, void ); DECL_LINK_TYPED( CbxHdl, Button*, void); DECL_LINK_TYPED( CbxTransHdl, Button*, void ); - DECL_LINK( FocusLbHdl, ColorLB* ); + DECL_LINK_TYPED( FocusLbHdl, Control&, void ); DECL_LINK_TYPED(ExecHdl, Button*, void); }; @@ -295,15 +295,14 @@ IMPL_LINK_TYPED( MaskData, CbxTransHdl, Button*, pButton, void ) -IMPL_LINK( MaskData, FocusLbHdl, ColorLB*, pLb ) +IMPL_LINK_TYPED( MaskData, FocusLbHdl, Control&, rControl, void ) { + ColorLB* pLb = static_cast<ColorLB*>(&rControl); // MT: bFireFox as API parameter is ugly, find better solution???? pMask->m_pQSet1->SelectItem( pLb == pMask->m_pLbColor1 ? 1 : 0 /* , false */ ); pMask->m_pQSet2->SelectItem( pLb == pMask->m_pLbColor2 ? 1 : 0 /* , false */ ); pMask->m_pQSet3->SelectItem( pLb == pMask->m_pLbColor3 ? 1 : 0 /* , false */ ); pMask->m_pQSet4->SelectItem( pLb == pMask->m_pLbColor4 ? 1 : 0 /* , false */ ); - - return 0; } diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 8d127e518dd3..66ef7d827dd4 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -394,10 +394,14 @@ void DialControl::SetLinkedField( NumericField* pField, sal_Int32 nDecimalPlaces // remove modify handler from old linked field ImplSetFieldLink( Link<>() ); + if( mpImpl->mpLinkField ) + mpImpl->mpLinkField->SetLoseFocusHdl( Link<Control&,void>() ); // remember the new linked field mpImpl->mpLinkField = pField; // set modify handler at new linked field ImplSetFieldLink( LINK( this, DialControl, LinkedFieldModifyHdl ) ); + if( mpImpl->mpLinkField ) + mpImpl->mpLinkField->SetLoseFocusHdl( LINK( this, DialControl, LinkedFieldFocusHdl ) ); } void DialControl::SaveValue() @@ -472,7 +476,6 @@ void DialControl::ImplSetFieldLink( const Link<>& rLink ) rField.SetDownHdl( rLink ); rField.SetFirstHdl( rLink ); rField.SetLastHdl( rLink ); - rField.SetLoseFocusHdl( rLink ); } } @@ -506,12 +509,20 @@ void DialControl::HandleEscapeEvent() } } -IMPL_LINK( DialControl, LinkedFieldModifyHdl, NumericField*, pField ) +IMPL_LINK( DialControl, LinkedFieldModifyHdl, NumericField*, /*pField*/ ) { - if( pField ) - SetRotation( static_cast< sal_Int32 >( pField->GetValue() * mpImpl->mnLinkedFieldValueMultiplyer ), false ); + LinkedFieldModifyHdl(); return 0; } +IMPL_LINK_NOARG_TYPED( DialControl, LinkedFieldFocusHdl, Control&, void ) +{ + LinkedFieldModifyHdl(); +} +void DialControl::LinkedFieldModifyHdl() +{ + if( mpImpl->mpLinkField ) + SetRotation( static_cast< sal_Int32 >( mpImpl->mpLinkField->GetValue() * mpImpl->mnLinkedFieldValueMultiplyer ), false ); +} diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index f66382d9478c..65326c07a7e2 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -489,15 +489,15 @@ void SvxHFPage::InitHandler() { m_pTurnOnBox->SetClickHdl(LINK(this, SvxHFPage, TurnOnHdl)); m_pDistEdit->SetModifyHdl(LINK(this, SvxHFPage, DistModify)); - m_pDistEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeHdl)); + m_pDistEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeFocusHdl)); m_pHeightEdit->SetModifyHdl(LINK(this, SvxHFPage, HeightModify)); - m_pHeightEdit->SetLoseFocusHdl(LINK(this,SvxHFPage,RangeHdl)); + m_pHeightEdit->SetLoseFocusHdl(LINK(this,SvxHFPage,RangeFocusHdl)); m_pLMEdit->SetModifyHdl(LINK(this, SvxHFPage, BorderModify)); - m_pLMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeHdl)); + m_pLMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeFocusHdl)); m_pRMEdit->SetModifyHdl(LINK(this, SvxHFPage, BorderModify)); - m_pRMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeHdl)); + m_pRMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeFocusHdl)); m_pBackgroundBtn->SetClickHdl(LINK(this,SvxHFPage, BackgroundHdl)); } @@ -1062,6 +1062,15 @@ SfxTabPage::sfxpg SvxHFPage::DeactivatePage( SfxItemSet* _pSet ) IMPL_LINK_NOARG(SvxHFPage, RangeHdl) { + RangeHdl(); + return 0; +} +IMPL_LINK_NOARG_TYPED(SvxHFPage, RangeFocusHdl, Control&, void) +{ + RangeHdl(); +} +void SvxHFPage::RangeHdl() +{ long nHHeight = m_pBspWin->GetHdHeight(); long nHDist = m_pBspWin->GetHdDist(); @@ -1130,7 +1139,6 @@ IMPL_LINK_NOARG(SvxHFPage, RangeHdl) nMax = nW - nBL - nBR - static_cast<long>(m_pLMEdit->Denormalize( m_pLMEdit->GetValue( FUNIT_TWIP ) )) - MINBODY; m_pRMEdit->SetMax( m_pLMEdit->Normalize( nMax ), FUNIT_TWIP ); - return 0; } static void lcl_Move(vcl::Window& rWin, sal_Int32 nDiff) diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 686a75997a48..751e40a4229e 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -345,7 +345,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void ) if(nNewItemId == mnApplyId) { - URLLoseFocusHdl( NULL ); + URLLoseFocusHdl( *m_pURLBox ); SfxBoolItem aBoolItem( SID_IMAP_EXEC, true ); GetBindings().GetDispatcher()->Execute( SID_IMAP_EXEC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aBoolItem, 0L ); @@ -408,7 +408,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void ) } else if(nNewItemId == mnActiveId) { - URLLoseFocusHdl( NULL ); + URLLoseFocusHdl( *m_pURLBox ); bool bNewState = !pTbx->IsItemChecked( TBI_ACTIVE ); pTbx->CheckItem( TBI_ACTIVE, bNewState ); pIMapWnd->SetCurrentObjState( !bNewState ); @@ -441,12 +441,12 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void ) } else if(nNewItemId == mnUndoId) { - URLLoseFocusHdl( NULL ); + URLLoseFocusHdl( *m_pURLBox ); pIMapWnd->GetSdrModel()->Undo(); } else if(nNewItemId == mnRedoId) { - URLLoseFocusHdl( NULL ); + URLLoseFocusHdl( *m_pURLBox ); pIMapWnd->GetSdrModel()->Redo(); } } @@ -695,7 +695,7 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLModifyHdl) return 0; } -IMPL_LINK_NOARG(SvxIMapDlg, URLLoseFocusHdl) +IMPL_LINK_NOARG_TYPED(SvxIMapDlg, URLLoseFocusHdl, Control&, void) { NotifyInfo aNewInfo; const OUString aURLText( m_pURLBox->GetText() ); @@ -719,8 +719,6 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLLoseFocusHdl) aNewInfo.aMarkTarget = aTargetText; pIMapWnd->ReplaceActualIMapInfo( aNewInfo ); - - return 0; } IMPL_LINK_NOARG_TYPED(SvxIMapDlg, UpdateHdl, Idle *, void) diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index a904015c7576..85028fce0e8f 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -632,7 +632,7 @@ void SvxSearchDialog::InitControls_Impl() m_pSearchLB->SetModifyHdl( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) ); m_pReplaceLB->SetModifyHdl( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) ); - Link<> aLink = LINK( this, SvxSearchDialog, FocusHdl_Impl ); + Link<Control&,void> aLink = LINK( this, SvxSearchDialog, FocusHdl_Impl ); m_pSearchLB->SetGetFocusHdl( aLink ); m_pReplaceLB->SetGetFocusHdl( aLink ); @@ -992,7 +992,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern ) bDisableSearch = m_pSearchLB->GetText().isEmpty() && m_pSearchAttrText->GetText().isEmpty(); } - FocusHdl_Impl(m_pSearchLB); + FocusHdl_Impl(*m_pSearchLB); if ( bDisableSearch ) { @@ -1511,7 +1511,7 @@ IMPL_LINK_NOARG_TYPED(SvxSearchDialog, TemplateHdl_Impl, Button*, void) EnableControl_Impl(m_pAttributeBtn); EnableControl_Impl(m_pSimilarityBox); - FocusHdl_Impl( bSearch ? m_pSearchLB : m_pReplaceLB ); + FocusHdl_Impl( bSearch ? *m_pSearchLB : *m_pReplaceLB ); } bSet = true; pImpl->bSaveToModule = false; @@ -1809,10 +1809,10 @@ void SvxSearchDialog::SetItem_Impl( const SvxSearchItem* pItem ) -IMPL_LINK( SvxSearchDialog, FocusHdl_Impl, Control *, pCtrl ) +IMPL_LINK_TYPED( SvxSearchDialog, FocusHdl_Impl, Control&, rControl, void ) { sal_Int32 nTxtLen = m_pSearchAttrText->GetText().getLength(); - + Control* pCtrl = &rControl; if ( pCtrl == m_pSearchLB ) { if ( pCtrl->HasChildPathFocus() ) @@ -1865,15 +1865,13 @@ IMPL_LINK( SvxSearchDialog, FocusHdl_Impl, Control *, pCtrl ) m_pLayoutBtn->SetText(aStylesStr); } } - return 0; } -IMPL_LINK_NOARG(SvxSearchDialog, LoseFocusHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxSearchDialog, LoseFocusHdl_Impl, Control&, void) { SaveToModule_Impl(); - return 0; } @@ -2127,12 +2125,12 @@ void SvxSearchDialog::PaintAttrText_Impl() if ( bSearch ) { m_pSearchAttrText->SetText( aDesc ); - FocusHdl_Impl(m_pSearchLB); + FocusHdl_Impl(*m_pSearchLB); } else { m_pReplaceAttrText->SetText( aDesc ); - FocusHdl_Impl(m_pReplaceLB); + FocusHdl_Impl(*m_pReplaceLB); } } |