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 /accessibility/source | |
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 'accessibility/source')
6 files changed, 33 insertions, 61 deletions
diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx index 34d9e974e9d2..34b8362ebc4a 100644 --- a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx +++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx @@ -116,7 +116,7 @@ namespace accessibility virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ) SAL_OVERRIDE; virtual void Dying() SAL_OVERRIDE; - DECL_LINK( OnWindowEvent, const VclSimpleEvent* ); + DECL_LINK_TYPED( OnWindowEvent, VclWindowEvent&, void ); private: AccessibleToolPanelTabBar& m_rAntiImpl; @@ -228,30 +228,24 @@ namespace accessibility m_rAntiImpl.dispose(); } - IMPL_LINK( AccessibleToolPanelTabBar_Impl, OnWindowEvent, const VclSimpleEvent*, i_pEvent ) + IMPL_LINK_TYPED( AccessibleToolPanelTabBar_Impl, OnWindowEvent, VclWindowEvent&, rWindowEvent, void ) { - ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelTabBar_Impl::OnWindowEvent: already disposed!", 0L ); + ENSURE_OR_RETURN_VOID( !isDisposed(), "AccessibleToolPanelTabBar_Impl::OnWindowEvent: already disposed!" ); - const VclWindowEvent* pWindowEvent( dynamic_cast< const VclWindowEvent* >( i_pEvent ) ); - if ( !pWindowEvent ) - return 0L; + const bool bForwardButton = ( rWindowEvent.GetWindow() == &m_pTabBar->GetScrollButton( true ) ); + const bool bBackwardButton = ( rWindowEvent.GetWindow() == &m_pTabBar->GetScrollButton( false ) ); + ENSURE_OR_RETURN_VOID( bForwardButton || bBackwardButton, "AccessibleToolPanelTabBar_Impl::OnWindowEvent: where does this come from?" ); - const bool bForwardButton = ( pWindowEvent->GetWindow() == &m_pTabBar->GetScrollButton( true ) ); - const bool bBackwardButton = ( pWindowEvent->GetWindow() == &m_pTabBar->GetScrollButton( false ) ); - ENSURE_OR_RETURN( bForwardButton || bBackwardButton, "AccessibleToolPanelTabBar_Impl::OnWindowEvent: where does this come from?", 0L ); - - const bool bShow = ( i_pEvent->GetId() == VCLEVENT_WINDOW_SHOW ); - const bool bHide = ( i_pEvent->GetId() == VCLEVENT_WINDOW_HIDE ); + const bool bShow = ( rWindowEvent.GetId() == VCLEVENT_WINDOW_SHOW ); + const bool bHide = ( rWindowEvent.GetId() == VCLEVENT_WINDOW_HIDE ); if ( !bShow && !bHide ) // not interested in events other than visibility changes - return 0L; + return; const Reference< XAccessible > xButtonAccessible( m_pTabBar->GetScrollButton( bForwardButton ).GetAccessible() ); const Any aOldChild( bHide ? xButtonAccessible : Reference< XAccessible >() ); const Any aNewChild( bShow ? xButtonAccessible : Reference< XAccessible >() ); m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldChild, aNewChild ); - - return 1L; } // MethodGuard diff --git a/accessibility/source/extended/accessibletabbarbase.cxx b/accessibility/source/extended/accessibletabbarbase.cxx index 18c6ae50b1a3..a8a6c87439f7 100644 --- a/accessibility/source/extended/accessibletabbarbase.cxx +++ b/accessibility/source/extended/accessibletabbarbase.cxx @@ -43,26 +43,20 @@ AccessibleTabBarBase::~AccessibleTabBarBase() DELETEZ( m_pExternalLock ); } -IMPL_LINK( AccessibleTabBarBase, WindowEventListener, VclSimpleEvent*, pEvent ) +IMPL_LINK_TYPED( AccessibleTabBarBase, WindowEventListener, VclWindowEvent&, rEvent, void ) { - VclWindowEvent* pWinEvent = dynamic_cast< VclWindowEvent* >( pEvent ); - OSL_ENSURE( pWinEvent, "AccessibleTabBarBase::WindowEventListener - unknown window event" ); - if( pWinEvent ) + vcl::Window* pEventWindow = rEvent.GetWindow(); + OSL_ENSURE( pEventWindow, "AccessibleTabBarBase::WindowEventListener: no window!" ); + + if( ( rEvent.GetId() == VCLEVENT_TABBAR_PAGEREMOVED ) && + ( (sal_uInt16)reinterpret_cast<sal_IntPtr>(rEvent.GetData()) == TabBar::PAGE_NOT_FOUND ) && + ( dynamic_cast< AccessibleTabBarPageList *> (this) != NULL ) ) { - vcl::Window* pEventWindow = pWinEvent->GetWindow(); - OSL_ENSURE( pEventWindow, "AccessibleTabBarBase::WindowEventListener: no window!" ); - - if( ( pWinEvent->GetId() == VCLEVENT_TABBAR_PAGEREMOVED ) && - ( (sal_uInt16)reinterpret_cast<sal_IntPtr>(pWinEvent->GetData()) == TabBar::PAGE_NOT_FOUND ) && - ( dynamic_cast< AccessibleTabBarPageList *> (this) != NULL ) ) - { - return 0; - } - - if ( !pEventWindow->IsAccessibilityEventsSuppressed() || (pWinEvent->GetId() == VCLEVENT_OBJECT_DYING) ) - ProcessWindowEvent( *pWinEvent ); + return; } - return 0; + + if ( !pEventWindow->IsAccessibilityEventsSuppressed() || (rEvent.GetId() == VCLEVENT_OBJECT_DYING) ) + ProcessWindowEvent( rEvent ); } void AccessibleTabBarBase::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) diff --git a/accessibility/source/extended/accessibletablistboxtable.cxx b/accessibility/source/extended/accessibletablistboxtable.cxx index d233aa62429a..4dc268fbd8e8 100644 --- a/accessibility/source/extended/accessibletablistboxtable.cxx +++ b/accessibility/source/extended/accessibletablistboxtable.cxx @@ -251,15 +251,10 @@ namespace accessibility } } - IMPL_LINK( AccessibleTabListBoxTable, WindowEventListener, VclSimpleEvent*, pEvent ) + IMPL_LINK_TYPED( AccessibleTabListBoxTable, WindowEventListener, VclWindowEvent&, rEvent, void ) { - OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" ); - if ( pEvent && pEvent->ISA( VclWindowEvent ) ) - { - OSL_ENSURE( static_cast<VclWindowEvent*>( pEvent )->GetWindow() && m_pTabListBox, "no event window" ); - ProcessWindowEvent( *static_cast<VclWindowEvent*>(pEvent) ); - } - return 0; + OSL_ENSURE( rEvent.GetWindow() && m_pTabListBox, "no event window" ); + ProcessWindowEvent( rEvent ); } // helpers -------------------------------------------------------------------- diff --git a/accessibility/source/extended/listboxaccessible.cxx b/accessibility/source/extended/listboxaccessible.cxx index e7e428c376f3..fdc340ebcd00 100644 --- a/accessibility/source/extended/listboxaccessible.cxx +++ b/accessibility/source/extended/listboxaccessible.cxx @@ -41,17 +41,12 @@ namespace accessibility } } - IMPL_LINK( ListBoxAccessibleBase, WindowEventListener, VclSimpleEvent*, pEvent ) + IMPL_LINK_TYPED( ListBoxAccessibleBase, WindowEventListener, VclWindowEvent&, rEvent, void ) { - OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "ListBoxAccessibleBase::WindowEventListener: unexpected WindowEvent!" ); - if ( pEvent && pEvent->ISA( VclWindowEvent ) ) - { - OSL_ENSURE( static_cast< VclWindowEvent* >( pEvent )->GetWindow() , "ListBoxAccessibleBase::WindowEventListener: no event window!" ); - OSL_ENSURE( static_cast< VclWindowEvent* >( pEvent )->GetWindow() == m_pWindow, "ListBoxAccessibleBase::WindowEventListener: where did this come from?" ); + OSL_ENSURE( rEvent.GetWindow() , "ListBoxAccessibleBase::WindowEventListener: no event window!" ); + OSL_ENSURE( rEvent.GetWindow() == m_pWindow, "ListBoxAccessibleBase::WindowEventListener: where did this come from?" ); - ProcessWindowEvent( *static_cast< VclWindowEvent* >( pEvent ) ); - } - return 0; + ProcessWindowEvent( rEvent ); } void ListBoxAccessibleBase::disposing() diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 657b4fefcdd4..b78aa7e44a70 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1646,9 +1646,9 @@ void Document::Notify(::SfxBroadcaster &, ::SfxHint const & rHint) } } -IMPL_LINK(Document, WindowEventHandler, ::VclSimpleEvent *, pEvent) +IMPL_LINK_TYPED(Document, WindowEventHandler, ::VclWindowEvent&, rEvent, void) { - switch (pEvent->GetId()) + switch (rEvent.GetId()) { case VCLEVENT_WINDOW_RESIZE: { @@ -1750,7 +1750,6 @@ IMPL_LINK(Document, WindowEventHandler, ::VclSimpleEvent *, pEvent) break; } } - return 0; } void Document::init() diff --git a/accessibility/source/standard/vclxaccessiblemenubar.cxx b/accessibility/source/standard/vclxaccessiblemenubar.cxx index 3313f93bf616..36209fefa6b4 100644 --- a/accessibility/source/standard/vclxaccessiblemenubar.cxx +++ b/accessibility/source/standard/vclxaccessiblemenubar.cxx @@ -73,18 +73,13 @@ bool VCLXAccessibleMenuBar::IsFocused() -IMPL_LINK( VCLXAccessibleMenuBar, WindowEventListener, VclSimpleEvent*, pEvent ) +IMPL_LINK_TYPED( VCLXAccessibleMenuBar, WindowEventListener, VclWindowEvent&, rEvent, void ) { - OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "VCLXAccessibleMenuBar::WindowEventListener: unknown window event!" ); - if ( pEvent && pEvent->ISA( VclWindowEvent ) ) + OSL_ENSURE( rEvent.GetWindow(), "VCLXAccessibleMenuBar::WindowEventListener: no window!" ); + if ( !rEvent.GetWindow()->IsAccessibilityEventsSuppressed() || ( rEvent.GetId() == VCLEVENT_OBJECT_DYING ) ) { - OSL_ENSURE( static_cast<VclWindowEvent*>(pEvent)->GetWindow(), "VCLXAccessibleMenuBar::WindowEventListener: no window!" ); - if ( !static_cast<VclWindowEvent*>(pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) ) - { - ProcessWindowEvent( *static_cast<VclWindowEvent*>(pEvent) ); - } + ProcessWindowEvent( rEvent ); } - return 0; } |