diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
commit | 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch) | |
tree | bdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /sd/source/ui/view | |
parent | 57d254d42b6e1d836bd21e6fb2e968af2b511c7d (diff) |
Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and
return types, but provide default template arguments that keep the generic,
unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the
Link class can be updated over time.
All the related macros are duplicated with ..._TYPED counterparts, that
additionally take the RetType (except for LINK_TYPED, which manages to infer the
relevant types from the supplied Member).
(It would have been attractive to change the "untyped" LinkStubs from taking a
void* to a properly typed ArgType parameter, too, but that would cause
-fsanitize=function to flag uses of "untyped" Link::Call.)
Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/FormShellManager.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/ToolBarManager.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews4.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/outlview.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/viewoverlaymanager.cxx | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index d3e44fb3561e..14230cb9f43e 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1627,7 +1627,7 @@ private: Size( nRotatedWidth, nRotatedHeight ) ); } - Link aOldLink; + Link<> aOldLink; Outliner* pOutliner = mrBase.GetDocument()->GetInternalOutliner(); pOutliner->Init(OUTLINERMODE_OUTLINEVIEW); const sal_uInt16 nSavedOutlMode (pOutliner->GetMode()); diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 03ac6c7045bd..ad6354b96105 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -57,7 +57,7 @@ FormShellManager::FormShellManager (ViewShellBase& rBase) { // Register at the EventMultiplexer to be informed about changes in the // center pane. - Link aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); + Link<> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); mrBase.GetEventMultiplexer()->AddEventListener( aLink, sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED @@ -73,7 +73,7 @@ FormShellManager::~FormShellManager() UnregisterAtCenterPane(); // Unregister from the EventMultiplexer. - Link aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); + Link<> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); mrBase.GetEventMultiplexer()->RemoveEventListener(aLink); if (mpSubShellFactory.get() != NULL) @@ -91,7 +91,7 @@ void FormShellManager::SetFormShell (FmFormShell* pFormShell) // Disconnect from the old form shell. if (mpFormShell != NULL) { - mpFormShell->SetControlActivationHandler(Link()); + mpFormShell->SetControlActivationHandler(Link<>()); EndListening(*mpFormShell); mpFormShell->SetView(NULL); } diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index ca5b6dd66fb5..277efb16bb77 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -311,7 +311,7 @@ void Outliner::EndSpelling() bool bViewIsDrawViewShell(pViewShell && pViewShell->ISA(DrawViewShell)); if (bViewIsDrawViewShell) { - SetStatusEventHdl(Link()); + SetStatusEventHdl(Link<>()); mpView = pViewShell->GetView(); mpView->UnmarkAllObj (mpView->GetSdrPageView()); mpView->SdrEndTextEdit(); @@ -736,7 +736,7 @@ void Outliner::DetectChange() || aPosition.mePageKind != pDrawViewShell->GetPageKind())) { // Either the edit mode or the page kind has changed. - SetStatusEventHdl(Link()); + SetStatusEventHdl(Link<>()); SdrPageView* pPageView = mpView->GetSdrPageView(); if (pPageView != NULL) @@ -1207,7 +1207,7 @@ void Outliner::SetViewMode (PageKind ePageKind) // Restore old edit mode. pDrawViewShell->ChangeEditMode(mpImpl->meOriginalEditMode, false); - SetStatusEventHdl(Link()); + SetStatusEventHdl(Link<>()); OUString sViewURL; switch (ePageKind) { diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 3b5b281b13de..67cc9552500f 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -536,7 +536,7 @@ ToolBarManager::Implementation::Implementation ( mnPendingSetValidCall(0), maToolBarRules(rpToolBarManager,rpViewShellManager) { - Link aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); + Link<> aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); mpEventMultiplexer->AddEventListener( aLink, tools::EventMultiplexerEvent::EID_CONTROLLER_ATTACHED @@ -551,7 +551,7 @@ ToolBarManager::Implementation::Implementation ( ToolBarManager::Implementation::~Implementation() { // Unregister at broadcasters. - Link aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); + Link<> aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); mpEventMultiplexer->RemoveEventListener(aLink); // Abort pending user calls. diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 9a6b58553aec..dc7a8fe99354 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -609,7 +609,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) ( !rCEvt.IsMouseEvent() && pOutlinerView->IsCursorAtWrongSpelledWord() ) ) { // Popup for Online-Spelling now handled by DrawDocShell - Link aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback); + Link<> aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback); if( !rCEvt.IsMouseEvent() ) { diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index f72aa2f3512c..a222d8a0a393 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1378,7 +1378,7 @@ void OutlineViewShell::Command( const CommandEvent& rCEvt, ::sd::Window* pWin ) if (pOLV && pOLV->IsWrongSpelledWordAtPos(aPos)) { // Popup for Online-Spelling now handled by DrawDocShell - Link aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback); + Link<> aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback); pOLV->ExecuteSpellPopup(aPos, &aLink); } diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 8b0ba72e30f1..db4ab7a4a619 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -131,7 +131,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie FillOutliner(); } - Link aLink( LINK(this,OutlineView,EventMultiplexerListener) ); + Link<> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->AddEventListener( aLink, tools::EventMultiplexerEvent::EID_CURRENT_PAGE @@ -171,7 +171,7 @@ OutlineView::~OutlineView() { DBG_ASSERT(maDragAndDropModelGuard.get() == 0, "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!" ); - Link aLink( LINK(this,OutlineView,EventMultiplexerListener) ); + Link<> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink ); DisconnectFromApplication(); @@ -1378,7 +1378,7 @@ void OutlineView::SetLinks() */ void OutlineView::ResetLinks() const { - Link aEmptyLink; + Link<> aEmptyLink; mrOutliner.SetParaInsertedHdl(aEmptyLink); mrOutliner.SetParaRemovingHdl(aEmptyLink); mrOutliner.SetDepthChangedHdl(aEmptyLink); diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 40906cb21b19..f184bb89a177 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -422,7 +422,7 @@ ViewOverlayManager::ViewOverlayManager( ViewShellBase& rViewShellBase ) : mrBase( rViewShellBase ) , mnUpdateTagsEvent( 0 ) { - Link aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); + Link<> aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->AddEventListener(aLink, tools::EventMultiplexerEvent::EID_CURRENT_PAGE | tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED | tools::EventMultiplexerEvent::EID_VIEW_ADDED @@ -434,7 +434,7 @@ ViewOverlayManager::ViewOverlayManager( ViewShellBase& rViewShellBase ) ViewOverlayManager::~ViewOverlayManager() { - Link aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); + Link<> aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->RemoveEventListener( aLink ); if( mnUpdateTagsEvent ) |