From 03fdec57762b287cb8e0b6b446f5e7ba1b187f88 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 19 Nov 2013 17:24:36 +0100 Subject: winaccessibility: use WeakImplHelper Change-Id: I5872e520ca009a0f9277827d72e72befe3323a06 --- .../source/service/AccEventListener.cxx | 33 ++-------------------- .../source/service/AccTopWindowListener.cxx | 30 ++------------------ 2 files changed, 5 insertions(+), 58 deletions(-) (limited to 'winaccessibility/source') diff --git a/winaccessibility/source/service/AccEventListener.cxx b/winaccessibility/source/service/AccEventListener.cxx index df2a42c7967e..de4d7b4da951 100644 --- a/winaccessibility/source/service/AccEventListener.cxx +++ b/winaccessibility/source/service/AccEventListener.cxx @@ -47,10 +47,9 @@ using namespace cppu; AccEventListener::AccEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - :pAccessible(pAcc), - pAgent(Agent), - m_isDisposed(false), - m_refcount(0) + : pAccessible(pAcc) + , pAgent(Agent) + , m_isDisposed(false) {} AccEventListener::~AccEventListener() @@ -280,30 +279,4 @@ throw (::com::sun::star::uno::RuntimeException) removeMeFromBroadcaster(); } -//need to investigate further -::com::sun::star::uno::Any SAL_CALL AccEventListener::queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException) -{ - if(aType.equals(::getCppuType( (Reference< com::sun::star::accessibility::XAccessibleEventListener> const *)0 ) )) - { - Reference< com::sun::star::accessibility::XAccessibleEventListener> xEventListener( static_cast< com::sun::star::accessibility::XAccessibleEventListener* >(this)); - return makeAny(xEventListener); - } - - return Any(); -} - -void AccEventListener::acquire( ) throw () -{ - ::osl_incrementInterlockedCount( &m_refcount ); -} - -void AccEventListener::release() throw () -{ - // thread-safe decrementation of reference count - if (0 == ::osl_decrementInterlockedCount( &m_refcount )) - { - delete this; // shutdown this object - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx index 5c55cbd3b2a1..fac53d60362f 100644 --- a/winaccessibility/source/service/AccTopWindowListener.cxx +++ b/winaccessibility/source/service/AccTopWindowListener.cxx @@ -117,9 +117,8 @@ void AccTopWindowListener::handleWindowOpened( com::sun::star::accessibility::XA } } -AccTopWindowListener::AccTopWindowListener(): - accManagerAgent(), - m_refcount(1) +AccTopWindowListener::AccTopWindowListener() + : accManagerAgent() { } @@ -272,29 +271,4 @@ void AccTopWindowListener::disposing( const ::com::sun::star::lang::EventObject& { } -//need to investigate further -::com::sun::star::uno::Any SAL_CALL AccTopWindowListener::queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException) -{ - if (aType.equals( ::getCppuType( (Reference< com::sun::star::awt::XTopWindowListener> const *)0 ) )) - { - Reference< com::sun::star::awt::XTopWindowListener> xTopListener( static_cast< com::sun::star::awt::XTopWindowListener* >(this)); - return makeAny(xTopListener); - } - return Any(); -} - -void AccTopWindowListener::acquire( ) throw () -{ - ::osl_incrementInterlockedCount( &m_refcount ); -} - -void AccTopWindowListener::release() throw () -{ - // thread-safe decrementation of reference count - if (0 == ::osl_decrementInterlockedCount( &m_refcount )) - { - delete this; // shutdown this object - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3