summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-09-18 15:10:41 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-09-20 06:37:36 +0000
commit99bfc363a6f6779d0be2284f85a9131254bce1f9 (patch)
tree3da30adea892bae0f5e76031d8561e114c2da8d9 /accessibility
parente3c3b7fde3c017bd7d25f04fabf9b4528e37fb49 (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')
-rw-r--r--accessibility/inc/accessibility/extended/accessibletabbarbase.hxx2
-rw-r--r--accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx2
-rw-r--r--accessibility/inc/accessibility/extended/listboxaccessible.hxx2
-rw-r--r--accessibility/inc/accessibility/extended/textwindowaccessibility.hxx6
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx2
-rw-r--r--accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx24
-rw-r--r--accessibility/source/extended/accessibletabbarbase.cxx28
-rw-r--r--accessibility/source/extended/accessibletablistboxtable.cxx11
-rw-r--r--accessibility/source/extended/listboxaccessible.cxx13
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx5
-rw-r--r--accessibility/source/standard/vclxaccessiblemenubar.cxx13
11 files changed, 40 insertions, 68 deletions
diff --git a/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx b/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx
index ed920c89399d..d6603ed3104c 100644
--- a/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx
+++ b/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx
@@ -45,7 +45,7 @@ public:
virtual ~AccessibleTabBarBase();
protected:
- DECL_LINK( WindowEventListener, VclSimpleEvent* );
+ DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void );
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
diff --git a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx b/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
index 1db873c065ac..53659aeaed7a 100644
--- a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
+++ b/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
@@ -42,7 +42,7 @@ private:
css::uno::Reference< css::accessibility::XAccessible > m_xCurChild;
void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
- DECL_LINK( WindowEventListener, VclSimpleEvent* );
+ DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void );
// helpers ----------------------------------------------------------------
diff --git a/accessibility/inc/accessibility/extended/listboxaccessible.hxx b/accessibility/inc/accessibility/extended/listboxaccessible.hxx
index bd0b260c31fc..7affba94cc28 100644
--- a/accessibility/inc/accessibility/extended/listboxaccessible.hxx
+++ b/accessibility/inc/accessibility/extended/listboxaccessible.hxx
@@ -68,7 +68,7 @@ namespace accessibility
void disposing();
private:
- DECL_LINK( WindowEventListener, VclSimpleEvent* );
+ DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void );
private:
ListBoxAccessibleBase( const ListBoxAccessibleBase& ) SAL_DELETED_FUNCTION;
diff --git a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
index 786e2c3e8d51..d777ec0cdabf 100644
--- a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
+++ b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
@@ -86,7 +86,7 @@ private:
class WindowListenerGuard
{
public:
- inline WindowListenerGuard(::Link<> const & rListener):
+ inline WindowListenerGuard(::Link<VclWindowEvent&,void> const & rListener):
m_aListener(rListener), m_pNotifier(0) {}
inline ~WindowListenerGuard() { endListening(); }
@@ -98,7 +98,7 @@ public:
void endListening();
private:
- ::Link<> m_aListener;
+ ::Link<VclWindowEvent&,void> m_aListener;
VclPtr<vcl::Window> m_pNotifier;
};
@@ -580,7 +580,7 @@ private:
// Assuming that this will only be called with the external (Solar) mutex
// locked.
// init will already have been called.
- DECL_LINK(WindowEventHandler, VclSimpleEvent *);
+ DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void);
// Must be called with both the external (Solar) and internal mutex
// locked.
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx
index 2d47a064a981..3d4ce1edbc56 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx
@@ -39,7 +39,7 @@ protected:
virtual bool IsFocused() SAL_OVERRIDE;
- DECL_LINK( WindowEventListener, VclSimpleEvent* );
+ DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void );
void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
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;
}