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 /sd | |
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 'sd')
-rw-r--r-- | sd/source/ui/accessibility/AccessibleSlideSorterView.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationtag.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationtag.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/framework/factories/FullScreenPane.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/framework/factories/FullScreenPane.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/FormShellManager.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/sidebar/LayoutMenu.cxx | 24 | ||||
-rw-r--r-- | sd/source/ui/sidebar/LayoutMenu.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/showwin.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/slideshow/showwindow.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 17 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/shell/SlideSorter.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/FormShellManager.cxx | 57 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellManager.cxx | 13 |
15 files changed, 70 insertions, 91 deletions
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index d8dc832fe1d5..b8bf84ff9856 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -80,7 +80,7 @@ public: void ConnectListeners(); void ReleaseListeners(); void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE; - DECL_LINK(WindowEventListener, VclWindowEvent*); + DECL_LINK_TYPED(WindowEventListener, VclWindowEvent&, void); DECL_LINK(SelectionChangeListener, void*); DECL_LINK_TYPED(BroadcastSelectionChange, void*, void); DECL_LINK_TYPED(FocusChangeListener, LinkParamNone*, void); @@ -898,9 +898,9 @@ void AccessibleSlideSorterView::Implementation::Activated() } -IMPL_LINK(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWindowEvent&, rEvent, void) { - switch (pEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_WINDOW_MOVE: case VCLEVENT_WINDOW_RESIZE: @@ -917,7 +917,6 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWin default: break; } - return 1; } IMPL_LINK_NOARG(AccessibleSlideSorterView::Implementation, SelectionChangeListener) diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 10c9274ecbbc..4d1e78860867 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -608,17 +608,15 @@ void AnnotationTag::ClosePopup() } } -IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(AnnotationTag, WindowEventHandler, VclWindowEvent&, rEvent, void) { - if( pEvent != NULL ) - { - vcl::Window* pWindow = pEvent->GetWindow(); + vcl::Window* pWindow = rEvent.GetWindow(); if( pWindow ) { if( pWindow == mpAnnotationWindow.get() ) { - if( pEvent->GetId() == VCLEVENT_WINDOW_DEACTIVATE ) + if( rEvent.GetId() == VCLEVENT_WINDOW_DEACTIVATE ) { if( mnClosePopupEvent ) Application::RemoveUserEvent( mnClosePopupEvent ); @@ -628,7 +626,7 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent*, pEvent) } else if( pWindow == mpListenWindow ) { - switch( pEvent->GetId() ) + switch( rEvent.GetId() ) { case VCLEVENT_WINDOW_MOUSEBUTTONUP: { @@ -664,8 +662,6 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent*, pEvent) } } } - } - return sal_IntPtr(true); } IMPL_LINK_NOARG_TYPED(AnnotationTag, ClosePopupHdl, void*, void) diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx index 043708b40262..024555b7b6c1 100644 --- a/sd/source/ui/annotations/annotationtag.hxx +++ b/sd/source/ui/annotations/annotationtag.hxx @@ -73,7 +73,7 @@ protected: virtual void select() SAL_OVERRIDE; virtual void deselect() SAL_OVERRIDE; - DECL_LINK( WindowEventHandler, VclWindowEvent* ); + DECL_LINK_TYPED( WindowEventHandler, VclWindowEvent&, void ); DECL_LINK_TYPED( ClosePopupHdl, void*, void ); private: diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx index 731de222bc6b..aa05a311e6b5 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.cxx +++ b/sd/source/ui/framework/factories/FullScreenPane.cxx @@ -71,7 +71,7 @@ FullScreenPane::FullScreenPane ( // afterwards may or may not work. // Add resize listener at the work window. - Link<> aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler)); + Link<VclWindowEvent&,void> aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler)); mpWorkWindow->AddEventListener(aWindowEventHandler); // Set title and icon of the new window to those of the current window @@ -107,7 +107,7 @@ void SAL_CALL FullScreenPane::disposing() if (mpWorkWindow.get() != NULL) { - Link<> aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler)); + Link<VclWindowEvent&,void> aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler)); mpWorkWindow->RemoveEventListener(aWindowEventHandler); mpWorkWindow.disposeAndClear(); } @@ -173,9 +173,9 @@ void SAL_CALL FullScreenPane::setAccessible ( } } -IMPL_LINK(FullScreenPane, WindowEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(FullScreenPane, WindowEventHandler, VclWindowEvent&, rEvent, void) { - switch (pEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_WINDOW_RESIZE: GetWindow()->SetPosPixel(Point(0,0)); @@ -188,7 +188,6 @@ IMPL_LINK(FullScreenPane, WindowEventHandler, VclWindowEvent*, pEvent) mpWorkWindow.disposeAndClear(); break; } - return 1; } Reference<rendering::XCanvas> FullScreenPane::CreateCanvas() diff --git a/sd/source/ui/framework/factories/FullScreenPane.hxx b/sd/source/ui/framework/factories/FullScreenPane.hxx index f2a963128a83..02d16705e47b 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.hxx +++ b/sd/source/ui/framework/factories/FullScreenPane.hxx @@ -71,7 +71,7 @@ public: const css::uno::Reference<css::accessibility::XAccessible>& rxAccessible) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; - DECL_LINK(WindowEventHandler, VclWindowEvent*); + DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); protected: virtual ::com::sun::star::uno::Reference<com::sun::star::rendering::XCanvas> diff --git a/sd/source/ui/inc/FormShellManager.hxx b/sd/source/ui/inc/FormShellManager.hxx index f8870c7d046e..a97d16166d93 100644 --- a/sd/source/ui/inc/FormShellManager.hxx +++ b/sd/source/ui/inc/FormShellManager.hxx @@ -108,7 +108,7 @@ private: when the window gets the focus. In this case the form shell is moved to the bottom of the shell stack. */ - DECL_LINK(WindowEventHandler, VclWindowEvent*); + DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); /** This call back is called when view in the center pane is replaced. When this happens then we unregister at the window of the old and diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 38e9fea125e7..67861e79bceb 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -188,7 +188,7 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell ) ".uno:VerticalTextState"); SetSizePixel(GetParent()->GetSizePixel()); - Link<> aWindowEventHandlerLink (LINK(this,LayoutMenu,WindowEventHandler)); + Link<VclWindowEvent&,void> aWindowEventHandlerLink (LINK(this,LayoutMenu,WindowEventHandler)); GetParent()->AddEventListener(aWindowEventHandlerLink); } @@ -221,7 +221,7 @@ void LayoutMenu::Dispose() Link<tools::EventMultiplexerEvent&,void> aLink (LINK(this,LayoutMenu,EventMultiplexerListener)); mrBase.GetEventMultiplexer()->RemoveEventListener (aLink); - Link<> aWindowEventHandlerLink (LINK(this,LayoutMenu,WindowEventHandler)); + Link<VclWindowEvent&,void> aWindowEventHandlerLink (LINK(this,LayoutMenu,WindowEventHandler)); GetParent()->RemoveEventListener(aWindowEventHandlerLink); } @@ -736,23 +736,17 @@ IMPL_LINK_TYPED(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiple } } -IMPL_LINK(LayoutMenu, WindowEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(LayoutMenu, WindowEventHandler, VclWindowEvent&, rEvent, void) { - if (pEvent != NULL) + switch (rEvent.GetId()) { - switch (pEvent->GetId()) - { - case VCLEVENT_WINDOW_SHOW: - case VCLEVENT_WINDOW_RESIZE: - SetSizePixel(GetParent()->GetSizePixel()); - return sal_IntPtr(true); + case VCLEVENT_WINDOW_SHOW: + case VCLEVENT_WINDOW_RESIZE: + SetSizePixel(GetParent()->GetSizePixel()); + break; - default: - return sal_IntPtr(false); - } + default: break; } - - return sal_IntPtr(false); } void LayoutMenu::DataChanged (const DataChangedEvent& rEvent) diff --git a/sd/source/ui/sidebar/LayoutMenu.hxx b/sd/source/ui/sidebar/LayoutMenu.hxx index adef23a61229..0969de6c525f 100644 --- a/sd/source/ui/sidebar/LayoutMenu.hxx +++ b/sd/source/ui/sidebar/LayoutMenu.hxx @@ -192,7 +192,7 @@ private: DECL_LINK_TYPED(RightClickHandler, const MouseEvent&, void); DECL_LINK_TYPED(StateChangeHandler, const OUString&, void); DECL_LINK_TYPED(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, void); - DECL_LINK(WindowEventHandler, VclWindowEvent*); + DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); DECL_LINK_TYPED(OnMenuItemSelected, Menu*, bool); }; diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index 6bac4037cd7a..2854779ac0d6 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -583,17 +583,16 @@ IMPL_LINK_NOARG_TYPED(ShowWindow, MouseTimeoutHdl, Timer *, void) } } -IMPL_LINK( ShowWindow, EventHdl, VclWindowEvent*, pEvent ) +IMPL_LINK_TYPED( ShowWindow, EventHdl, VclWindowEvent&, rEvent, void ) { if( mbMouseAutoHide ) { - if (pEvent->GetId() == VCLEVENT_WINDOW_SHOW) + if (rEvent.GetId() == VCLEVENT_WINDOW_SHOW) { maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT ); maMouseTimer.Start(); } } - return 0L; } void ShowWindow::SetPresentationArea( const Rectangle& rPresArea ) diff --git a/sd/source/ui/slideshow/showwindow.hxx b/sd/source/ui/slideshow/showwindow.hxx index ab7aac7e0f9c..6a39b2ec8ca6 100644 --- a/sd/source/ui/slideshow/showwindow.hxx +++ b/sd/source/ui/slideshow/showwindow.hxx @@ -109,7 +109,7 @@ private: DECL_LINK_TYPED( PauseTimeoutHdl, Timer*, void ); DECL_LINK_TYPED(MouseTimeoutHdl, Timer *, void); - DECL_LINK( EventHdl, VclWindowEvent* ); + DECL_LINK_TYPED( EventHdl, VclWindowEvent&, void ); ::rtl::Reference< SlideshowImpl > mxController; }; diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 1aaae267a10a..3b342467b363 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -540,13 +540,17 @@ void SlideSorterController::HandleModelChange() } } -IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK(SlideSorterController, ApplicationEventHandler, VclWindowEvent*, pEvent) { - if (pEvent != NULL) - { - vcl::Window* pWindow = pEvent->GetWindow(); + if (pEvent) + WindowEventHandler(*pEvent); + return 1; +} +IMPL_LINK_TYPED(SlideSorterController, WindowEventHandler, VclWindowEvent&, rEvent, void) +{ + vcl::Window* pWindow = rEvent.GetWindow(); sd::Window *pActiveWindow (mrSlideSorter.GetContentWindow()); - switch (pEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_WINDOW_ACTIVATE: case VCLEVENT_WINDOW_SHOW: @@ -606,9 +610,6 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent) default: break; } - } - - return sal_IntPtr(true); } void SlideSorterController::GetCtrlState (SfxItemSet& rSet) diff --git a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx index 8d1d378991c1..e47ed18795d8 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx @@ -160,7 +160,8 @@ public: */ void HandleModelChange(); - DECL_LINK(WindowEventHandler, VclWindowEvent*); + DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); + DECL_LINK(ApplicationEventHandler, VclWindowEvent*); /** Update the display of all pages. This involves a redraw and releasing previews and caches. diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx index fd45631f4a08..91db811d6baf 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx @@ -271,7 +271,7 @@ void SlideSorter::SetupListeners() LINK( mpSlideSorterController.get(), controller::SlideSorterController, - WindowEventHandler)); + ApplicationEventHandler)); mpSlideSorterController->GetScrollBarManager().Connect(); } @@ -298,7 +298,7 @@ void SlideSorter::ReleaseListeners() Application::RemoveEventListener( LINK(mpSlideSorterController.get(), controller::SlideSorterController, - WindowEventHandler)); + ApplicationEventHandler)); } void SlideSorter::CreateModelViewController() diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 02ffc9f91ece..44ecdfec1417 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -223,45 +223,40 @@ IMPL_LINK_TYPED(FormShellManager, ConfigurationUpdateHandler, sd::tools::EventMu } } -IMPL_LINK(FormShellManager, WindowEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(FormShellManager, WindowEventHandler, VclWindowEvent&, rEvent, void) { - if (pEvent != NULL) + switch (rEvent.GetId()) { - switch (pEvent->GetId()) + case VCLEVENT_WINDOW_GETFOCUS: { - case VCLEVENT_WINDOW_GETFOCUS: + // The window of the center pane got the focus. Therefore + // the form shell is moved to the bottom of the object bar + // stack. + ViewShell* pShell = mrBase.GetMainViewShell().get(); + if (pShell!=NULL && mbFormShellAboveViewShell) { - // The window of the center pane got the focus. Therefore - // the form shell is moved to the bottom of the object bar - // stack. - ViewShell* pShell = mrBase.GetMainViewShell().get(); - if (pShell!=NULL && mbFormShellAboveViewShell) - { - mbFormShellAboveViewShell = false; - ViewShellManager::UpdateLock aLock (mrBase.GetViewShellManager()); - mrBase.GetViewShellManager()->SetFormShell( - pShell, - mpFormShell, - mbFormShellAboveViewShell); - } + mbFormShellAboveViewShell = false; + ViewShellManager::UpdateLock aLock (mrBase.GetViewShellManager()); + mrBase.GetViewShellManager()->SetFormShell( + pShell, + mpFormShell, + mbFormShellAboveViewShell); } + } + break; + + case VCLEVENT_WINDOW_LOSEFOCUS: + // We follow the sloppy focus policy. Losing the focus is + // ignored. We wait for the focus to be placed either in + // the window or the form shell. The later, however, is + // notified over the FormControlActivated handler, not this + // one. break; - case VCLEVENT_WINDOW_LOSEFOCUS: - // We follow the sloppy focus policy. Losing the focus is - // ignored. We wait for the focus to be placed either in - // the window or the form shell. The later, however, is - // notified over the FormControlActivated handler, not this - // one. - break; - - case VCLEVENT_OBJECT_DYING: - mpMainViewShellWindow = NULL; - break; - } + case VCLEVENT_OBJECT_DYING: + mpMainViewShellWindow = NULL; + break; } - - return 0; } void FormShellManager::Notify(SfxBroadcaster&, const SfxHint& rHint) diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 72b10b33979a..5c015b3abe7b 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -204,7 +204,7 @@ private: */ void CreateTargetStack (ShellStack& rStack) const; - DECL_LINK(WindowEventHandler, VclWindowEvent*); + DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); #if OSL_DEBUG_LEVEL >= 2 void DumpShellStack (const ShellStack& rStack); @@ -984,14 +984,11 @@ void ViewShellManager::Implementation::CreateTargetStack (ShellStack& rStack) co } } -IMPL_LINK(ViewShellManager::Implementation, WindowEventHandler, VclWindowEvent*, pEvent) +IMPL_LINK_TYPED(ViewShellManager::Implementation, WindowEventHandler, VclWindowEvent&, rEvent, void) { - if (pEvent != NULL) - { - vcl::Window* pEventWindow - = static_cast<VclWindowEvent*>(pEvent)->GetWindow(); + vcl::Window* pEventWindow = rEvent.GetWindow(); - switch (pEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_WINDOW_GETFOCUS: { @@ -1028,8 +1025,6 @@ IMPL_LINK(ViewShellManager::Implementation, WindowEventHandler, VclWindowEvent*, } break; } - } - return sal_IntPtr(true); } ShellDescriptor ViewShellManager::Implementation::CreateSubShell ( |