diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-21 08:03:25 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-09-21 08:03:52 +0200 |
commit | 1e67e94f1a308ca60d4934e9fe9d5c048225ebe8 (patch) | |
tree | c3bdf0fcec6912bc84e835fe48a80ee9f9391106 /sd | |
parent | c916152d8562cab868d4c522748ac30029fad179 (diff) |
convert Link<> to typed
Change-Id: If3e2b00092440ebd42ae5b73ae2b0e44c3702683
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/sdmod.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 23 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/inc/AccessibleDocumentViewBase.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/inc/OutlineView.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/outlview.cxx | 3 |
10 files changed, 24 insertions, 37 deletions
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx index a113a00fda0d..0ca3765831c2 100644 --- a/sd/inc/sdmod.hxx +++ b/sd/inc/sdmod.hxx @@ -189,7 +189,7 @@ private: @VclSimpleEvent * a pointer to a VCLSimpleEvent (see vcl/vclevent.hxx ) */ - DECL_STATIC_LINK( SdModule, EventListenerHdl, VclSimpleEvent* ); + DECL_STATIC_LINK_TYPED( SdModule, EventListenerHdl, VclSimpleEvent&, void ); }; diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index bc21e83371cd..afd26268d4fe 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -160,15 +160,11 @@ void AccessibleDocumentViewBase::Init() SetState(AccessibleStateType::EDITABLE); } -IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener, - VclSimpleEvent*, pEvent) +IMPL_LINK_TYPED(AccessibleDocumentViewBase, WindowChildEventListener, + VclWindowEvent&, rEvent, void) { - OSL_ASSERT(pEvent!=NULL && pEvent->ISA(VclWindowEvent)); - if (pEvent!=NULL && pEvent->ISA(VclWindowEvent)) - { - VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent); // DBG_ASSERT( pVclEvent->GetWindow(), "Window???" ); - switch (pWindowEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_OBJECT_DYING: { @@ -176,11 +172,11 @@ IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener, // This is also attempted in the disposing() method. vcl::Window* pWindow = maShapeTreeInfo.GetWindow(); vcl::Window* pDyingWindow = static_cast<vcl::Window*>( - pWindowEvent->GetWindow()); + rEvent.GetWindow()); if (pWindow==pDyingWindow && pWindow!=NULL && maWindowLink.IsSet()) { pWindow->RemoveChildEventListener (maWindowLink); - maWindowLink = Link<>(); + maWindowLink = Link<VclWindowEvent&,void>(); } } break; @@ -189,7 +185,7 @@ IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener, { // A new window has been created. Is it an OLE object? vcl::Window* pChildWindow = static_cast<vcl::Window*>( - pWindowEvent->GetData()); + rEvent.GetData()); if (pChildWindow!=NULL && (pChildWindow->GetAccessibleRole() == AccessibleRole::EMBEDDED_OBJECT)) @@ -204,7 +200,7 @@ IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener, // A window has been destroyed. Has that been an OLE // object? vcl::Window* pChildWindow = static_cast<vcl::Window*>( - pWindowEvent->GetData()); + rEvent.GetData()); if (pChildWindow!=NULL && (pChildWindow->GetAccessibleRole() == AccessibleRole::EMBEDDED_OBJECT)) @@ -214,9 +210,6 @@ IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener, } break; } - } - - return 0; } //===== IAccessibleViewForwarderListener ==================================== @@ -487,7 +480,7 @@ void AccessibleDocumentViewBase::impl_dispose() { if (pWindow) pWindow->RemoveChildEventListener (maWindowLink); - maWindowLink = Link<>(); + maWindowLink = Link<VclWindowEvent&,void>(); } else { diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 9613ea63befb..83e5f40649e6 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -416,11 +416,11 @@ void SdModule::GetState(SfxItemSet& rItemSet) } } -IMPL_STATIC_LINK( SdModule, EventListenerHdl, VclSimpleEvent*, pEvent ) +IMPL_STATIC_LINK_TYPED( SdModule, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void ) { - if( pEvent && (pEvent->GetId() == VCLEVENT_WINDOW_COMMAND) && static_cast<VclWindowEvent*>(pEvent)->GetData() ) + if( (rSimpleEvent.GetId() == VCLEVENT_WINDOW_COMMAND) && static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData() ) { - const CommandEvent& rEvent = *static_cast<const CommandEvent*>(static_cast<VclWindowEvent*>(pEvent)->GetData()); + const CommandEvent& rEvent = *static_cast<const CommandEvent*>(static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData()); if( rEvent.GetCommand() == CommandEventId::Media ) { @@ -447,7 +447,6 @@ IMPL_STATIC_LINK( SdModule, EventListenerHdl, VclSimpleEvent*, pEvent ) } } } - return 0; } void SdModule::AddSummaryPage (SfxViewFrame* pViewFrame, SdDrawDocument* pDocument) diff --git a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx index 6c44a3ab5793..ceb9a508f336 100644 --- a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx +++ b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx @@ -127,7 +127,7 @@ public: /** Define callback for listening to window child events of VCL. Listen for creation or destruction of OLE objects. */ - DECL_LINK (WindowChildEventListener, VclSimpleEvent*); + DECL_LINK_TYPED( WindowChildEventListener, VclWindowEvent&, void ); //===== IAccessibleViewForwarderListener ================================ @@ -305,7 +305,7 @@ protected: ::com::sun::star::accessibility::XAccessible> mxAccessibleOLEObject; - Link<> maWindowLink; + Link<VclWindowEvent&,void> maWindowLink; // This method is called from the component helper base class while // disposing. diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx index 60b54ac9f1b7..e88883748e34 100644 --- a/sd/source/ui/inc/OutlineView.hxx +++ b/sd/source/ui/inc/OutlineView.hxx @@ -200,7 +200,7 @@ private: /** this link is called from the vcl application when the stylesettings change. Its only purpose is to call onUpdateStyleSettings() then. */ - DECL_LINK( AppEventListenerHdl, void * ); + DECL_LINK_TYPED( AppEventListenerHdl, VclSimpleEvent&, void ); DECL_LINK_TYPED(EventMultiplexerListener, sd::tools::EventMultiplexerEvent&, void); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 25a0a1f82a89..0b3f79d912ef 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2003,14 +2003,14 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt) return bRet; } -IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent*, pEvent ) +IMPL_LINK_TYPED( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void ) { if( !mxShow.is() || mbInputFreeze ) - return 0; + return; - if( pEvent && (pEvent->GetId() == VCLEVENT_WINDOW_COMMAND) && static_cast<VclWindowEvent*>(pEvent)->GetData() ) + if( (rSimpleEvent.GetId() == VCLEVENT_WINDOW_COMMAND) && static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData() ) { - const CommandEvent& rEvent = *static_cast<const CommandEvent*>(static_cast<VclWindowEvent*>(pEvent)->GetData()); + const CommandEvent& rEvent = *static_cast<const CommandEvent*>(static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData()); if( rEvent.GetCommand() == CommandEventId::Media ) { @@ -2078,8 +2078,6 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent*, pEvent ) } } } - - return 0; } void SlideshowImpl::mouseButtonUp(const MouseEvent& rMEvt) diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index 06ac09ef791a..9d0b3424328e 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -281,7 +281,7 @@ private: DECL_LINK_TYPED( ContextMenuSelectHdl, Menu *, bool ); DECL_LINK_TYPED( ContextMenuHdl, void*, void ); DECL_LINK_TYPED( deactivateHdl, Timer *, void ); - DECL_LINK( EventListenerHdl, VclSimpleEvent* ); + DECL_LINK_TYPED( EventListenerHdl, VclSimpleEvent&, void ); // helper void receiveRequest(SfxRequest& rReq); diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 3b342467b363..845f4b8ba075 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -540,11 +540,9 @@ void SlideSorterController::HandleModelChange() } } -IMPL_LINK(SlideSorterController, ApplicationEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(SlideSorterController, ApplicationEventHandler, VclSimpleEvent&, rEvent, void) { - if (pEvent) - WindowEventHandler(*pEvent); - return 1; + WindowEventHandler(static_cast<VclWindowEvent&>(rEvent)); } IMPL_LINK_TYPED(SlideSorterController, WindowEventHandler, VclWindowEvent&, rEvent, void) { diff --git a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx index e47ed18795d8..2127793e703b 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx @@ -161,7 +161,7 @@ public: void HandleModelChange(); DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); - DECL_LINK(ApplicationEventHandler, VclWindowEvent*); + DECL_LINK_TYPED(ApplicationEventHandler, VclSimpleEvent&, void); /** Update the display of all pages. This involves a redraw and releasing previews and caches. diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index d1117bd40d0d..12deaea341b7 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1425,10 +1425,9 @@ void OutlineView::onUpdateStyleSettings( bool bForceUpdate /* = false */ ) } } -IMPL_LINK_NOARG(OutlineView, AppEventListenerHdl) +IMPL_LINK_NOARG_TYPED(OutlineView, AppEventListenerHdl, VclSimpleEvent&, void) { onUpdateStyleSettings(); - return 0; } IMPL_LINK_TYPED(OutlineView, EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, rEvent, void) |