From 9de789e3dd161580a56c989a87a4cbb53ab289b9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Sep 2015 12:27:23 +0200 Subject: convert Link<> to typed Change-Id: I2eb3c18753f413ca56047be12d6c859c938a0487 --- cui/source/dialogs/SpellDialog.cxx | 28 +++++++++++++--------------- cui/source/inc/SpellDialog.hxx | 4 ++-- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 2d3df7d7c14b..8c39d4a829b5 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -90,7 +90,7 @@ namespace svx{ class SpellUndoAction_Impl : public SfxUndoAction { sal_uInt16 m_nId; - const Link<>& m_rActionLink; + const Link& m_rActionLink; //undo of button enabling bool m_bEnableChangePB; bool m_bEnableChangeAllPB; @@ -107,7 +107,7 @@ class SpellUndoAction_Impl : public SfxUndoAction long m_nOffset; public: - SpellUndoAction_Impl(sal_uInt16 nId, const Link<>& rActionLink) : + SpellUndoAction_Impl(sal_uInt16 nId, const Link& rActionLink) : m_nId(nId), m_rActionLink( rActionLink), m_bEnableChangePB(false), @@ -163,7 +163,7 @@ SpellUndoAction_Impl::~SpellUndoAction_Impl() void SpellUndoAction_Impl::Undo() { - m_rActionLink.Call(this); + m_rActionLink.Call(*this); } @@ -680,22 +680,22 @@ IMPL_LINK_NOARG_TYPED(SpellDialog, UndoHdl, Button*, void) } -IMPL_LINK( SpellDialog, DialogUndoHdl, SpellUndoAction_Impl*, pAction ) +IMPL_LINK_TYPED( SpellDialog, DialogUndoHdl, SpellUndoAction_Impl&, rAction, void ) { - switch(pAction->GetId()) + switch(rAction.GetId()) { case SPELLUNDO_CHANGE_TEXTENGINE: { - if(pAction->IsEnableChangePB()) + if(rAction.IsEnableChangePB()) m_pChangePB->Enable(false); - if(pAction->IsEnableChangeAllPB()) + if(rAction.IsEnableChangeAllPB()) m_pChangeAllPB->Enable(false); } break; case SPELLUNDO_CHANGE_NEXTERROR: { - m_pSentenceED->MoveErrorMarkTo((sal_uInt16)pAction->GetOldErrorStart(), (sal_uInt16)pAction->GetOldErrorEnd(), false); - if(pAction->IsErrorLanguageSelected()) + m_pSentenceED->MoveErrorMarkTo((sal_uInt16)rAction.GetOldErrorStart(), (sal_uInt16)rAction.GetOldErrorEnd(), false); + if(rAction.IsErrorLanguageSelected()) { UpdateBoxes_Impl(); } @@ -703,14 +703,14 @@ IMPL_LINK( SpellDialog, DialogUndoHdl, SpellUndoAction_Impl*, pAction ) break; case SPELLUNDO_CHANGE_ADD_TO_DICTIONARY: { - if(pAction->GetDictionary().is()) - pAction->GetDictionary()->remove(pAction->GetAddedWord()); + if(rAction.GetDictionary().is()) + rAction.GetDictionary()->remove(rAction.GetAddedWord()); } break; case SPELLUNDO_MOVE_ERROREND : { - if(pAction->GetOffset() != 0) - m_pSentenceED->MoveErrorEnd(pAction->GetOffset()); + if(rAction.GetOffset() != 0) + m_pSentenceED->MoveErrorEnd(rAction.GetOffset()); } break; case SPELLUNDO_UNDO_EDIT_MODE : @@ -723,8 +723,6 @@ IMPL_LINK( SpellDialog, DialogUndoHdl, SpellUndoAction_Impl*, pAction ) //undo of ignored rules is not supported break; } - - return 0; } void SpellDialog::Impl_Restore() diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 83495df9db56..7509de014371 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -159,7 +159,7 @@ private: OUString m_sTitleSpelling; OUString m_sTitleSpellingGrammar; - Link<> aDialogUndoLink; + Link aDialogUndoLink; bool bModified; bool bFocusLocked; @@ -184,7 +184,7 @@ private: DECL_LINK_TYPED( AddToDictSelectHdl, MenuButton*, void ); DECL_LINK_TYPED( AddToDictClickHdl, Button*, void ); DECL_LINK( LanguageSelectHdl, SvxLanguageBox* ); - DECL_LINK( DialogUndoHdl, SpellUndoAction_Impl* ); + DECL_LINK_TYPED( DialogUndoHdl, SpellUndoAction_Impl&, void ); DECL_LINK( HandleHyperlink, FixedHyperlink * ); DECL_LINK_TYPED( InitHdl, void*, void ); -- cgit