diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-18 15:10:41 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-09-20 06:37:36 +0000 |
commit | 99bfc363a6f6779d0be2284f85a9131254bce1f9 (patch) | |
tree | 3da30adea892bae0f5e76031d8561e114c2da8d9 /framework | |
parent | e3c3b7fde3c017bd7d25f04fabf9b4528e37fb49 (diff) |
convert Link<> to typed
Change-Id: I10b050dc4aae45e646761a82520caa96969bc511
Reviewed-on: https://gerrit.libreoffice.org/18700
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/classes/fwktabwindow.hxx | 4 | ||||
-rw-r--r-- | framework/source/classes/fwktabwindow.cxx | 4 | ||||
-rw-r--r-- | framework/source/dispatch/windowcommanddispatch.cxx | 24 | ||||
-rw-r--r-- | framework/source/inc/dispatch/windowcommanddispatch.hxx | 3 | ||||
-rw-r--r-- | framework/source/services/tabwindowservice.cxx | 24 |
5 files changed, 24 insertions, 35 deletions
diff --git a/framework/inc/classes/fwktabwindow.hxx b/framework/inc/classes/fwktabwindow.hxx index 92976b8f304e..fc39ba208ae5 100644 --- a/framework/inc/classes/fwktabwindow.hxx +++ b/framework/inc/classes/fwktabwindow.hxx @@ -112,8 +112,8 @@ public: virtual ~FwkTabWindow(); virtual void dispose() SAL_OVERRIDE; - void AddEventListener( const Link<>& rEventListener ); - void RemoveEventListener( const Link<>& rEventListener ); + void AddEventListener( const Link<VclWindowEvent&,void>& rEventListener ); + void RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener ); FwkTabPage* AddTabPage( sal_Int32 nIndex, const css::uno::Sequence< css::beans::NamedValue >& rProperties ); void ActivatePage( sal_Int32 nIndex ); void RemovePage( sal_Int32 nIndex ); diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx index b74c8203371c..7ee33f26372d 100644 --- a/framework/source/classes/fwktabwindow.cxx +++ b/framework/source/classes/fwktabwindow.cxx @@ -283,12 +283,12 @@ IMPL_LINK_NOARG_TYPED(FwkTabWindow, DeactivatePageHdl, TabControl *, bool) return true; } -void FwkTabWindow::AddEventListener( const Link<>& rEventListener ) +void FwkTabWindow::AddEventListener( const Link<VclWindowEvent&,void>& rEventListener ) { m_aTabCtrl->AddEventListener( rEventListener ); } -void FwkTabWindow::RemoveEventListener( const Link<>& rEventListener ) +void FwkTabWindow::RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener ) { m_aTabCtrl->RemoveEventListener( rEventListener ); } diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx index dcdc4651c2d8..e3bd9bdf5aad 100644 --- a/framework/source/dispatch/windowcommanddispatch.cxx +++ b/framework/source/dispatch/windowcommanddispatch.cxx @@ -92,27 +92,23 @@ void WindowCommandDispatch::impl_stopListening() } } -IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, void*, pParam) +IMPL_LINK_TYPED(WindowCommandDispatch, impl_notifyCommand, VclWindowEvent&, rEvent, void) { - if ( ! pParam) - return 0L; - - const VclWindowEvent* pEvent = static_cast<VclWindowEvent*>(pParam); - if (pEvent->GetId() == VCLEVENT_OBJECT_DYING) + if (rEvent.GetId() == VCLEVENT_OBJECT_DYING) { impl_stopListening(); - return 0L; + return; } - if (pEvent->GetId() != VCLEVENT_WINDOW_COMMAND) - return 0L; + if (rEvent.GetId() != VCLEVENT_WINDOW_COMMAND) + return; - const CommandEvent* pCommand = static_cast<CommandEvent*>(pEvent->GetData()); + const CommandEvent* pCommand = static_cast<CommandEvent*>(rEvent.GetData()); if (pCommand->GetCommand() != CommandEventId::ShowDialog) - return 0L; + return; const CommandDialogData* pData = pCommand->GetDialogData(); if ( ! pData) - return 0L; + return; const ShowDialogId nCommand = pData->GetDialogId(); OUString sCommand; @@ -128,12 +124,10 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, void*, pParam) break; default : - return 0L; + return; } impl_dispatchCommand(sCommand); - - return 0L; } void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand) diff --git a/framework/source/inc/dispatch/windowcommanddispatch.hxx b/framework/source/inc/dispatch/windowcommanddispatch.hxx index 95c239d69374..f3f63928f208 100644 --- a/framework/source/inc/dispatch/windowcommanddispatch.hxx +++ b/framework/source/inc/dispatch/windowcommanddispatch.hxx @@ -31,6 +31,7 @@ namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } } +class VclWindowEvent; namespace framework{ @@ -101,7 +102,7 @@ class WindowCommandDispatch /** @short callback from VCL to notify new commands */ - DECL_LINK( impl_notifyCommand, void* ); + DECL_LINK_TYPED( impl_notifyCommand, VclWindowEvent&, void ); /** @short dispatch right command URLs into our frame context. diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx index 2f8bd08b631f..f15fc6b81ab3 100644 --- a/framework/source/services/tabwindowservice.cxx +++ b/framework/source/services/tabwindowservice.cxx @@ -147,7 +147,7 @@ private: virtual css::uno::Any SAL_CALL impl_getPropertyValue(const OUString& sProperty, sal_Int32 nHandle ) SAL_OVERRIDE; - DECL_DLLPRIVATE_LINK( EventListener, VclSimpleEvent * ); + DECL_DLLPRIVATE_LINK_TYPED( EventListener, VclWindowEvent&, void ); void impl_checkTabIndex (::sal_Int32 nID) throw (css::lang::IndexOutOfBoundsException); TTabPageInfoHash::iterator impl_getTabPageInfo(::sal_Int32 nID) throw (css::lang::IndexOutOfBoundsException); @@ -418,13 +418,9 @@ css::uno::Any SAL_CALL TabWindowService::impl_getPropertyValue(const OUString& / } // TabWindowService -IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) +IMPL_LINK_TYPED( TabWindowService, EventListener, VclWindowEvent&, rEvent, void ) { - if (!pEvent || !pEvent->ISA(VclWindowEvent)) - return 0; - - sal_uLong nEventId = pEvent->GetId(); - VclWindowEvent* pWinEvt = static_cast< VclWindowEvent* >(pEvent); + sal_uLong nEventId = rEvent.GetId(); css::uno::Reference< css::uno::XInterface > xThis ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); css::lang::EventObject aEvent( xThis ); @@ -437,12 +433,12 @@ IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) m_pTabWin = NULL; m_xTabWin.clear(); - return 0; + return; } ::cppu::OInterfaceContainerHelper* pContainer = m_lListener.getContainer(cppu::UnoType<css::awt::XTabListener>::get()); if ( ! pContainer) - return 0; + return; ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); while (pIterator.hasMoreElements()) @@ -454,19 +450,19 @@ IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) switch (nEventId) { case VCLEVENT_TABPAGE_ACTIVATE : - pListener->activated( (sal_Int32)reinterpret_cast<sal_uLong>(pWinEvt->GetData()) ); + pListener->activated( (sal_Int32)reinterpret_cast<sal_uLong>(rEvent.GetData()) ); break; case VCLEVENT_TABPAGE_DEACTIVATE : - pListener->deactivated( (sal_Int32)reinterpret_cast<sal_uLong>(pWinEvt->GetData()) ); + pListener->deactivated( (sal_Int32)reinterpret_cast<sal_uLong>(rEvent.GetData()) ); break; case VCLEVENT_TABPAGE_INSERTED : - pListener->inserted( (sal_Int32)reinterpret_cast<sal_uLong>(pWinEvt->GetData()) ); + pListener->inserted( (sal_Int32)reinterpret_cast<sal_uLong>(rEvent.GetData()) ); break; case VCLEVENT_TABPAGE_REMOVED : - pListener->removed( (sal_Int32)reinterpret_cast<sal_uLong>(pWinEvt->GetData()) ); + pListener->removed( (sal_Int32)reinterpret_cast<sal_uLong>(rEvent.GetData()) ); break; case VCLEVENT_TABPAGE_PAGETEXTCHANGED : @@ -479,8 +475,6 @@ IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) pIterator.remove(); } } - - return 0; } // TabWindowService |