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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/FocusManager.cxx | 25 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 15 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 14 |
3 files changed, 18 insertions, 36 deletions
diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index fbb326f05694..d36b7ac870ef 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -508,42 +508,33 @@ void FocusManager::HandleKeyEvent ( } } -IMPL_LINK(FocusManager, WindowEventListener, VclSimpleEvent*, pEvent) +IMPL_LINK_TYPED(FocusManager, WindowEventListener, VclWindowEvent&, rWindowEvent, void) { - if (pEvent == NULL) - return 0; - - if ( ! pEvent->ISA(VclWindowEvent)) - return 0; - - VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent); - vcl::Window* pSource = pWindowEvent->GetWindow(); + vcl::Window* pSource = rWindowEvent.GetWindow(); if (pSource == NULL) - return 0; + return; - switch (pWindowEvent->GetId()) + switch (rWindowEvent.GetId()) { case VCLEVENT_WINDOW_KEYINPUT: { - KeyEvent* pKeyEvent = static_cast<KeyEvent*>(pWindowEvent->GetData()); + KeyEvent* pKeyEvent = static_cast<KeyEvent*>(rWindowEvent.GetData()); HandleKeyEvent(pKeyEvent->GetKeyCode(), *pSource); - return 1; + break; } case VCLEVENT_OBJECT_DYING: RemoveWindow(*pSource); - return 1; + break; case VCLEVENT_WINDOW_GETFOCUS: case VCLEVENT_WINDOW_LOSEFOCUS: pSource->Invalidate(); - return 1; + break; default: break; } - - return 0; } IMPL_LINK(FocusManager, ChildEventListener, VclSimpleEvent*, pEvent) diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 08279d741c23..3d0f16fc55b2 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -820,14 +820,11 @@ Reference<ui::XUIElement> SidebarController::CreateUIElement ( } } -IMPL_LINK(SidebarController, WindowEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(SidebarController, WindowEventHandler, VclWindowEvent&, rEvent, void) { - if (pEvent==NULL) - return sal_IntPtr(false); - - if (pEvent->GetWindow() == mpParentWindow) + if (rEvent.GetWindow() == mpParentWindow) { - switch (pEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_WINDOW_SHOW: case VCLEVENT_WINDOW_RESIZE: @@ -857,9 +854,9 @@ IMPL_LINK(SidebarController, WindowEventHandler, VclWindowEvent*, pEvent) break; } } - else if (pEvent->GetWindow()==mpSplitWindow && mpSplitWindow!=nullptr) + else if (rEvent.GetWindow()==mpSplitWindow && mpSplitWindow!=nullptr) { - switch (pEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_WINDOW_MOUSEBUTTONDOWN: mnWidthOnSplitterButtonDown = mpParentWindow->GetSizePixel().Width(); @@ -877,8 +874,6 @@ IMPL_LINK(SidebarController, WindowEventHandler, VclWindowEvent*, pEvent) break; } } - - return sal_IntPtr(true); } void SidebarController::ShowPopupMenu ( diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 3ca799d8fb2d..e3940f16434b 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -193,25 +193,21 @@ struct SfxToolBoxControl_Impl sal_uInt16 nSlotId; VclPtr<SfxPopupWindow> mpFloatingWindow; VclPtr<SfxPopupWindow> mpPopupWindow; - DECL_LINK( WindowEventListener, VclSimpleEvent* ); + DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); }; -IMPL_LINK( SfxToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEvent ) +IMPL_LINK_TYPED( SfxToolBoxControl_Impl, WindowEventListener, VclWindowEvent&, rEvent, void ) { - if ( pEvent && - pEvent->ISA( VclWindowEvent ) && - (( pEvent->GetId() == VCLEVENT_WINDOW_MOVE ) || - ( pEvent->GetId() == VCLEVENT_WINDOW_ACTIVATE ))) + if ( ( rEvent.GetId() == VCLEVENT_WINDOW_MOVE ) || + ( rEvent.GetId() == VCLEVENT_WINDOW_ACTIVATE )) { - vcl::Window* pWindow( static_cast<VclWindowEvent*>(pEvent)->GetWindow() ); + vcl::Window* pWindow( rEvent.GetWindow() ); if (( pWindow == mpFloatingWindow ) && ( mpPopupWindow != nullptr )) { mpPopupWindow.disposeAndClear(); } } - - return 1; } |