summaryrefslogtreecommitdiff
path: root/winaccessibility
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-11 21:40:51 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-12 20:06:26 +0100
commitd28687d5171784e1ec23d4cf13d7b3c56cc52782 (patch)
treecfe0a8c86a0eb7de9273f9a0f8a1e1df10adb0ea /winaccessibility
parentf5a54cbf120efb335205e00ba18a9038449b92c9 (diff)
winaccessibility: fix locking in UAccCOM
The COM components will (usually? always?) be called on the main thread via COM, and may also be called on any thread from the UNO event listeners. Both ways may access the global AccWinObjectManager. So the easiest way to lock all that without introducing new deadlocks seems to be to just use the SolarMutex. The fact that the main thread is in a COM STA is rather irrelevant here since we don't currently do the required manual marshalling of the COM pointers so they can be accessed from UNO event listeners running in threads other than the main thread anyway. To get that to build: - use prewin.h and postwin.h around ATL headers - link UAccCOM against vcl - define both UNICODE and _UNICODE to not break on mis-matching TCHAR nonsense Change-Id: I1ccdf7a4a5c2b5f0b9c29ef39d126c4b8a16898a
Diffstat (limited to 'winaccessibility')
-rw-r--r--winaccessibility/Library_uacccom.mk4
-rw-r--r--winaccessibility/source/UAccCOM/AccActionBase.cxx12
-rw-r--r--winaccessibility/source/UAccCOM/AccComponentBase.cxx13
-rw-r--r--winaccessibility/source/UAccCOM/AccEditableText.cxx19
-rw-r--r--winaccessibility/source/UAccCOM/AccHyperLink.cxx17
-rw-r--r--winaccessibility/source/UAccCOM/AccHypertext.cxx10
-rw-r--r--winaccessibility/source/UAccCOM/AccImage.cxx7
-rw-r--r--winaccessibility/source/UAccCOM/AccRelation.cxx12
-rw-r--r--winaccessibility/source/UAccCOM/AccTable.cxx57
-rw-r--r--winaccessibility/source/UAccCOM/AccTextBase.cxx39
-rw-r--r--winaccessibility/source/UAccCOM/AccValue.cxx13
-rw-r--r--winaccessibility/source/UAccCOM/EnumVariant.cxx15
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx97
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.h1
-rw-r--r--winaccessibility/source/UAccCOM/stdafx.h9
15 files changed, 310 insertions, 15 deletions
diff --git a/winaccessibility/Library_uacccom.mk b/winaccessibility/Library_uacccom.mk
index 750d41cfaf8f..b7760a7ac091 100644
--- a/winaccessibility/Library_uacccom.mk
+++ b/winaccessibility/Library_uacccom.mk
@@ -21,7 +21,8 @@ $(eval $(call gb_Library_set_include,UAccCOM,\
$(eval $(call gb_Library_add_defs,UAccCOM,\
-DUACCCOM_DLLIMPLEMENTATION \
- -D_UNICODE=1 \
+ -D_UNICODE \
+ -DUNICODE \
))
$(eval $(call gb_Library_use_sdk_api,UAccCOM))
@@ -54,6 +55,7 @@ $(eval $(call gb_Library_add_ldflags,UAccCOM,\
))
$(eval $(call gb_Library_use_libraries,UAccCOM,\
+ vcl \
cppu \
sal \
))
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx
index 189f3b62d0be..c9652253c275 100644
--- a/winaccessibility/source/UAccCOM/AccActionBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx
@@ -28,6 +28,8 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <vcl/svapp.hxx>
+
#include "AccessibleKeyStroke.h"
#ifndef __ACCCOMMON_H_
@@ -107,6 +109,8 @@ void GetDfActionByUNORole(XAccessibleContext* pRContext, BSTR* pRet)
*/
STDMETHODIMP CAccActionBase::nActions(/*[out,retval]*/long* nActions)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -129,6 +133,8 @@ STDMETHODIMP CAccActionBase::nActions(/*[out,retval]*/long* nActions)
*/
STDMETHODIMP CAccActionBase::doAction(/* [in] */ long actionIndex)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if( pRXAct.is() )
@@ -148,6 +154,8 @@ STDMETHODIMP CAccActionBase::doAction(/* [in] */ long actionIndex)
*/
STDMETHODIMP CAccActionBase::get_description(long actionIndex,BSTR __RPC_FAR *description)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -195,6 +203,8 @@ STDMETHODIMP CAccActionBase::get_keyBinding(
/* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
/* [retval][out] */ long __RPC_FAR *nBinding)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if( !keyBinding || !nBinding)
@@ -238,7 +248,7 @@ STDMETHODIMP CAccActionBase::get_keyBinding(
*/
STDMETHODIMP CAccActionBase::put_XInterface(hyper pXInterface)
{
-
+ // internal IUNOXWrapper - no mutex meeded
ENTER_PROTECTED_BLOCK
diff --git a/winaccessibility/source/UAccCOM/AccComponentBase.cxx b/winaccessibility/source/UAccCOM/AccComponentBase.cxx
index 92efe7f22e52..cc6cf468f064 100644
--- a/winaccessibility/source/UAccCOM/AccComponentBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccComponentBase.cxx
@@ -21,6 +21,7 @@
#include "AccComponentBase.h"
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <vcl/svapp.hxx>
#include "MAccessible.h"
using namespace com::sun::star::accessibility;
@@ -45,6 +46,8 @@ CAccComponentBase::~CAccComponentBase()
*/
STDMETHODIMP CAccComponentBase::get_locationInParent(long *x, long *y)
{
+ SolarMutexGuard g;
+
try
{
if (x == NULL || y == NULL)
@@ -73,6 +76,8 @@ STDMETHODIMP CAccComponentBase::get_locationInParent(long *x, long *y)
*/
STDMETHODIMP CAccComponentBase::get_locationOnScreen(long *x, long *y)
{
+ SolarMutexGuard g;
+
try
{
if (x == NULL || y == NULL)
@@ -100,6 +105,8 @@ STDMETHODIMP CAccComponentBase::get_locationOnScreen(long *x, long *y)
*/
STDMETHODIMP CAccComponentBase::grabFocus(boolean * success)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (success == NULL)
@@ -124,6 +131,8 @@ STDMETHODIMP CAccComponentBase::grabFocus(boolean * success)
*/
STDMETHODIMP CAccComponentBase::get_foreground(IA2Color * foreground)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (foreground == NULL)
@@ -147,6 +156,8 @@ STDMETHODIMP CAccComponentBase::get_foreground(IA2Color * foreground)
*/
STDMETHODIMP CAccComponentBase::get_background(IA2Color * background)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (background == NULL)
@@ -170,6 +181,8 @@ STDMETHODIMP CAccComponentBase::get_background(IA2Color * background)
*/
STDMETHODIMP CAccComponentBase::put_XInterface(hyper pXInterface)
{
+ // internal IUNOXWrapper - no mutex meeded
+
ENTER_PROTECTED_BLOCK
CUNOXWrapper::put_XInterface(pXInterface);
diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx
index f4de426d4382..079ac538951c 100644
--- a/winaccessibility/source/UAccCOM/AccEditableText.cxx
+++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx
@@ -23,6 +23,9 @@
#include "stdafx.h"
#include "UAccCOM.h"
#include "AccEditableText.h"
+
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleText.hpp>
@@ -47,6 +50,8 @@ using namespace std;
*/
STDMETHODIMP CAccEditableText::copyText(long startOffset, long endOffset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK XInterface#
@@ -72,6 +77,8 @@ STDMETHODIMP CAccEditableText::copyText(long startOffset, long endOffset)
*/
STDMETHODIMP CAccEditableText::deleteText(long startOffset, long endOffset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if( !pRXEdtTxt.is() )
@@ -94,6 +101,8 @@ STDMETHODIMP CAccEditableText::deleteText(long startOffset, long endOffset)
*/
STDMETHODIMP CAccEditableText::insertText(long offset, BSTR * text)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (text == NULL)
@@ -121,6 +130,8 @@ STDMETHODIMP CAccEditableText::insertText(long offset, BSTR * text)
*/
STDMETHODIMP CAccEditableText::cutText(long startOffset, long endOffset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if( !pRXEdtTxt.is() )
@@ -142,6 +153,8 @@ STDMETHODIMP CAccEditableText::cutText(long startOffset, long endOffset)
*/
STDMETHODIMP CAccEditableText::pasteText(long offset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if( !pRXEdtTxt.is() )
@@ -165,6 +178,8 @@ STDMETHODIMP CAccEditableText::pasteText(long offset)
*/
STDMETHODIMP CAccEditableText::replaceText(long startOffset, long endOffset, BSTR * text)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -192,6 +207,8 @@ STDMETHODIMP CAccEditableText::replaceText(long startOffset, long endOffset, BST
*/
STDMETHODIMP CAccEditableText::setAttributes(long startOffset, long endOffset, BSTR * attributes)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -461,7 +478,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
*/
STDMETHODIMP CAccEditableText::put_XInterface(hyper pXInterface)
{
-
+ // internal IUNOXWrapper - no mutex meeded
ENTER_PROTECTED_BLOCK
diff --git a/winaccessibility/source/UAccCOM/AccHyperLink.cxx b/winaccessibility/source/UAccCOM/AccHyperLink.cxx
index 3f86f663941c..04cd3e8eafa2 100644
--- a/winaccessibility/source/UAccCOM/AccHyperLink.cxx
+++ b/winaccessibility/source/UAccCOM/AccHyperLink.cxx
@@ -20,6 +20,9 @@
#include "stdafx.h"
#include "UAccCOM.h"
#include "AccHyperLink.h"
+
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
#include "MAccessible.h"
@@ -102,6 +105,8 @@ STDMETHODIMP CAccHyperLink::get_keyBinding(
STDMETHODIMP CAccHyperLink::get_anchor(/* [in] */ long index,
/* [retval][out] */ VARIANT __RPC_FAR *anchor)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -132,6 +137,8 @@ STDMETHODIMP CAccHyperLink::get_anchor(/* [in] */ long index,
STDMETHODIMP CAccHyperLink::get_anchorTarget(/* [in] */ long index,
/* [retval][out] */ VARIANT __RPC_FAR *anchorTarget)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -162,6 +169,8 @@ STDMETHODIMP CAccHyperLink::get_anchorTarget(/* [in] */ long index,
*/
STDMETHODIMP CAccHyperLink::get_startIndex(/* [retval][out] */ long __RPC_FAR *index)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -183,6 +192,8 @@ STDMETHODIMP CAccHyperLink::get_startIndex(/* [retval][out] */ long __RPC_FAR *i
*/
STDMETHODIMP CAccHyperLink::get_endIndex(/* [retval][out] */ long __RPC_FAR *index)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -209,6 +220,8 @@ STDMETHODIMP CAccHyperLink::get_endIndex(/* [retval][out] */ long __RPC_FAR *ind
*/
STDMETHODIMP CAccHyperLink::get_valid(/* [retval][out] */ boolean __RPC_FAR *valid)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -235,6 +248,8 @@ STDMETHODIMP CAccHyperLink::get_valid(/* [retval][out] */ boolean __RPC_FAR *val
*/
STDMETHODIMP CAccHyperLink::put_XInterface(hyper pXInterface)
{
+ // internal IUNOXWrapper - no mutex meeded
+
ENTER_PROTECTED_BLOCK
CAccActionBase::put_XInterface(pXInterface);
@@ -266,6 +281,8 @@ STDMETHODIMP CAccHyperLink::put_XInterface(hyper pXInterface)
*/
STDMETHODIMP CAccHyperLink::put_XSubInterface(hyper pXSubInterface)
{
+ // internal IUNOXWrapper - no mutex meeded
+
pRXLink = reinterpret_cast<XAccessibleHyperlink*>(pXSubInterface);
pRXAct = reinterpret_cast<XAccessibleAction*>(pXSubInterface);
diff --git a/winaccessibility/source/UAccCOM/AccHypertext.cxx b/winaccessibility/source/UAccCOM/AccHypertext.cxx
index eeb8e027b629..4b14c8ba3a2c 100644
--- a/winaccessibility/source/UAccCOM/AccHypertext.cxx
+++ b/winaccessibility/source/UAccCOM/AccHypertext.cxx
@@ -23,6 +23,8 @@
#include "AccHyperLink.h"
#include "acccommon.h"
+#include <vcl/svapp.hxx>
+
using namespace com::sun::star::accessibility;
using namespace com::sun::star::uno;
@@ -276,6 +278,8 @@ STDMETHODIMP CAccHypertext::scrollSubstringTo(long startIndex, long endIndex,enu
*/
STDMETHODIMP CAccHypertext::get_nHyperlinks(long *hyperlinkCount)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -301,6 +305,8 @@ STDMETHODIMP CAccHypertext::get_nHyperlinks(long *hyperlinkCount)
*/
STDMETHODIMP CAccHypertext::get_hyperlink(long index,IAccessibleHyperlink **hyperlink)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -347,6 +353,8 @@ STDMETHODIMP CAccHypertext::get_hyperlink(long index,IAccessibleHyperlink **hype
*/
STDMETHODIMP CAccHypertext::get_hyperlinkIndex(long charIndex, long *hyperlinkIndex)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -371,7 +379,7 @@ STDMETHODIMP CAccHypertext::get_hyperlinkIndex(long charIndex, long *hyperlinkIn
*/
STDMETHODIMP CAccHypertext::put_XInterface(hyper pXInterface)
{
-
+ // internal IUNOXWrapper - no mutex meeded
ENTER_PROTECTED_BLOCK
diff --git a/winaccessibility/source/UAccCOM/AccImage.cxx b/winaccessibility/source/UAccCOM/AccImage.cxx
index 8ca10104c13f..55f0ec6d5b98 100644
--- a/winaccessibility/source/UAccCOM/AccImage.cxx
+++ b/winaccessibility/source/UAccCOM/AccImage.cxx
@@ -20,6 +20,9 @@
#include "stdafx.h"
#include "UAccCOM.h"
#include "AccImage.h"
+
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
@@ -33,6 +36,8 @@ using namespace com::sun::star::uno;
*/
STDMETHODIMP CAccImage::get_description(BSTR * description)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -72,7 +77,7 @@ STDMETHODIMP CAccImage::get_imageSize(
*/
STDMETHODIMP CAccImage::put_XInterface(hyper pXInterface)
{
-
+ // internal IUNOXWrapper - no mutex meeded
ENTER_PROTECTED_BLOCK
diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx b/winaccessibility/source/UAccCOM/AccRelation.cxx
index 68b0958e6a52..ec528301d82d 100644
--- a/winaccessibility/source/UAccCOM/AccRelation.cxx
+++ b/winaccessibility/source/UAccCOM/AccRelation.cxx
@@ -20,6 +20,9 @@
#include "stdafx.h"
#include "UAccCOM.h"
#include "AccRelation.h"
+
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include "MAccessible.h"
@@ -34,6 +37,8 @@ using namespace com::sun::star::uno;
*/
STDMETHODIMP CAccRelation::get_relationType(BSTR * relationType)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (relationType == NULL)
@@ -67,6 +72,8 @@ STDMETHODIMP CAccRelation::get_localizedRelationType(BSTR *)
*/
STDMETHODIMP CAccRelation::get_nTargets(long * nTargets)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (nTargets == NULL)
@@ -87,6 +94,8 @@ STDMETHODIMP CAccRelation::get_nTargets(long * nTargets)
*/
STDMETHODIMP CAccRelation::get_target(long targetIndex, IUnknown * * target)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (target == NULL)
@@ -122,6 +131,8 @@ STDMETHODIMP CAccRelation::get_target(long targetIndex, IUnknown * * target)
*/
STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * target, long * nTargets)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -162,6 +173,7 @@ STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * target, long * nTarget
*/
STDMETHODIMP CAccRelation::put_XSubInterface(hyper pXSubInterface)
{
+ // internal IUNOXWrapper - no mutex meeded
relation = *reinterpret_cast<AccessibleRelation*>(pXSubInterface);
return S_OK;
diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx b/winaccessibility/source/UAccCOM/AccTable.cxx
index cb939346ff0c..15b964c4dd94 100644
--- a/winaccessibility/source/UAccCOM/AccTable.cxx
+++ b/winaccessibility/source/UAccCOM/AccTable.cxx
@@ -23,6 +23,9 @@
#include "stdafx.h"
#include "UAccCOM.h"
#include "AccTable.h"
+
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/accessibility/XAccessible.hpp>
#include "MAccessible.h"
@@ -43,6 +46,8 @@ using namespace com::sun::star::uno;
STDMETHODIMP CAccTable::get_accessibleAt(long row, long column, IUnknown * * accessible)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -112,6 +117,8 @@ STDMETHODIMP CAccTable::get_caption(IUnknown * *)
*/
STDMETHODIMP CAccTable::get_columnDescription(long column, BSTR * description)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -143,6 +150,8 @@ STDMETHODIMP CAccTable::get_columnDescription(long column, BSTR * description)
*/
STDMETHODIMP CAccTable::get_columnExtentAt(long row, long column, long * nColumnsSpanned)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
XAccessibleTable *pXAccTable = GetXInterface();
@@ -174,6 +183,8 @@ STDMETHODIMP CAccTable::get_columnExtentAt(long row, long column, long * nColumn
*/
STDMETHODIMP CAccTable::get_columnHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingRowIndex)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -222,6 +233,8 @@ STDMETHODIMP CAccTable::get_columnHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *
*/
STDMETHODIMP CAccTable::get_nColumns(long * columnCount)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -245,6 +258,8 @@ STDMETHODIMP CAccTable::get_nColumns(long * columnCount)
*/
STDMETHODIMP CAccTable::get_nRows(long * rowCount)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -268,6 +283,8 @@ STDMETHODIMP CAccTable::get_nRows(long * rowCount)
*/
STDMETHODIMP CAccTable::get_nSelectedColumns(long * columnCount)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -292,6 +309,8 @@ STDMETHODIMP CAccTable::get_nSelectedColumns(long * columnCount)
*/
STDMETHODIMP CAccTable::get_nSelectedRows(long * rowCount)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -317,6 +336,8 @@ STDMETHODIMP CAccTable::get_nSelectedRows(long * rowCount)
*/
STDMETHODIMP CAccTable::get_rowDescription(long row, BSTR * description)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -349,6 +370,8 @@ STDMETHODIMP CAccTable::get_rowDescription(long row, BSTR * description)
*/
STDMETHODIMP CAccTable::get_rowExtentAt(long row, long column, long * nRowsSpanned)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
XAccessibleTable *pXAccTable = GetXInterface();
@@ -381,6 +404,8 @@ STDMETHODIMP CAccTable::get_rowExtentAt(long row, long column, long * nRowsSpann
*/
STDMETHODIMP CAccTable::get_rowHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingColumnIndex)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -431,6 +456,8 @@ STDMETHODIMP CAccTable::get_rowHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *acc
*/
STDMETHODIMP CAccTable::get_selectedRows(long, long ** rows, long * nRows)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -468,6 +495,8 @@ STDMETHODIMP CAccTable::get_selectedRows(long, long ** rows, long * nRows)
*/
STDMETHODIMP CAccTable::get_selectedColumns(long, long ** columns, long * numColumns)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -503,6 +532,8 @@ STDMETHODIMP CAccTable::get_selectedColumns(long, long ** columns, long * numCol
*/
STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -539,6 +570,8 @@ STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible)
*/
STDMETHODIMP CAccTable::get_isColumnSelected(long column, unsigned char * isSelected)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -563,6 +596,8 @@ STDMETHODIMP CAccTable::get_isColumnSelected(long column, unsigned char * isSele
*/
STDMETHODIMP CAccTable::get_isRowSelected(long row, unsigned char * isSelected)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -589,6 +624,8 @@ STDMETHODIMP CAccTable::get_isRowSelected(long row, unsigned char * isSelected)
*/
STDMETHODIMP CAccTable::get_isSelected(long row, long column, unsigned char * isSelected)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -613,6 +650,8 @@ STDMETHODIMP CAccTable::get_isSelected(long row, long column, unsigned char * is
*/
STDMETHODIMP CAccTable::selectRow(long row)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// Check XAccessibleTable reference.
@@ -655,6 +694,8 @@ STDMETHODIMP CAccTable::selectRow(long row)
*/
STDMETHODIMP CAccTable::selectColumn(long column)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// Check XAccessibleTable reference.
@@ -698,6 +739,8 @@ STDMETHODIMP CAccTable::selectColumn(long column)
*/
STDMETHODIMP CAccTable::unselectRow(long row)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// Check XAccessibleTable reference.
@@ -743,6 +786,8 @@ STDMETHODIMP CAccTable::unselectRow(long row)
*/
STDMETHODIMP CAccTable::unselectColumn(long column)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// Check XAccessibleTable reference.
@@ -786,6 +831,8 @@ STDMETHODIMP CAccTable::unselectColumn(long column)
*/
STDMETHODIMP CAccTable::put_XInterface(hyper pXInterface)
{
+ // internal IUNOXWrapper - no mutex meeded
+
ENTER_PROTECTED_BLOCK
CUNOXWrapper::put_XInterface(pXInterface);
@@ -814,6 +861,8 @@ STDMETHODIMP CAccTable::put_XInterface(hyper pXInterface)
*/
STDMETHODIMP CAccTable::get_columnIndex(long childIndex, long * columnIndex)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -836,6 +885,8 @@ STDMETHODIMP CAccTable::get_columnIndex(long childIndex, long * columnIndex)
*/
STDMETHODIMP CAccTable::get_rowIndex(long childIndex, long * rowIndex)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -858,6 +909,8 @@ STDMETHODIMP CAccTable::get_rowIndex(long childIndex, long * rowIndex)
*/
STDMETHODIMP CAccTable::get_childIndex(long RowIndex , long columnIndex, long * childIndex )
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -899,6 +952,8 @@ STDMETHODIMP CAccTable::get_modelChange(IA2TableModelChange *)
// Number of children currently selected
STDMETHODIMP CAccTable::get_nSelectedChildren(long *childCount)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -928,6 +983,8 @@ STDMETHODIMP CAccTable::get_nSelectedChildren(long *childCount)
// Length of array (not more than maxChildren)
STDMETHODIMP CAccTable::get_selectedChildren(long, long **children, long *nChildren)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index 8e0be14effa9..6ba20e3bf269 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -23,8 +23,11 @@
#include "stdafx.h"
#include <string>
-#include <com/sun/star/accessibility/AccessibleTextType.hpp>
#include "AccTextBase.h"
+
+#include <vcl/svapp.hxx>
+
+#include <com/sun/star/accessibility/AccessibleTextType.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
@@ -57,6 +60,8 @@ CAccTextBase::~CAccTextBase()
*/
STDMETHODIMP CAccTextBase::get_addSelection(long startOffset, long endOffset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK XInterface#
@@ -91,6 +96,8 @@ STDMETHODIMP CAccTextBase::get_addSelection(long startOffset, long endOffset)
*/
STDMETHODIMP CAccTextBase::get_attributes(long offset, long * startOffset, long * endOffset, BSTR * textAttributes)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (startOffset == NULL || endOffset == NULL || textAttributes == NULL)
@@ -211,6 +218,8 @@ STDMETHODIMP CAccTextBase::get_attributes(long offset, long * startOffset, long
*/
STDMETHODIMP CAccTextBase::get_caretOffset(long * offset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (offset == NULL)
@@ -235,6 +244,8 @@ STDMETHODIMP CAccTextBase::get_caretOffset(long * offset)
*/
STDMETHODIMP CAccTextBase::get_characterCount(long * nCharacters)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (nCharacters == NULL)
@@ -263,6 +274,8 @@ STDMETHODIMP CAccTextBase::get_characterCount(long * nCharacters)
*/
STDMETHODIMP CAccTextBase::get_characterExtents(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (x == NULL || height == NULL || y == NULL || width == NULL)
@@ -333,6 +346,8 @@ STDMETHODIMP CAccTextBase::get_characterExtents(long offset, IA2CoordinateType c
*/
STDMETHODIMP CAccTextBase::get_nSelections(long * nSelections)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (nSelections == NULL)
@@ -377,6 +392,8 @@ STDMETHODIMP CAccTextBase::get_nSelections(long * nSelections)
*/
STDMETHODIMP CAccTextBase::get_offsetAtPoint(long x, long y, IA2CoordinateType, long * offset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (offset == NULL)
@@ -404,6 +421,8 @@ STDMETHODIMP CAccTextBase::get_offsetAtPoint(long x, long y, IA2CoordinateType,
STDMETHODIMP CAccTextBase::get_selection(long selectionIndex, long * startOffset, long * endOffset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (startOffset == NULL || endOffset == NULL )
@@ -451,6 +470,8 @@ STDMETHODIMP CAccTextBase::get_selection(long selectionIndex, long * startOffset
*/
STDMETHODIMP CAccTextBase::get_text(long startOffset, long endOffset, BSTR * text)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (text == NULL)
@@ -496,6 +517,8 @@ STDMETHODIMP CAccTextBase::get_text(long startOffset, long endOffset, BSTR * tex
*/
STDMETHODIMP CAccTextBase::get_textBeforeOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -582,6 +605,8 @@ STDMETHODIMP CAccTextBase::get_textBeforeOffset(long offset, IA2TextBoundaryType
*/
STDMETHODIMP CAccTextBase::get_textAfterOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (startOffset == NULL || endOffset == NULL || text == NULL)
@@ -666,6 +691,8 @@ STDMETHODIMP CAccTextBase::get_textAfterOffset(long offset, IA2TextBoundaryType
*/
STDMETHODIMP CAccTextBase::get_textAtOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (startOffset == NULL || text == NULL ||endOffset == NULL)
@@ -748,6 +775,8 @@ STDMETHODIMP CAccTextBase::get_textAtOffset(long offset, IA2TextBoundaryType bou
*/
STDMETHODIMP CAccTextBase::removeSelection(long selectionIndex)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK XInterface#
@@ -782,6 +811,8 @@ STDMETHODIMP CAccTextBase::removeSelection(long selectionIndex)
*/
STDMETHODIMP CAccTextBase::setCaretOffset(long offset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK XInterface#
@@ -805,6 +836,8 @@ STDMETHODIMP CAccTextBase::setCaretOffset(long offset)
*/
STDMETHODIMP CAccTextBase::setSelection(long, long startOffset, long endOffset)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK XInterface#
@@ -827,6 +860,8 @@ STDMETHODIMP CAccTextBase::setSelection(long, long startOffset, long endOffset)
*/
STDMETHODIMP CAccTextBase::get_nCharacters(long * nCharacters)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (nCharacters == NULL)
@@ -891,6 +926,8 @@ STDMETHODIMP CAccTextBase::scrollSubstringTo(long, long, IA2ScrollType)
*/
STDMETHODIMP CAccTextBase::put_XInterface(hyper pXInterface)
{
+ // internal IUNOXWrapper - no mutex meeded
+
ENTER_PROTECTED_BLOCK
CUNOXWrapper::put_XInterface(pXInterface);
diff --git a/winaccessibility/source/UAccCOM/AccValue.cxx b/winaccessibility/source/UAccCOM/AccValue.cxx
index c1781d21d297..28bc8c9ce00d 100644
--- a/winaccessibility/source/UAccCOM/AccValue.cxx
+++ b/winaccessibility/source/UAccCOM/AccValue.cxx
@@ -21,6 +21,9 @@
#include "UAccCOM.h"
#include "AccValue.h"
#include "MAccessible.h"
+
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
@@ -35,6 +38,8 @@ using namespace com::sun::star::uno;
STDMETHODIMP CAccValue::get_currentValue(VARIANT * currentValue)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (currentValue == NULL)
@@ -60,6 +65,8 @@ STDMETHODIMP CAccValue::get_currentValue(VARIANT * currentValue)
*/
STDMETHODIMP CAccValue::setCurrentValue(VARIANT value)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if ( !pRXVal.is() )
@@ -138,6 +145,8 @@ STDMETHODIMP CAccValue::setCurrentValue(VARIANT value)
*/
STDMETHODIMP CAccValue::get_maximumValue(VARIANT *maximumValue)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (maximumValue == NULL)
@@ -162,6 +171,8 @@ STDMETHODIMP CAccValue::get_maximumValue(VARIANT *maximumValue)
*/
STDMETHODIMP CAccValue::get_minimumValue(VARIANT *mininumValue)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
if (mininumValue == NULL)
@@ -186,7 +197,7 @@ STDMETHODIMP CAccValue::get_minimumValue(VARIANT *mininumValue)
*/
STDMETHODIMP CAccValue::put_XInterface(hyper pXInterface)
{
-
+ // internal IUNOXWrapper - no mutex meeded
ENTER_PROTECTED_BLOCK
diff --git a/winaccessibility/source/UAccCOM/EnumVariant.cxx b/winaccessibility/source/UAccCOM/EnumVariant.cxx
index 0d6793aef04f..cf403fa2455b 100644
--- a/winaccessibility/source/UAccCOM/EnumVariant.cxx
+++ b/winaccessibility/source/UAccCOM/EnumVariant.cxx
@@ -22,6 +22,7 @@
#include "EnumVariant.h"
#include "MAccessible.h"
+#include <vcl/svapp.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::accessibility;
@@ -40,6 +41,8 @@ using namespace com::sun::star::accessibility;
*/
HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR *pvar,ULONG __RPC_FAR *pcElementFetched)
{
+ SolarMutexGuard g;
+
long l1;
ULONG l2;
@@ -90,6 +93,8 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR *
*/
HRESULT STDMETHODCALLTYPE CEnumVariant::Skip(ULONG cElements)
{
+ SolarMutexGuard g;
+
m_lCurrent += cElements;
if (m_lCurrent > (long)(m_lLBound+m_pXAccessibleSelection->getSelectedAccessibleChildCount()))
{
@@ -108,6 +113,8 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Skip(ULONG cElements)
*/
HRESULT STDMETHODCALLTYPE CEnumVariant::Reset( void)
{
+ SolarMutexGuard g;
+
m_lCurrent = m_lLBound;
return NOERROR;
}
@@ -123,6 +130,8 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Reset( void)
*/
HRESULT STDMETHODCALLTYPE CEnumVariant::Clone(IEnumVARIANT __RPC_FAR *__RPC_FAR *ppenum)
{
+ SolarMutexGuard g;
+
CEnumVariant * penum = NULL;
HRESULT hr;
if (ppenum == NULL)
@@ -151,6 +160,8 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Clone(IEnumVARIANT __RPC_FAR *__RPC_FAR
*/
HRESULT STDMETHODCALLTYPE CEnumVariant::Create(CEnumVariant __RPC_FAR *__RPC_FAR *ppenum)
{
+ SolarMutexGuard g;
+
HRESULT hr = createInstance<CEnumVariant>(IID_IEnumVariant, ppenum);
if (S_OK != hr)
{
@@ -179,6 +190,8 @@ long CEnumVariant::GetCountOfElements()
*/
STDMETHODIMP CEnumVariant::ClearEnumeration()
{
+ // internal IEnumVariant - no mutex meeded
+
pUNOInterface = NULL;
m_pXAccessibleSelection = NULL;
m_lCurrent = m_lLBound;
@@ -216,6 +229,8 @@ static Reference<XAccessibleSelection> GetXAccessibleSelection(XAccessible* pXAc
*/
STDMETHODIMP CEnumVariant::PutSelection(hyper pXSelection)
{
+ // internal IEnumVariant - no mutex meeded
+
pUNOInterface = reinterpret_cast<XAccessible*>(pXSelection);
m_pXAccessibleSelection = GetXAccessibleSelection(pUNOInterface);
return S_OK;
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index d9ff89c7bd9b..82fb41a8bfd3 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -33,6 +33,8 @@
#include "AccHypertext.h"
#include "AccHyperLink.h"
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/accessibility/XAccessibleText.hpp>
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/XAccessibleImage.hpp>
@@ -243,6 +245,8 @@ m_bRequiresSave(FALSE)
CMAccessible::~CMAccessible()
{
+ SolarMutexGuard g;
+
if(m_pszName!=NULL)
{
SAFE_SYSFREESTRING(m_pszName);
@@ -284,6 +288,8 @@ CMAccessible::~CMAccessible()
*/
STDMETHODIMP CMAccessible::get_accParent(IDispatch **ppdispParent)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -319,6 +325,8 @@ STDMETHODIMP CMAccessible::get_accParent(IDispatch **ppdispParent)
*/
STDMETHODIMP CMAccessible::get_accChildCount(long *pcountChildren)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -351,6 +359,8 @@ STDMETHODIMP CMAccessible::get_accChildCount(long *pcountChildren)
*/
STDMETHODIMP CMAccessible::get_accChild(VARIANT varChild, IDispatch **ppdispChild)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -385,6 +395,8 @@ STDMETHODIMP CMAccessible::get_accChild(VARIANT varChild, IDispatch **ppdispChil
*/
STDMETHODIMP CMAccessible::get_accName(VARIANT varChild, BSTR *pszName)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -422,6 +434,8 @@ STDMETHODIMP CMAccessible::get_accName(VARIANT varChild, BSTR *pszName)
*/
STDMETHODIMP CMAccessible::get_accValue(VARIANT varChild, BSTR *pszValue)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -465,6 +479,8 @@ STDMETHODIMP CMAccessible::get_accValue(VARIANT varChild, BSTR *pszValue)
*/
STDMETHODIMP CMAccessible::get_accDescription(VARIANT varChild, BSTR *pszDescription)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -502,6 +518,8 @@ STDMETHODIMP CMAccessible::get_accDescription(VARIANT varChild, BSTR *pszDescrip
*/
STDMETHODIMP CMAccessible::get_accRole(VARIANT varChild, VARIANT *pvarRole)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -551,6 +569,8 @@ STDMETHODIMP CMAccessible::get_accRole(VARIANT varChild, VARIANT *pvarRole)
*/
STDMETHODIMP CMAccessible::get_accState(VARIANT varChild, VARIANT *pvarState)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -653,6 +673,8 @@ static void GetMnemonicChar( const ::rtl::OUString& aStr, WCHAR* wStr)
*/
STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKeyboardShortcut)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -806,6 +828,8 @@ STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKe
*/
STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -843,6 +867,8 @@ STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild)
*/
STDMETHODIMP CMAccessible::get_accSelection(VARIANT *pvarChildren)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -890,6 +916,8 @@ STDMETHODIMP CMAccessible::get_accSelection(VARIANT *pvarChildren)
*/
STDMETHODIMP CMAccessible::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varChild)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -946,6 +974,8 @@ STDMETHODIMP CMAccessible::accLocation(long *pxLeft, long *pyTop, long *pcxWidth
*/
STDMETHODIMP CMAccessible::accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEndUpAt)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -986,6 +1016,8 @@ STDMETHODIMP CMAccessible::accNavigate(long navDir, VARIANT varStart, VARIANT *p
STDMETHODIMP CMAccessible::accHitTest(long xLeft, long yTop, VARIANT *pvarChild)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -1059,6 +1091,7 @@ STDMETHODIMP CMAccessible::QueryService(REFGUID guidService, REFIID riid, void**
*/
STDMETHODIMP CMAccessible::put_accName(VARIANT varChild, BSTR szName)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -1092,6 +1125,7 @@ STDMETHODIMP CMAccessible::put_accName(VARIANT varChild, BSTR szName)
*/
STDMETHODIMP CMAccessible::put_accValue(VARIANT varChild, BSTR szValue)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -1123,6 +1157,7 @@ STDMETHODIMP CMAccessible::put_accValue(VARIANT varChild, BSTR szValue)
*/
STDMETHODIMP CMAccessible::Put_XAccName(const OLECHAR __RPC_FAR *pszName)
{
+ // internal IMAccessible - no mutex meeded
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -1148,6 +1183,8 @@ STDMETHODIMP CMAccessible::Put_XAccName(const OLECHAR __RPC_FAR *pszName)
*/
STDMETHODIMP CMAccessible::Put_XAccRole(unsigned short pRole)
{
+ // internal IMAccessible - no mutex meeded
+
m_iRole = pRole;
return S_OK;
}
@@ -1159,6 +1196,8 @@ STDMETHODIMP CMAccessible::Put_XAccRole(unsigned short pRole)
*/
STDMETHODIMP CMAccessible::DecreaseState(DWORD pXSate)
{
+ // internal IMAccessible - no mutex meeded
+
m_dState &= (~pXSate);
return S_OK;
}
@@ -1170,6 +1209,8 @@ STDMETHODIMP CMAccessible::DecreaseState(DWORD pXSate)
*/
STDMETHODIMP CMAccessible::IncreaseState(DWORD pXSate)
{
+ // internal IMAccessible - no mutex meeded
+
m_dState |= pXSate;
return S_OK;
}
@@ -1181,6 +1222,8 @@ STDMETHODIMP CMAccessible::IncreaseState(DWORD pXSate)
*/
STDMETHODIMP CMAccessible::SetState(DWORD pXSate)
{
+ // internal IMAccessible - no mutex meeded
+
m_dState = pXSate;
return S_OK;
}
@@ -1194,6 +1237,7 @@ STDMETHODIMP CMAccessible::SetState(DWORD pXSate)
*/
STDMETHODIMP CMAccessible::Put_XAccDescription(const OLECHAR __RPC_FAR *pszDescription)
{
+ // internal IMAccessible - no mutex meeded
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -1220,6 +1264,7 @@ STDMETHODIMP CMAccessible::Put_XAccDescription(const OLECHAR __RPC_FAR *pszDescr
*/
STDMETHODIMP CMAccessible::Put_XAccValue(const OLECHAR __RPC_FAR *pszAccValue)
{
+ // internal IMAccessible - no mutex meeded
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -1245,6 +1290,7 @@ STDMETHODIMP CMAccessible::Put_XAccValue(const OLECHAR __RPC_FAR *pszAccValue)
*/
STDMETHODIMP CMAccessible::Put_XAccWindowHandle(HWND hwnd)
{
+ // internal IMAccessible - no mutex meeded
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -1261,6 +1307,7 @@ STDMETHODIMP CMAccessible::Put_XAccWindowHandle(HWND hwnd)
*/
STDMETHODIMP CMAccessible::Put_XAccFocus(long dChildID)
{
+ // internal IMAccessible - no mutex meeded
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -1294,6 +1341,7 @@ STDMETHODIMP CMAccessible::Put_XAccFocus(long dChildID)
*/
STDMETHODIMP CMAccessible::Put_XAccLocation(const Location sLocation)
{
+ // internal IMAccessible - no mutex meeded
this->m_sLocation = sLocation;
return S_OK;
@@ -1307,6 +1355,8 @@ STDMETHODIMP CMAccessible::Put_XAccLocation(const Location sLocation)
*/
STDMETHODIMP CMAccessible::Put_XAccParent(IMAccessible __RPC_FAR *pIParent)
{
+ // internal IMAccessible - no mutex meeded
+
this->m_pIParent = pIParent;
if(pIParent)
@@ -1322,6 +1372,7 @@ STDMETHODIMP CMAccessible::Put_XAccParent(IMAccessible __RPC_FAR *pIParent)
*/
STDMETHODIMP CMAccessible::Put_XAccChildID(long dChildID)
{
+ // internal IMAccessible - no mutex meeded
this->m_dChildID = dChildID;
return S_OK;
@@ -1334,6 +1385,8 @@ STDMETHODIMP CMAccessible::Put_XAccChildID(long dChildID)
*/
STDMETHODIMP CMAccessible::Put_XAccAgent(hyper pAgent)
{
+ // internal IMAccessible - no mutex meeded
+
g_pAgent = reinterpret_cast<AccObjectManagerAgent*>(pAgent);
return S_OK;
}
@@ -1347,6 +1400,7 @@ STDMETHODIMP CMAccessible::Put_XAccAgent(hyper pAgent)
*/
STDMETHODIMP CMAccessible::NotifyDestroy(BOOL isDestroy)
{
+ // internal IMAccessible - no mutex meeded
m_isDestroy = isDestroy;
m_xAccessible.clear();
@@ -1650,6 +1704,8 @@ HRESULT CMAccessible::GetPreSibling(VARIANT varStart,VARIANT* pvarEndUpAt)
*/
STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR *nRelations)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -1678,6 +1734,8 @@ STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR *nRelations)
STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -1739,6 +1797,8 @@ STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation
STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation, long __RPC_FAR *nRelations)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
// #CHECK#
@@ -1797,6 +1857,8 @@ STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *_
STDMETHODIMP CMAccessible::role(long __RPC_FAR *role)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
(*role) = m_iRole;
@@ -1809,6 +1871,7 @@ STDMETHODIMP CMAccessible::role(long __RPC_FAR *role)
STDMETHODIMP CMAccessible:: get_nActions(long __RPC_FAR *nActions)
{
+ SolarMutexGuard g;
try
{
@@ -1881,6 +1944,8 @@ static XAccessible* getTheParentOfMember(XAccessible* pXAcc)
STDMETHODIMP CMAccessible:: get_groupPosition(long __RPC_FAR *groupLevel,long __RPC_FAR *similarItemsInGroup,long __RPC_FAR *positionInGroup)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
// #CHECK#
@@ -2066,6 +2131,7 @@ STDMETHODIMP CMAccessible:: get_extendedStates( long, BSTR __RPC_FAR *__RPC_FAR
STDMETHODIMP CMAccessible:: get_uniqueID(long __RPC_FAR *uniqueID)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -2082,6 +2148,7 @@ STDMETHODIMP CMAccessible:: get_uniqueID(long __RPC_FAR *uniqueID)
STDMETHODIMP CMAccessible:: get_windowHandle(HWND __RPC_FAR *windowHandle)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -2260,6 +2327,8 @@ HRESULT CMAccessible::DeSelectMutipleChildren( XAccessible** pItem,int size )
*/
STDMETHODIMP CMAccessible::SetXAccessible(hyper pXAcc)
{
+ // internal IMAccessible - no mutex meeded
+
m_xAccessible = reinterpret_cast<XAccessible*>(pXAcc);
m_pEnumVar->PutSelection(/*XAccessibleSelection*/
reinterpret_cast<hyper>(m_xAccessible.get()));
@@ -2280,6 +2349,8 @@ STDMETHODIMP CMAccessible::SetXAccessible(hyper pXAcc)
*/
STDMETHODIMP CMAccessible::accSelect(long flagsSelect, VARIANT varChild)
{
+ SolarMutexGuard g;
+
ENTER_PROTECTED_BLOCK
ISDESTROY()
if( (flagsSelect&SELFLAG_ADDSELECTION) &&
@@ -2372,7 +2443,8 @@ STDMETHODIMP CMAccessible::accSelect(long flagsSelect, VARIANT varChild)
*/
STDMETHODIMP CMAccessible::GetUNOInterface(hyper * pXAcc)
{
- // #CHECK#
+ // internal IMAccessible - no mutex meeded
+
if(pXAcc == NULL)
return E_INVALIDARG;
@@ -2387,6 +2459,8 @@ STDMETHODIMP CMAccessible::GetUNOInterface(hyper * pXAcc)
*/
STDMETHODIMP CMAccessible::SetDefaultAction(hyper pAction)
{
+ // internal IMAccessible - no mutex meeded
+
m_xAction = reinterpret_cast<XAccessibleAction*>(pAction);
return S_OK;
}
@@ -2400,6 +2474,7 @@ STDMETHODIMP CMAccessible::SetDefaultAction(hyper pAction)
*/
HRESULT STDMETHODCALLTYPE CMAccessible::get_accDefaultAction(VARIANT varChild, BSTR *pszDefaultAction)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -2438,6 +2513,7 @@ HRESULT STDMETHODCALLTYPE CMAccessible::get_accDefaultAction(VARIANT varChild, B
*/
HRESULT STDMETHODCALLTYPE CMAccessible::accDoDefaultAction(VARIANT varChild)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -2472,6 +2548,7 @@ HRESULT STDMETHODCALLTYPE CMAccessible::accDoDefaultAction(VARIANT varChild)
*/
STDMETHODIMP CMAccessible::Put_ActionDescription( const OLECHAR* szAction)
{
+ // internal IMAccessible - no mutex meeded
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -2590,6 +2667,8 @@ HRESULT WINAPI CMAccessible::SmartQI(void* /*pv*/, REFIID iid, void** ppvObject)
{
if (InlineIsEqualGUID(iid, *pMap->piid))
{
+ SolarMutexGuard g;
+
XInterface* pXI = NULL;
BOOL bFound = GetXInterfaceFromXAccessible(m_xAccessible.get(),
&pXI, pMap->XIFIndex);
@@ -3029,7 +3108,8 @@ void CMAccessible::ConvertAnyToVariant(const ::com::sun::star::uno::Any &rAnyVal
STDMETHODIMP CMAccessible::Get_XAccChildID(long* childID)
{
- // #CHECK#
+ // internal IMAccessible - no mutex meeded
+
if(childID == NULL)
{
return E_FAIL;
@@ -3037,10 +3117,13 @@ STDMETHODIMP CMAccessible::Get_XAccChildID(long* childID)
*childID = m_dChildID;
return S_OK;
}
+
STDMETHODIMP CMAccessible:: get_states(AccessibleStates __RPC_FAR *states )
{
- ENTER_PROTECTED_BLOCK
- ISDESTROY()
+ SolarMutexGuard g;
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
if (!m_xContext.is())
return E_FAIL;
@@ -3207,6 +3290,7 @@ DWORD GetMSAAStateFromUNO(short xState)
STDMETHODIMP CMAccessible:: get_appName( BSTR __RPC_FAR *name)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -3219,6 +3303,7 @@ STDMETHODIMP CMAccessible:: get_appName( BSTR __RPC_FAR *name)
}
STDMETHODIMP CMAccessible:: get_appVersion(BSTR __RPC_FAR *version)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -3230,6 +3315,7 @@ STDMETHODIMP CMAccessible:: get_appVersion(BSTR __RPC_FAR *version)
}
STDMETHODIMP CMAccessible:: get_toolkitName(BSTR __RPC_FAR *name)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -3241,6 +3327,7 @@ STDMETHODIMP CMAccessible:: get_toolkitName(BSTR __RPC_FAR *name)
}
STDMETHODIMP CMAccessible:: get_toolkitVersion(BSTR __RPC_FAR *version)
{
+ SolarMutexGuard g;
ENTER_PROTECTED_BLOCK
ISDESTROY()
@@ -3254,6 +3341,8 @@ STDMETHODIMP CMAccessible:: get_toolkitVersion(BSTR __RPC_FAR *version)
STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
{
+ SolarMutexGuard g;
+
Reference<XAccessibleContext> pRContext = m_xAccessible->getAccessibleContext();
if( !pRContext.is() )
{
diff --git a/winaccessibility/source/UAccCOM/MAccessible.h b/winaccessibility/source/UAccCOM/MAccessible.h
index 98274a1a4aed..a6ddba34b769 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.h
+++ b/winaccessibility/source/UAccCOM/MAccessible.h
@@ -20,7 +20,6 @@
#ifndef INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_MACCESSIBLE_H
#define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_MACCESSIBLE_H
-#include <windows.h>
#include "resource.h" // main symbols
#include <map>
#include <com/sun/star/accessibility/XAccessible.hpp>
diff --git a/winaccessibility/source/UAccCOM/stdafx.h b/winaccessibility/source/UAccCOM/stdafx.h
index b1b0ee35e0e7..66019e2f043a 100644
--- a/winaccessibility/source/UAccCOM/stdafx.h
+++ b/winaccessibility/source/UAccCOM/stdafx.h
@@ -30,11 +30,17 @@
//#define _ATL_APARTMENT_THREADED
+#include <prewin.h>
+#include <windows.h>
+
#include <atlbase.h>
// You may derive a class from CComModule and use it if you want to override
// something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>
+#include <postwin.h>
+#undef OPAQUE
+
#define ENTER_PROTECTED_BLOCK \
try \
@@ -49,9 +55,6 @@ extern CComModule _Module;
#define SAFE_SYSFREESTRING(x) { ::SysFreeString(x); x=NULL; }
-#include <windows.h>
-#undef OPAQUE
-
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.