diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-16 09:51:57 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-09-17 08:19:32 +0200 |
commit | b98fb89598a400b33a47ceebafe1604c03c829dc (patch) | |
tree | dd465013d9f77ea14b6e77a81b7cf88dd2f4a88e /sc | |
parent | 23b9febbd883f9db77ffb0216b050aaabc4c6510 (diff) |
convert Link<> to typed
Change-Id: Ied8e0b35f193770a6651f1c57dfb8eedd22d837c
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 42 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleText.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/inputwin.hxx | 2 |
4 files changed, 23 insertions, 34 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index a9add1cb7618..33d5a8e5a790 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -713,7 +713,7 @@ ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell, ScAccessibleCellTextData::~ScAccessibleCellTextData() { if (pEditEngine) - pEditEngine->SetNotifyHdl(Link<>()); + pEditEngine->SetNotifyHdl(Link<EENotify&,void>()); if (mpViewForwarder) delete mpViewForwarder; if (mpEditViewForwarder) @@ -932,17 +932,12 @@ SvxEditViewForwarder* ScAccessibleCellTextData::GetEditViewForwarder( bool /* bC return NULL; } -IMPL_LINK(ScAccessibleTextData, NotifyHdl, EENotify*, aNotify) +IMPL_LINK_TYPED(ScAccessibleTextData, NotifyHdl, EENotify&, aNotify, void) { - if( aNotify ) - { - ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify ); - - if( aHint.get() ) - GetBroadcaster().Broadcast( *aHint.get() ); - } + ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( &aNotify ); - return 0; + if( aHint.get() ) + GetBroadcaster().Broadcast( *aHint.get() ); } ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell) @@ -972,7 +967,7 @@ ScAccessibleEditObjectTextData::~ScAccessibleEditObjectTextData() { // If the object is cloned, do NOT set notify hdl. if (mpEditEngine && !mbIsCloned) - mpEditEngine->SetNotifyHdl(Link<>()); + mpEditEngine->SetNotifyHdl(Link<EENotify&,void>()); if (mpViewForwarder) delete mpViewForwarder; if (mpEditViewForwarder) @@ -1047,17 +1042,12 @@ SvxEditViewForwarder* ScAccessibleEditObjectTextData::GetEditViewForwarder( bool return mpEditViewForwarder; } -IMPL_LINK(ScAccessibleEditObjectTextData, NotifyHdl, EENotify*, aNotify) +IMPL_LINK_TYPED(ScAccessibleEditObjectTextData, NotifyHdl, EENotify&, rNotify, void) { - if( aNotify ) - { - ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify ); - - if( aHint.get() ) - GetBroadcaster().Broadcast( *aHint.get() ); - } + ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( &rNotify ); - return 0; + if( aHint.get() ) + GetBroadcaster().Broadcast( *aHint.get() ); } ScAccessibleEditLineTextData::ScAccessibleEditLineTextData(EditView* pEditView, vcl::Window* pWin) @@ -1088,7 +1078,7 @@ ScAccessibleEditLineTextData::~ScAccessibleEditLineTextData() // the NotifyHdl also has to be removed from the ScTextWnd's EditEngine // (it's set in ScAccessibleEditLineTextData::GetTextForwarder, and mpEditEngine // is reset there) - pTxtWnd->GetEditView()->GetEditEngine()->SetNotifyHdl(Link<>()); + pTxtWnd->GetEditView()->GetEditEngine()->SetNotifyHdl(Link<EENotify&,void>()); } } @@ -1183,7 +1173,7 @@ void ScAccessibleEditLineTextData::ResetEditMode() if (mbEditEngineCreated && mpEditEngine) delete mpEditEngine; else if (pTxtWnd && pTxtWnd->GetEditView() && pTxtWnd->GetEditView()->GetEditEngine()) - pTxtWnd->GetEditView()->GetEditEngine()->SetNotifyHdl(Link<>()); + pTxtWnd->GetEditView()->GetEditEngine()->SetNotifyHdl(Link<EENotify&,void>()); mpEditEngine = NULL; DELETEZ(mpForwarder); @@ -1236,7 +1226,7 @@ ScAccessiblePreviewCellTextData::ScAccessiblePreviewCellTextData(ScPreviewShell* ScAccessiblePreviewCellTextData::~ScAccessiblePreviewCellTextData() { if (pEditEngine) - pEditEngine->SetNotifyHdl(Link<>()); + pEditEngine->SetNotifyHdl(Link<EENotify&,void>()); if (mpViewForwarder) delete mpViewForwarder; } @@ -1314,7 +1304,7 @@ ScAccessiblePreviewHeaderCellTextData::ScAccessiblePreviewHeaderCellTextData(ScP ScAccessiblePreviewHeaderCellTextData::~ScAccessiblePreviewHeaderCellTextData() { if (pEditEngine) - pEditEngine->SetNotifyHdl(Link<>()); + pEditEngine->SetNotifyHdl(Link<EENotify&,void>()); if (mpViewForwarder) delete mpViewForwarder; } @@ -1432,7 +1422,7 @@ ScAccessibleHeaderTextData::~ScAccessibleHeaderTextData() if (mpDocSh) mpDocSh->GetDocument().RemoveUnoObject(*this); if (mpEditEngine) - mpEditEngine->SetNotifyHdl(Link<>()); + mpEditEngine->SetNotifyHdl(Link<EENotify&,void>()); delete mpEditEngine; delete mpForwarder; } @@ -1547,7 +1537,7 @@ ScAccessibleNoteTextData::~ScAccessibleNoteTextData() if (mpDocSh) mpDocSh->GetDocument().RemoveUnoObject(*this); if (mpEditEngine) - mpEditEngine->SetNotifyHdl(Link<>()); + mpEditEngine->SetNotifyHdl(Link<EENotify&,void>()); delete mpEditEngine; delete mpForwarder; } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 4ca59a7cd746..6293db35be83 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1244,17 +1244,16 @@ IMPL_LINK(ScMultiTextWnd, ModifyHdl, EENotify*, pNotify) return 0; } -IMPL_LINK(ScMultiTextWnd, NotifyHdl, EENotify*, pNotify) +IMPL_LINK_TYPED(ScMultiTextWnd, NotifyHdl, EENotify&, rNotify, void) { // need to process EE_NOTIFY_TEXTVIEWSCROLLED here // sometimes we don't seem to get EE_NOTIFY_TEXTVIEWSCROLLED e.g. when // we insert text at the beginning of the text so the cursor never moves // down to generate a scroll event - if ( pNotify && ( pNotify->eNotificationType == EE_NOTIFY_TEXTVIEWSCROLLED - || pNotify->eNotificationType == EE_NOTIFY_TEXTHEIGHTCHANGED ) ) + if ( rNotify.eNotificationType == EE_NOTIFY_TEXTVIEWSCROLLED + || rNotify.eNotificationType == EE_NOTIFY_TEXTHEIGHTCHANGED ) SetScrollBarRange(); - return 0; } long ScMultiTextWnd::GetEditEngTxtHeight() @@ -1434,7 +1433,7 @@ void ScMultiTextWnd::InitEditEngine() void ScMultiTextWnd::StopEditEngine( bool bAll ) { if ( pEditEngine ) - pEditEngine->SetNotifyHdl(Link<>()); + pEditEngine->SetNotifyHdl(Link<EENotify&,void>()); ScTextWnd::StopEditEngine( bAll ); } diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx index 0b0191110397..cda6b52e2f18 100644 --- a/sc/source/ui/inc/AccessibleText.hxx +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -54,7 +54,7 @@ public: SfxBroadcaster& GetBroadcaster() const { return maBroadcaster; } virtual void UpdateData() = 0; - DECL_LINK( NotifyHdl, EENotify* ); + DECL_LINK_TYPED( NotifyHdl, EENotify&, void ); private: mutable SfxBroadcaster maBroadcaster; @@ -121,7 +121,7 @@ public: virtual void UpdateData() SAL_OVERRIDE { } - DECL_LINK( NotifyHdl, EENotify* ); + DECL_LINK_TYPED( NotifyHdl, EENotify&, void ); protected: ScEditObjectViewForwarder* mpViewForwarder; ScEditViewForwarder* mpEditViewForwarder; diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index 7ae780633005..e4b10edc5ae8 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -186,7 +186,7 @@ protected: void InitEditEngine(); virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE; - DECL_LINK( NotifyHdl, EENotify* ); + DECL_LINK_TYPED( NotifyHdl, EENotify&, void ); DECL_LINK( ModifyHdl, EENotify* ); private: ScInputBarGroup& mrGroupBar; |