summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winaccessibility/inc/AccEventListener.hxx15
-rw-r--r--winaccessibility/inc/AccTopWindowListener.hxx13
-rw-r--r--winaccessibility/source/service/AccEventListener.cxx33
-rw-r--r--winaccessibility/source/service/AccTopWindowListener.cxx30
4 files changed, 15 insertions, 76 deletions
diff --git a/winaccessibility/inc/AccEventListener.hxx b/winaccessibility/inc/AccEventListener.hxx
index 5978dddddd43..263e525b9137 100644
--- a/winaccessibility/inc/AccEventListener.hxx
+++ b/winaccessibility/inc/AccEventListener.hxx
@@ -22,7 +22,9 @@
#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
-#include <cppuhelper/weak.hxx>
+
+#include <cppuhelper/implbase1.hxx>
+
#include <osl/mutex.hxx>
class AccObjectManagerAgent;
@@ -32,12 +34,10 @@ using namespace ::com::sun::star::uno;
* procedure of all the event handling and provides the basic support for some simple
* methods.
*/
-class AccEventListener:
- public com::sun::star::accessibility::XAccessibleEventListener,
- public ::cppu::OWeakObject
+class AccEventListener
+ : public ::cppu::WeakImplHelper1<
+ com::sun::star::accessibility::XAccessibleEventListener>
{
-private:
- oslInterlockedCount m_refcount;
protected:
//accessible owner's pointer
com::sun::star::accessibility::XAccessible* pAccessible;
@@ -74,9 +74,6 @@ public:
//for interface
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
//get the accessible role of pAccessible
virtual short SAL_CALL getRole();
//get the accessible parent's role
diff --git a/winaccessibility/inc/AccTopWindowListener.hxx b/winaccessibility/inc/AccTopWindowListener.hxx
index 11a6d18be15c..edf83b3b4148 100644
--- a/winaccessibility/inc/AccTopWindowListener.hxx
+++ b/winaccessibility/inc/AccTopWindowListener.hxx
@@ -23,7 +23,8 @@
#include <com/sun/star/awt/XTopWindowListener.hpp>
#include <com/sun/star/awt/XExtendedToolkit.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
-#include <cppuhelper/weak.hxx>
+
+#include <cppuhelper/implbase1.hxx>
#include "AccObjectManagerAgent.hxx"
@@ -34,14 +35,11 @@
* In this method, all the accessible objects (including COM object and Uno objects) are created and
* cached into bridge managers, and they are monitored by listeners for later accessible evnet handling.
*/
-class AccTopWindowListener:
- public com::sun::star::awt::XTopWindowListener,
- public ::cppu::OWeakObject
-
+class AccTopWindowListener
+ : public ::cppu::WeakImplHelper1<com::sun::star::awt::XTopWindowListener>
{
private:
AccObjectManagerAgent accManagerAgent;
- oslInterlockedCount m_refcount;
public:
AccTopWindowListener();
virtual ~AccTopWindowListener();
@@ -53,9 +51,6 @@ public:
virtual void SAL_CALL windowActivated( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL windowDeactivated( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire( ) throw ();
- virtual void SAL_CALL release( ) throw ();
virtual void AddAllListeners(com::sun::star::accessibility::XAccessible* pAccessible,com::sun::star::accessibility::XAccessible* pParentXAcc,HWND pWND );
//for On-Demand load.
virtual void handleWindowOpened( com::sun::star::accessibility::XAccessible* pAccessible );
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: */