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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 30 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 14 |
2 files changed, 18 insertions, 26 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 2bb0e711e7b0..8f6e8211f94d 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1569,31 +1569,23 @@ IMPL_LINK_TYPED( CustomPropertiesWindow, RemoveHdl, Button*, pBtn, void ) m_aRemovedHdl.Call(0); } -IMPL_LINK( CustomPropertiesWindow, EditLoseFocusHdl, CustomPropertiesEdit*, pEdit ) +IMPL_LINK_TYPED( CustomPropertiesWindow, EditLoseFocusHdl, Control&, rControl, void ) { - if ( pEdit ) + CustomPropertiesEdit* pEdit = static_cast<CustomPropertiesEdit*>(&rControl); + CustomPropertyLine* pLine = pEdit->GetLine(); + if ( !pLine->m_bTypeLostFocus ) { - CustomPropertyLine* pLine = pEdit->GetLine(); - if ( !pLine->m_bTypeLostFocus ) - { - m_pCurrentLine = pLine; - m_aEditLoseFocusIdle.Start(); - } - else - pLine->m_bTypeLostFocus = false; + m_pCurrentLine = pLine; + m_aEditLoseFocusIdle.Start(); } - return 0; + else + pLine->m_bTypeLostFocus = false; } -IMPL_LINK( CustomPropertiesWindow, BoxLoseFocusHdl, CustomPropertiesTypeBox*, pBox ) +IMPL_LINK_TYPED( CustomPropertiesWindow, BoxLoseFocusHdl, Control&, rControl, void ) { - if ( pBox ) - { - m_pCurrentLine = pBox->GetLine(); - m_aBoxLoseFocusIdle.Start(); - } - - return 0; + m_pCurrentLine = static_cast<CustomPropertiesTypeBox*>(&rControl)->GetLine(); + m_aBoxLoseFocusIdle.Start(); } IMPL_LINK_NOARG_TYPED(CustomPropertiesWindow, EditTimeoutHdl, Idle *, void) diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index b97ac2df97cc..425cf984dbda 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -256,8 +256,8 @@ SfxManageStyleSheetPage::~SfxManageStyleSheetPage() void SfxManageStyleSheetPage::dispose() { - m_pNameRw->SetGetFocusHdl( Link<>() ); - m_pNameRw->SetLoseFocusHdl( Link<>() ); + m_pNameRw->SetGetFocusHdl( Link<Control&,void>() ); + m_pNameRw->SetLoseFocusHdl( Link<Control&,void>() ); delete pFamilies; pItem = 0; pStyle = 0; @@ -414,7 +414,7 @@ bool SfxManageStyleSheetPage::Execute_Impl( } -IMPL_LINK( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SfxManageStyleSheetPage, GetFocusHdl, Control&, rControl, void ) /* [Description] @@ -422,11 +422,11 @@ IMPL_LINK( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit ) */ { + Edit* pEdit = static_cast<Edit*>(&rControl); aBuf = comphelper::string::stripStart(pEdit->GetText(), ' '); - return 0; } -IMPL_LINK( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SfxManageStyleSheetPage, LoseFocusHdl, Control&, rControl, void ) /* [Description] @@ -436,12 +436,12 @@ IMPL_LINK( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit ) */ { + Edit* pEdit = static_cast<Edit*>(&rControl); const OUString aStr(comphelper::string::stripStart(pEdit->GetText(), ' ')); pEdit->SetText( aStr ); // Update the Listbox of the base template if possible if ( aStr != aBuf ) UpdateName_Impl(m_pFollowLb, aStr); - return 0; } bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet* rSet ) @@ -622,7 +622,7 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet { // By pressing <Enter> LoseFocus() is not trigged through StarView if ( m_pNameRw->HasFocus() ) - LoseFocusHdl( m_pNameRw ); + LoseFocusHdl( *m_pNameRw ); if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' '))) { |