summaryrefslogtreecommitdiff
path: root/winaccessibility/source/service
diff options
context:
space:
mode:
Diffstat (limited to 'winaccessibility/source/service')
-rw-r--r--winaccessibility/source/service/AccObjectManagerAgent.cxx22
-rw-r--r--winaccessibility/source/service/AccObjectWinManager.cxx33
-rw-r--r--winaccessibility/source/service/AccTopWindowListener.cxx6
-rw-r--r--winaccessibility/source/service/msaaservice_impl.cxx7
4 files changed, 25 insertions, 43 deletions
diff --git a/winaccessibility/source/service/AccObjectManagerAgent.cxx b/winaccessibility/source/service/AccObjectManagerAgent.cxx
index 1c7636076027..d4f4dab66e55 100644
--- a/winaccessibility/source/service/AccObjectManagerAgent.cxx
+++ b/winaccessibility/source/service/AccObjectManagerAgent.cxx
@@ -30,19 +30,13 @@ using namespace com::sun::star::accessibility;
* @param
* @return
*/
-AccObjectManagerAgent::AccObjectManagerAgent():
- pWinManager(NULL)
+AccObjectManagerAgent::AccObjectManagerAgent()
+ : pWinManager(new AccObjectWinManager(this))
{
- if( pWinManager == NULL )
- {
- pWinManager = AccObjectWinManager::CreateAccObjectWinManagerInstance(this);
- }
}
AccObjectManagerAgent::~AccObjectManagerAgent()
{
- delete pWinManager;
- pWinManager = NULL;
}
/**
@@ -388,4 +382,16 @@ bool AccObjectManagerAgent::IsStateManageDescendant(XAccessible* pXAcc)
return false;
}
+/**
+ * Implementation of interface XMSAAService's method getAccObjectPtr()
+ * that returns the corresponding COM interface with the MS event.
+ * @return Com interface.
+ */
+sal_Int64 AccObjectManagerAgent::Get_ToATInterface(
+ sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam)
+{
+ return static_cast<sal_Int64>(pWinManager->Get_ToATInterface(
+ static_cast<HWND>(reinterpret_cast<void*>(hWnd)), lParam, wParam));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx
index 4bcc8dfec140..8559e2b65782 100644
--- a/winaccessibility/source/service/AccObjectWinManager.cxx
+++ b/winaccessibility/source/service/AccObjectWinManager.cxx
@@ -53,23 +53,6 @@ using namespace com::sun::star::accessibility::AccessibleRole;
using namespace com::sun::star::accessibility::AccessibleStateType;
using namespace com::sun::star::uno;
-AccObjectWinManager* g_acc_manager = NULL;
-
-/**
- * Implementation of interface XMSAAService's method getAccObjectPtr() that return the
- * corresponding com interface with the MS event.
- *
- * @param
- * @return Com interface.
- */
-sal_Int64 GetMSComPtr(sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam)
-{
- if (!g_acc_manager)
- return 0;
- return static_cast<sal_Int64>(g_acc_manager->Get_ToATInterface(
- static_cast<HWND>(reinterpret_cast<void*>(hWnd)), lParam, wParam));
-}
-
/**
* constructor
* @param Agent The agent kept in all listeners,it's the sole interface by which
@@ -89,22 +72,6 @@ AccObjectWinManager::AccObjectWinManager( AccObjectManagerAgent* Agent ):
}
/**
- * Public method to produce manager
- * @param Agent The agent kept in all listeners,it's the sole interface by which
- * listener communicate with windows manager.
- * @return
- */
-AccObjectWinManager* AccObjectWinManager::CreateAccObjectWinManagerInstance( AccObjectManagerAgent* Agent )
-{
- if (!g_acc_manager)
- {
- g_acc_manager = new AccObjectWinManager( Agent );
- }
- return g_acc_manager;
-}
-
-
-/**
* Destructor,clear all resource.
* @param
* @return
diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx
index ca8a1c01b606..db87f23f0bf5 100644
--- a/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -255,4 +255,10 @@ void AccTopWindowListener::disposing( const ::com::sun::star::lang::EventObject&
{
}
+sal_Int64 AccTopWindowListener::GetMSComPtr(
+ sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam)
+{
+ return accManagerAgent.Get_ToATInterface(hWnd, lParam, wParam);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/winaccessibility/source/service/msaaservice_impl.cxx b/winaccessibility/source/service/msaaservice_impl.cxx
index e5e1231c0df3..c9ea14cfdbc0 100644
--- a/winaccessibility/source/service/msaaservice_impl.cxx
+++ b/winaccessibility/source/service/msaaservice_impl.cxx
@@ -41,7 +41,6 @@ using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::awt;
#include "AccTopWindowListener.hxx"
-#include "g_msacc.hxx"
namespace my_sc_impl
{
@@ -95,7 +94,11 @@ throw (RuntimeException)
{
SolarMutexGuard g;
- return GetMSComPtr( hWnd, lParam, wParam );
+ if (!m_pTopWindowListener.is())
+ {
+ return 0;
+ }
+ return m_pTopWindowListener->GetMSComPtr(hWnd, lParam, wParam);
}
/**