winaccessibility/source/UAccCOM/AccActionBase.cxx | 20 - winaccessibility/source/UAccCOM/AccComponentBase.cxx | 106 +++--- winaccessibility/source/UAccCOM/AccEditableText.cxx | 32 +- winaccessibility/source/UAccCOM/AccHyperLink.cxx | 24 - winaccessibility/source/UAccCOM/AccHypertext.cxx | 16 - winaccessibility/source/UAccCOM/AccImage.cxx | 66 ++-- winaccessibility/source/UAccCOM/AccRelation.cxx | 20 - winaccessibility/source/UAccCOM/AccTable.cxx | 112 +++---- winaccessibility/source/UAccCOM/AccTableCell.cxx | 178 ++++++----- winaccessibility/source/UAccCOM/AccTextBase.cxx | 72 ++-- winaccessibility/source/UAccCOM/AccValue.cxx | 237 ++++++++------- winaccessibility/source/UAccCOM/MAccessible.cxx | 292 +++++++++---------- winaccessibility/source/UAccCOM/stdafx.h | 11 13 files changed, 611 insertions(+), 575 deletions(-)
New commits: commit c5c4dc5fc90e775537dd98439a581ba7764a4fd0 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Mar 23 11:22:30 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Mar 23 11:14:03 2022 +0100 Drop ENTER/LEAVE_PROTECTED_BLOCK and ISDESTROY macros ... that created some local language dialect. Mostly an automatic rewrite, with clang-format applied where it is unavoidable. Change-Id: Ibc24d00f6e80000320fa9bfb35ee16add0f714cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131961 Tested-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx index a9f5edf828e5..cd68f3032ec3 100644 --- a/winaccessibility/source/UAccCOM/AccActionBase.cxx +++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx @@ -60,7 +60,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::nActions(/*[out,retval]*/long* { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if( pRXAct.is() && nActions != nullptr ) @@ -72,7 +72,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::nActions(/*[out,retval]*/long* return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -84,7 +84,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::doAction(/* [in] */ long actio { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if( pRXAct.is() ) { @@ -92,7 +92,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::doAction(/* [in] */ long actio } return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -105,7 +105,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::get_description(long actionInd { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(description == nullptr) @@ -123,7 +123,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::get_description(long actionInd return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::get_name( long, BSTR __RPC_FAR *) @@ -154,7 +154,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::get_keyBinding( { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if( !keyBinding || !nBinding) return E_INVALIDARG; @@ -185,7 +185,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::get_keyBinding( *nBinding = nCount; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -197,7 +197,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::put_XInterface(hyper pXInterfa { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK + try { CUNOXWrapper::put_XInterface(pXInterface); @@ -215,7 +215,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::put_XInterface(hyper pXInterfa pRXAct = pRXI.get(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccComponentBase.cxx b/winaccessibility/source/UAccCOM/AccComponentBase.cxx index 7d173dd0064a..ed44c2c93d17 100644 --- a/winaccessibility/source/UAccCOM/AccComponentBase.cxx +++ b/winaccessibility/source/UAccCOM/AccComponentBase.cxx @@ -101,21 +101,24 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccComponentBase::grabFocus(boolean* success) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try + { + if (success == nullptr) + return E_INVALIDARG; + // #CHECK XInterface# + if (!pRXComp.is()) + { + return E_FAIL; + } + GetXInterface()->grabFocus(); + *success = TRUE; - if (success == nullptr) - return E_INVALIDARG; - // #CHECK XInterface# - if (!pRXComp.is()) + return S_OK; + } + catch (...) { return E_FAIL; } - GetXInterface()->grabFocus(); - *success = TRUE; - - return S_OK; - - LEAVE_PROTECTED_BLOCK } /** @@ -127,20 +130,23 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccComponentBase::get_foreground(IA2Color* fo { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try + { + if (foreground == nullptr) + return E_INVALIDARG; + // #CHECK XInterface# + if (!pRXComp.is()) + { + return E_FAIL; + } + *foreground = static_cast<long>(GetXInterface()->getForeground()); - if (foreground == nullptr) - return E_INVALIDARG; - // #CHECK XInterface# - if (!pRXComp.is()) + return S_OK; + } + catch (...) { return E_FAIL; } - *foreground = static_cast<long>(GetXInterface()->getForeground()); - - return S_OK; - - LEAVE_PROTECTED_BLOCK } /** @@ -152,20 +158,23 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccComponentBase::get_background(IA2Color* ba { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try + { + if (background == nullptr) + return E_INVALIDARG; + // #CHECK XInterface# + if (!pRXComp.is()) + { + return E_FAIL; + } + *background = static_cast<long>(GetXInterface()->getBackground()); - if (background == nullptr) - return E_INVALIDARG; - // #CHECK XInterface# - if (!pRXComp.is()) + return S_OK; + } + catch (...) { return E_FAIL; } - *background = static_cast<long>(GetXInterface()->getBackground()); - - return S_OK; - - LEAVE_PROTECTED_BLOCK } /** @@ -177,26 +186,29 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccComponentBase::put_XInterface(hyper pXInte { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK + try + { + CUNOXWrapper::put_XInterface(pXInterface); + //special query. + if (pUNOInterface == nullptr) + return E_FAIL; + Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext(); + if (!pRContext.is()) + { + return E_FAIL; + } + Reference<XAccessibleComponent> pRXI(pRContext, UNO_QUERY); + if (!pRXI.is()) + pRXComp = nullptr; + else + pRXComp = pRXI.get(); - CUNOXWrapper::put_XInterface(pXInterface); - //special query. - if (pUNOInterface == nullptr) - return E_FAIL; - Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext(); - if (!pRContext.is()) + return S_OK; + } + catch (...) { return E_FAIL; } - Reference<XAccessibleComponent> pRXI(pRContext, UNO_QUERY); - if (!pRXI.is()) - pRXComp = nullptr; - else - pRXComp = pRXI.get(); - - return S_OK; - - LEAVE_PROTECTED_BLOCK } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx index 1e0343b9fcb5..2bfd843660e1 100644 --- a/winaccessibility/source/UAccCOM/AccEditableText.cxx +++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx @@ -60,7 +60,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::copyText(long startOffset, l { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK XInterface# if(!pRXEdtTxt.is()) @@ -73,7 +73,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::copyText(long startOffset, l return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -87,7 +87,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::deleteText(long startOffset, { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if( !pRXEdtTxt.is() ) return E_FAIL; @@ -97,7 +97,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::deleteText(long startOffset, return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -111,7 +111,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::insertText(long offset, BSTR { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (text == nullptr) return E_INVALIDARG; @@ -126,7 +126,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::insertText(long offset, BSTR return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -140,7 +140,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::cutText(long startOffset, lo { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if( !pRXEdtTxt.is() ) return E_FAIL; @@ -150,7 +150,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::cutText(long startOffset, lo return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -163,7 +163,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::pasteText(long offset) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if( !pRXEdtTxt.is() ) return E_FAIL; @@ -173,7 +173,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::pasteText(long offset) return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -188,7 +188,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::replaceText(long startOffset { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if (text == nullptr) @@ -202,7 +202,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::replaceText(long startOffset return S_OK; return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -217,7 +217,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::setAttributes(long startOffs { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if (attributes == nullptr) @@ -251,7 +251,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::setAttributes(long startOffs return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -481,7 +481,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::put_XInterface(hyper pXInter { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK + try { CUNOXWrapper::put_XInterface(pXInterface); //special query. @@ -499,7 +499,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::put_XInterface(hyper pXInter pRXEdtTxt = pRXI.get(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccHyperLink.cxx b/winaccessibility/source/UAccCOM/AccHyperLink.cxx index 8753753a494a..6857540c321c 100644 --- a/winaccessibility/source/UAccCOM/AccHyperLink.cxx +++ b/winaccessibility/source/UAccCOM/AccHyperLink.cxx @@ -115,7 +115,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_anchor(/* [in] */ long inde { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(anchor == nullptr) @@ -134,7 +134,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_anchor(/* [in] */ long inde return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -147,7 +147,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_anchorTarget(/* [in] */ lon { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(anchorTarget == nullptr) @@ -166,7 +166,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_anchorTarget(/* [in] */ lon return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } @@ -179,7 +179,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_startIndex(/* [retval][out] { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(index == nullptr) @@ -190,7 +190,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_startIndex(/* [retval][out] return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -202,7 +202,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_endIndex(/* [retval][out] * { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(index == nullptr) @@ -218,7 +218,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_endIndex(/* [retval][out] * return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -230,7 +230,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_valid(/* [retval][out] */ b { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(valid == nullptr) @@ -246,7 +246,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::get_valid(/* [retval][out] */ b return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -258,7 +258,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::put_XInterface(hyper pXInterfac { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK + try { CAccActionBase::put_XInterface(pXInterface); //special query. @@ -279,7 +279,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHyperLink::put_XInterface(hyper pXInterfac } return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** diff --git a/winaccessibility/source/UAccCOM/AccHypertext.cxx b/winaccessibility/source/UAccCOM/AccHypertext.cxx index aa1e297df7c0..722f13b5cf5e 100644 --- a/winaccessibility/source/UAccCOM/AccHypertext.cxx +++ b/winaccessibility/source/UAccCOM/AccHypertext.cxx @@ -276,7 +276,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::get_nHyperlinks(long *hyperlink { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(hyperlinkCount == nullptr) @@ -290,7 +290,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::get_nHyperlinks(long *hyperlink *hyperlinkCount = pHyperText->getHyperLinkCount(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -303,7 +303,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::get_hyperlink(long index,IAcces { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(hyperlink == nullptr) @@ -338,7 +338,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::get_hyperlink(long index,IAcces return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -351,7 +351,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::get_hyperlinkIndex(long charInd { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(hyperlinkIndex == nullptr) @@ -365,7 +365,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::get_hyperlinkIndex(long charInd *hyperlinkIndex = pHyperText->getHyperLinkIndex(charIndex); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -377,7 +377,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::put_XInterface(hyper pXInterfac { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK + try { CAccTextBase::put_XInterface(pXInterface); //special query. @@ -395,7 +395,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccHypertext::put_XInterface(hyper pXInterfac pHyperText = pRXI.get(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccImage.cxx b/winaccessibility/source/UAccCOM/AccImage.cxx index 5a0630fffe13..666524a71192 100644 --- a/winaccessibility/source/UAccCOM/AccImage.cxx +++ b/winaccessibility/source/UAccCOM/AccImage.cxx @@ -47,21 +47,24 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccImage::get_description(BSTR* description) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - // #CHECK# - if (description == nullptr) - return E_INVALIDARG; - if (!pRXImg.is()) - return E_FAIL; - - OUString ouStr = GetXInterface()->getAccessibleImageDescription(); - SysFreeString(*description); - *description = SysAllocString(o3tl::toW(ouStr.getStr())); + try + { + // #CHECK# + if (description == nullptr) + return E_INVALIDARG; + if (!pRXImg.is()) + return E_FAIL; - return S_OK; + OUString ouStr = GetXInterface()->getAccessibleImageDescription(); + SysFreeString(*description); + *description = SysAllocString(o3tl::toW(ouStr.getStr())); - LEAVE_PROTECTED_BLOCK + return S_OK; + } + catch (...) + { + return E_FAIL; + } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccImage::get_imagePosition( @@ -88,26 +91,29 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccImage::put_XInterface(hyper pXInterface) { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK - - CUNOXWrapper::put_XInterface(pXInterface); - //special query. - if (pUNOInterface == nullptr) - return E_FAIL; - - Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext(); - if (!pRContext.is()) + try + { + CUNOXWrapper::put_XInterface(pXInterface); + //special query. + if (pUNOInterface == nullptr) + return E_FAIL; + + Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext(); + if (!pRContext.is()) + { + return E_FAIL; + } + Reference<XAccessibleImage> pRXI(pRContext, UNO_QUERY); + if (!pRXI.is()) + pRXImg = nullptr; + else + pRXImg = pRXI.get(); + return S_OK; + } + catch (...) { return E_FAIL; } - Reference<XAccessibleImage> pRXI(pRContext, UNO_QUERY); - if (!pRXI.is()) - pRXImg = nullptr; - else - pRXImg = pRXI.get(); - return S_OK; - - LEAVE_PROTECTED_BLOCK } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx b/winaccessibility/source/UAccCOM/AccRelation.cxx index ea779ce13f2c..543a5b1aebe6 100644 --- a/winaccessibility/source/UAccCOM/AccRelation.cxx +++ b/winaccessibility/source/UAccCOM/AccRelation.cxx @@ -48,7 +48,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_relationType(BSTR * relation { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (relationType == nullptr) return E_INVALIDARG; @@ -59,7 +59,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_relationType(BSTR * relation *relationType = getRelationTypeBSTR(type); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } // Gets what the type of localized relation is. @@ -67,11 +67,11 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_localizedRelationType(BSTR * { - ENTER_PROTECTED_BLOCK + try { return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -83,7 +83,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_nTargets(long * nTargets) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (nTargets == nullptr) return E_INVALIDARG; @@ -92,7 +92,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_nTargets(long * nTargets) *nTargets = xTargets.getLength(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -105,7 +105,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_target(long targetIndex, IUn { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (target == nullptr) return E_FAIL; @@ -128,7 +128,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_target(long targetIndex, IUn return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -142,7 +142,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * t { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(target == nullptr) @@ -172,7 +172,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * t *nTargets = nCount; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx b/winaccessibility/source/UAccCOM/AccTable.cxx index 496a39d16bb7..63f9edf7ec14 100644 --- a/winaccessibility/source/UAccCOM/AccTable.cxx +++ b/winaccessibility/source/UAccCOM/AccTable.cxx @@ -54,7 +54,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_accessibleAt(long row, long col { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(accessible == nullptr) @@ -96,7 +96,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_accessibleAt(long row, long col } return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_cellAt(long row, long column, IUnknown * * cell) @@ -124,7 +124,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnDescription(long column, { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(description == nullptr) @@ -143,7 +143,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnDescription(long column, return E_FAIL; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -157,7 +157,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnExtentAt(long row, long c { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // Check pointer. if(nColumnsSpanned == nullptr) @@ -169,7 +169,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnExtentAt(long row, long c *nColumnsSpanned = pRXTable->getAccessibleColumnExtentAt(row, column); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -182,7 +182,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnHeader(IAccessibleTable _ { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(accessibleTable == nullptr || startingRowIndex == nullptr) @@ -220,7 +220,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnHeader(IAccessibleTable _ return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -232,7 +232,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nColumns(long * columnCount) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(columnCount == nullptr) @@ -245,7 +245,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nColumns(long * columnCount) *columnCount = pRXTable->getAccessibleColumnCount(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -257,7 +257,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nRows(long * rowCount) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(rowCount == nullptr) @@ -270,7 +270,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nRows(long * rowCount) *rowCount = pRXTable->getAccessibleRowCount(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -282,7 +282,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedColumns(long * columnC { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(columnCount == nullptr) @@ -296,7 +296,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedColumns(long * columnC *columnCount = pSelected.getLength(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -308,7 +308,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedRows(long * rowCount) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(rowCount == nullptr) @@ -322,7 +322,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedRows(long * rowCount) *rowCount = pSelected.getLength(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -335,7 +335,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowDescription(long row, BSTR * { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(description == nullptr) @@ -354,7 +354,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowDescription(long row, BSTR * return E_FAIL; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -368,7 +368,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowExtentAt(long row, long colu { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // Check pointer. if(nRowsSpanned == nullptr) @@ -381,7 +381,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowExtentAt(long row, long colu return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -394,7 +394,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowHeader(IAccessibleTable __RP { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(accessibleTable == nullptr || startingColumnIndex == nullptr) @@ -432,7 +432,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowHeader(IAccessibleTable __RP return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -445,7 +445,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedRows(long** rows, long* { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(rows == nullptr || nRows == nullptr) @@ -470,7 +470,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedRows(long** rows, long* return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -495,7 +495,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedColumns(long ** columns { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(columns == nullptr || numColumns == nullptr) @@ -520,7 +520,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedColumns(long ** columns return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -544,7 +544,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(accessible == nullptr) @@ -568,7 +568,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -581,7 +581,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_isColumnSelected(long column, b { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(isSelected == nullptr) @@ -594,7 +594,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_isColumnSelected(long column, b *isSelected = pRXTable->isAccessibleColumnSelected(column); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -607,7 +607,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_isRowSelected(long row, boolean { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(isSelected == nullptr) @@ -620,7 +620,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_isRowSelected(long row, boolean *isSelected = pRXTable->isAccessibleRowSelected(row); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -634,7 +634,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_isSelected(long row, long colum { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(isSelected == nullptr) @@ -647,7 +647,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_isSelected(long row, long colum *isSelected = pRXTable->isAccessibleSelected(row, column); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -660,7 +660,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::selectRow(long row) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // Check XAccessibleTable reference. if(!pRXTable.is()) @@ -691,7 +691,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::selectRow(long row) return S_OK; } - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -704,7 +704,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::selectColumn(long column) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // Check XAccessibleTable reference. if(!pRXTable.is()) @@ -736,7 +736,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::selectColumn(long column) } // End of added. - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -749,7 +749,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::unselectRow(long row) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // Check XAccessibleTable reference. if(!pRXTable.is()) @@ -783,7 +783,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::unselectRow(long row) } // End of added. - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -796,7 +796,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::unselectColumn(long column) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // Check XAccessibleTable reference. if(!pRXTable.is()) @@ -829,7 +829,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::unselectColumn(long column) return S_OK; } - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -841,7 +841,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::put_XInterface(hyper pXInterface) { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK + try { CUNOXWrapper::put_XInterface(pXInterface); //special query. @@ -859,7 +859,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::put_XInterface(hyper pXInterface) pRXTable = pRXI.get(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } @@ -872,7 +872,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnIndex(long childIndex, lo { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(columnIndex == nullptr) @@ -885,7 +885,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnIndex(long childIndex, lo *columnIndex = pRXTable->getAccessibleColumn(childIndex); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** * Gets rowIndex of childIndex. @@ -896,7 +896,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowIndex(long childIndex, long { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(rowIndex == nullptr) @@ -909,7 +909,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowIndex(long childIndex, long *rowIndex = pRXTable->getAccessibleRow(childIndex); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -921,7 +921,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_childIndex(long RowIndex , long { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(childIndex == nullptr) @@ -934,7 +934,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_childIndex(long RowIndex , long *childIndex = pRXTable->getAccessibleIndex(RowIndex, columnIndex); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowColumnExtentsAtIndex(long, @@ -959,7 +959,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedChildren(long *childCo { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(childCount == nullptr) @@ -976,7 +976,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedChildren(long *childCo *childCount = pRSelection->getSelectedAccessibleChildCount(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } @@ -997,7 +997,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedChildren(long, long **c { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if(children == nullptr || nChildren == nullptr) @@ -1033,7 +1033,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedChildren(long, long **c return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } @@ -1049,7 +1049,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedCells(IUnknown * * * ce { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (cells == nullptr || nSelectedCells == nullptr) return E_INVALIDARG; @@ -1089,7 +1089,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedCells(IUnknown * * * ce return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccTableCell.cxx b/winaccessibility/source/UAccCOM/AccTableCell.cxx index 2cc9a2963ff2..90c450735008 100644 --- a/winaccessibility/source/UAccCOM/AccTableCell.cxx +++ b/winaccessibility/source/UAccCOM/AccTableCell.cxx @@ -34,135 +34,153 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::put_XInterface(hyper pXInterfac { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK - - CUNOXWrapper::put_XInterface(pXInterface); - if (pUNOInterface == nullptr) - return E_INVALIDARG; - - Reference<XAccessibleContext> xContext = pUNOInterface->getAccessibleContext(); - if (!xContext.is()) - return E_FAIL; - - // retrieve reference to table (parent of the cell) - Reference<XAccessibleContext> xParentContext - = xContext->getAccessibleParent()->getAccessibleContext(); - Reference<XAccessibleTable> xTable(xParentContext, UNO_QUERY); - - if (!xTable.is()) + try + { + CUNOXWrapper::put_XInterface(pXInterface); + if (pUNOInterface == nullptr) + return E_INVALIDARG; + + Reference<XAccessibleContext> xContext = pUNOInterface->getAccessibleContext(); + if (!xContext.is()) + return E_FAIL; + + // retrieve reference to table (parent of the cell) + Reference<XAccessibleContext> xParentContext + = xContext->getAccessibleParent()->getAccessibleContext(); + Reference<XAccessibleTable> xTable(xParentContext, UNO_QUERY); + + if (!xTable.is()) + { + m_xTable.clear(); + return E_FAIL; + } + + m_xTable = xTable; + m_nIndexInParent = xContext->getAccessibleIndexInParent(); + return S_OK; + } + catch (...) { - m_xTable.clear(); return E_FAIL; } - - m_xTable = xTable; - m_nIndexInParent = xContext->getAccessibleIndexInParent(); - return S_OK; - - LEAVE_PROTECTED_BLOCK } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_columnExtent(long* pColumnsSpanned) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - if (pColumnsSpanned == nullptr) - return E_INVALIDARG; - - if (!m_xTable.is()) - return E_FAIL; + try + { + if (pColumnsSpanned == nullptr) + return E_INVALIDARG; - long nRow = 0, nColumn = 0; - get_rowIndex(&nRow); - get_columnIndex(&nColumn); + if (!m_xTable.is()) + return E_FAIL; - *pColumnsSpanned = m_xTable->getAccessibleColumnExtentAt(nRow, nColumn); - return S_OK; + long nRow = 0, nColumn = 0; + get_rowIndex(&nRow); + get_columnIndex(&nColumn); - LEAVE_PROTECTED_BLOCK + *pColumnsSpanned = m_xTable->getAccessibleColumnExtentAt(nRow, nColumn); + return S_OK; + } + catch (...) + { + return E_FAIL; + } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_columnIndex(long* pColumnIndex) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try + { + if (pColumnIndex == nullptr) + return E_INVALIDARG; - if (pColumnIndex == nullptr) - return E_INVALIDARG; + if (!m_xTable.is()) + return E_FAIL; - if (!m_xTable.is()) + *pColumnIndex = m_xTable->getAccessibleColumn(m_nIndexInParent); + return S_OK; + } + catch (...) + { return E_FAIL; - - *pColumnIndex = m_xTable->getAccessibleColumn(m_nIndexInParent); - return S_OK; - - LEAVE_PROTECTED_BLOCK + } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_rowExtent(long* pRowsSpanned) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - if (pRowsSpanned == nullptr) - return E_INVALIDARG; - - if (!m_xTable.is()) - return E_FAIL; + try + { + if (pRowsSpanned == nullptr) + return E_INVALIDARG; - long nRow = 0, nColumn = 0; - get_rowIndex(&nRow); - get_columnIndex(&nColumn); + if (!m_xTable.is()) + return E_FAIL; - *pRowsSpanned = m_xTable->getAccessibleRowExtentAt(nRow, nColumn); + long nRow = 0, nColumn = 0; + get_rowIndex(&nRow); + get_columnIndex(&nColumn); - return S_OK; + *pRowsSpanned = m_xTable->getAccessibleRowExtentAt(nRow, nColumn); - LEAVE_PROTECTED_BLOCK + return S_OK; + } + catch (...) + { + return E_FAIL; + } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_rowIndex(long* pRowIndex) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try + { + if (pRowIndex == nullptr) + return E_INVALIDARG; - if (pRowIndex == nullptr) - return E_INVALIDARG; + if (!m_xTable.is()) + return E_FAIL; - if (!m_xTable.is()) + *pRowIndex = m_xTable->getAccessibleRow(m_nIndexInParent); + return S_OK; + } + catch (...) + { return E_FAIL; - - *pRowIndex = m_xTable->getAccessibleRow(m_nIndexInParent); - return S_OK; - - LEAVE_PROTECTED_BLOCK + } } COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_isSelected(boolean* pIsSelected) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - if (pIsSelected == nullptr) - return E_INVALIDARG; - - if (!m_xTable.is()) - return E_FAIL; + try + { + if (pIsSelected == nullptr) + return E_INVALIDARG; - long nRow = 0, nColumn = 0; - get_rowIndex(&nRow); - get_columnIndex(&nColumn); + if (!m_xTable.is()) + return E_FAIL; - *pIsSelected = m_xTable->isAccessibleSelected(nRow, nColumn); - return S_OK; + long nRow = 0, nColumn = 0; + get_rowIndex(&nRow); + get_columnIndex(&nColumn); - LEAVE_PROTECTED_BLOCK + *pIsSelected = m_xTable->isAccessibleSelected(nRow, nColumn); + return S_OK; + } + catch (...) + { + return E_FAIL; + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx index a71431fc1d22..a1f371a47ec9 100644 --- a/winaccessibility/source/UAccCOM/AccTextBase.cxx +++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx @@ -94,7 +94,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_addSelection(long startOffse { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK XInterface# if(pUNOInterface == nullptr) @@ -115,7 +115,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_addSelection(long startOffse return S_OK; } - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -130,7 +130,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_attributes(long offset, long { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (startOffset == nullptr || endOffset == nullptr || textAttributes == nullptr) return E_INVALIDARG; @@ -233,7 +233,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_attributes(long offset, long return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -245,7 +245,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_caretOffset(long * offset) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (offset == nullptr) return E_INVALIDARG; @@ -259,7 +259,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_caretOffset(long * offset) *offset = GetXInterface()->getCaretPosition(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -271,7 +271,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_characterCount(long * nChara { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (nCharacters == nullptr) return E_INVALIDARG; @@ -285,7 +285,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_characterCount(long * nChara *nCharacters = GetXInterface()->getCharacterCount(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -301,7 +301,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_characterExtents(long offset { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (x == nullptr || height == nullptr || y == nullptr || width == nullptr) return E_INVALIDARG; @@ -361,7 +361,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_characterExtents(long offset return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -373,7 +373,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_nSelections(long * nSelectio { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (nSelections == nullptr) return E_INVALIDARG; @@ -404,7 +404,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_nSelections(long * nSelectio *nSelections = 0; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -419,7 +419,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_offsetAtPoint(long x, long y { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (offset == nullptr) return E_INVALIDARG; @@ -433,7 +433,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_offsetAtPoint(long x, long y *offset = GetXInterface()->getIndexAtPoint(point); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -448,7 +448,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_selection(long selectionInde { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (startOffset == nullptr || endOffset == nullptr ) return E_INVALIDARG; @@ -483,7 +483,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_selection(long selectionInde *endOffset = 0; return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -497,7 +497,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_text(long startOffset, long { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (text == nullptr) return E_INVALIDARG; @@ -528,7 +528,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_text(long startOffset, long *text = SysAllocString(o3tl::toW(ouStr.getStr())); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -544,7 +544,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textBeforeOffset(long offset { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK# if (startOffset == nullptr || endOffset == nullptr || text == nullptr) @@ -575,7 +575,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textBeforeOffset(long offset return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -591,7 +591,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textAfterOffset(long offset, { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (startOffset == nullptr || endOffset == nullptr || text == nullptr) return E_INVALIDARG; @@ -621,7 +621,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textAfterOffset(long offset, return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -637,7 +637,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textAtOffset(long offset, IA { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (startOffset == nullptr || text == nullptr ||endOffset == nullptr) return E_INVALIDARG; @@ -667,7 +667,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textAtOffset(long offset, IA return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -680,7 +680,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::removeSelection(long selectionIn { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK XInterface# if(pUNOInterface == nullptr) @@ -703,7 +703,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::removeSelection(long selectionIn return S_OK; } - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -716,7 +716,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::setCaretOffset(long offset) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK XInterface# if(!pRXText.is()) @@ -726,7 +726,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::setCaretOffset(long offset) return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -741,7 +741,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::setSelection(long, long startOff { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK XInterface# if(!pRXText.is()) @@ -753,7 +753,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::setSelection(long, long startOff return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -765,7 +765,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_nCharacters(long * nCharacte { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { if (nCharacters == nullptr) return E_INVALIDARG; @@ -780,7 +780,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_nCharacters(long * nCharacte return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } // added by qiuhd, 2006/07/03, for direver 07/11 @@ -809,7 +809,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::scrollSubstringTo(long startInde { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { // #CHECK XInterface# if(!pRXText.is()) @@ -849,7 +849,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::scrollSubstringTo(long startInde return E_NOTIMPL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -861,7 +861,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::put_XInterface(hyper pXInterface { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK + try { CUNOXWrapper::put_XInterface(pXInterface); //special query. @@ -879,7 +879,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::put_XInterface(hyper pXInterface pRXText = pRXI; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } static OUString ReplaceOneChar(OUString const & oldOUString, sal_Unicode replacedChar, std::u16string_view replaceStr) diff --git a/winaccessibility/source/UAccCOM/AccValue.cxx b/winaccessibility/source/UAccCOM/AccValue.cxx index 81fcf0b026db..c18440e6558f 100644 --- a/winaccessibility/source/UAccCOM/AccValue.cxx +++ b/winaccessibility/source/UAccCOM/AccValue.cxx @@ -48,21 +48,24 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccValue::get_currentValue(VARIANT* currentVa { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - if (currentValue == nullptr) - return E_INVALIDARG; - if (!pRXVal.is()) - return E_FAIL; - - // Get Any type value from UNO. - css::uno::Any anyVal = GetXInterface()->getCurrentValue(); - // Convert Any to VARIANT. - CMAccessible::ConvertAnyToVariant(anyVal, currentValue); + try + { + if (currentValue == nullptr) + return E_INVALIDARG; + if (!pRXVal.is()) + return E_FAIL; - return S_OK; + // Get Any type value from UNO. + css::uno::Any anyVal = GetXInterface()->getCurrentValue(); + // Convert Any to VARIANT. + CMAccessible::ConvertAnyToVariant(anyVal, currentValue); - LEAVE_PROTECTED_BLOCK + return S_OK; + } + catch (...) + { + return E_FAIL; + } } /** @@ -75,74 +78,77 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccValue::setCurrentValue(VARIANT value) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - if (!pRXVal.is()) - return E_FAIL; - - HRESULT hRet = S_OK; - css::uno::Any anyVal; - - // Set value according to value type. - switch (value.vt) + try { - case VT_UI1: - { - anyVal <<= sal_Unicode(value.bVal); - } - break; + if (!pRXVal.is()) + return E_FAIL; - case VT_BOOL: - { - css::uno::Type typeInfo(TypeClass_BOOLEAN, "bool"); - anyVal.setValue(&value.boolVal, typeInfo); - } - break; + HRESULT hRet = S_OK; + css::uno::Any anyVal; - case VT_I2: + // Set value according to value type. + switch (value.vt) { - css::uno::Type typeInfo(TypeClass_SHORT, "short"); - anyVal.setValue(&value.iVal, typeInfo); + case VT_UI1: + { + anyVal <<= sal_Unicode(value.bVal); + } + break; + + case VT_BOOL: + { + css::uno::Type typeInfo(TypeClass_BOOLEAN, "bool"); + anyVal.setValue(&value.boolVal, typeInfo); + } + break; + + case VT_I2: + { + css::uno::Type typeInfo(TypeClass_SHORT, "short"); + anyVal.setValue(&value.iVal, typeInfo); + } + break; + + case VT_I4: + { + css::uno::Type typeInfo(TypeClass_LONG, "long"); + anyVal.setValue(&value.lVal, typeInfo); + } + break; + + case VT_R4: + { + css::uno::Type typeInfo(TypeClass_FLOAT, "float"); + anyVal.setValue(&value.fltVal, typeInfo); + } + break; + + case VT_R8: + { + css::uno::Type typeInfo(TypeClass_DOUBLE, "double"); + anyVal.setValue(&value.dblVal, typeInfo); + } + break; + + default: + { + // Unsupported type conversion. + hRet = E_FAIL; + } + break; } - break; - case VT_I4: + if (hRet == S_OK) { - css::uno::Type typeInfo(TypeClass_LONG, "long"); - anyVal.setValue(&value.lVal, typeInfo); + hRet = pRXVal->setCurrentValue(anyVal) ? S_OK : E_FAIL; } - break; - case VT_R4: - { - css::uno::Type typeInfo(TypeClass_FLOAT, "float"); - anyVal.setValue(&value.fltVal, typeInfo); - } - break; - - case VT_R8: - { - css::uno::Type typeInfo(TypeClass_DOUBLE, "double"); - anyVal.setValue(&value.dblVal, typeInfo); - } - break; - - default: - { - // Unsupported type conversion. - hRet = E_FAIL; - } - break; + return hRet; } - - if (hRet == S_OK) + catch (...) { - hRet = pRXVal->setCurrentValue(anyVal) ? S_OK : E_FAIL; + return E_FAIL; } - - return hRet; - - LEAVE_PROTECTED_BLOCK } /** @@ -154,21 +160,24 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccValue::get_maximumValue(VARIANT* maximumVa { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - if (maximumValue == nullptr) - return E_INVALIDARG; - if (!pRXVal.is()) - return E_FAIL; - - // Get Any type value from UNO. - css::uno::Any anyVal = GetXInterface()->getMaximumValue(); - // Convert Any to VARIANT. - CMAccessible::ConvertAnyToVariant(anyVal, maximumValue); + try + { + if (maximumValue == nullptr) + return E_INVALIDARG; + if (!pRXVal.is()) + return E_FAIL; - return S_OK; + // Get Any type value from UNO. + css::uno::Any anyVal = GetXInterface()->getMaximumValue(); + // Convert Any to VARIANT. + CMAccessible::ConvertAnyToVariant(anyVal, maximumValue); - LEAVE_PROTECTED_BLOCK + return S_OK; + } + catch (...) + { + return E_FAIL; + } } /** @@ -180,21 +189,24 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccValue::get_minimumValue(VARIANT* minimumVa { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - - if (minimumValue == nullptr) - return E_FAIL; - if (!pRXVal.is()) - return E_FAIL; - - // Get Any type value from UNO. - css::uno::Any anyVal = GetXInterface()->getMinimumValue(); - // Convert Any to VARIANT. - CMAccessible::ConvertAnyToVariant(anyVal, minimumValue); + try + { + if (minimumValue == nullptr) + return E_FAIL; + if (!pRXVal.is()) + return E_FAIL; - return S_OK; + // Get Any type value from UNO. + css::uno::Any anyVal = GetXInterface()->getMinimumValue(); + // Convert Any to VARIANT. + CMAccessible::ConvertAnyToVariant(anyVal, minimumValue); - LEAVE_PROTECTED_BLOCK + return S_OK; + } + catch (...) + { + return E_FAIL; + } } /** @@ -206,25 +218,28 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccValue::put_XInterface(hyper pXInterface) { // internal IUNOXWrapper - no mutex meeded - ENTER_PROTECTED_BLOCK - - CUNOXWrapper::put_XInterface(pXInterface); - //special query. - if (pUNOInterface == nullptr) - return E_FAIL; - Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext(); - if (!pRContext.is()) + try + { + CUNOXWrapper::put_XInterface(pXInterface); + //special query. + if (pUNOInterface == nullptr) + return E_FAIL; + Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext(); + if (!pRContext.is()) + { + return E_FAIL; + } + Reference<XAccessibleValue> pRXI(pRContext, UNO_QUERY); + if (!pRXI.is()) + pRXVal = nullptr; + else + pRXVal = pRXI.get(); + return S_OK; + } + catch (...) { return E_FAIL; } - Reference<XAccessibleValue> pRXI(pRContext, UNO_QUERY); - if (!pRXI.is()) - pRXVal = nullptr; - else - pRXVal = pRXI.get(); - return S_OK; - - LEAVE_PROTECTED_BLOCK } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 972ab9426933..11ad99d13542 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -187,10 +187,6 @@ short const UNO_STATES[] = using namespace com::sun::star::accessibility::AccessibleRole; -#define ISDESTROY() \ - if(m_isDestroy) \ - return S_FALSE; - AccObjectManagerAgent* CMAccessible::g_pAgent = nullptr; @@ -253,8 +249,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accParent(IDispatch **ppdisp { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(ppdispParent == nullptr) { @@ -278,7 +274,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accParent(IDispatch **ppdisp } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -290,8 +286,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accChildCount(long *pcountCh { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pcountChildren == nullptr) { @@ -310,7 +306,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accChildCount(long *pcountCh return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -324,8 +320,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accChild(VARIANT varChild, I { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(ppdispChild == nullptr) { @@ -348,7 +344,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accChild(VARIANT varChild, I } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -362,8 +358,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accName(VARIANT varChild, BS { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pszName == nullptr) { @@ -387,7 +383,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accName(VARIANT varChild, BS } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -401,8 +397,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accValue(VARIANT varChild, B { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if( pszValue == nullptr ) { @@ -432,7 +428,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accValue(VARIANT varChild, B } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -446,8 +442,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accDescription(VARIANT varCh { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pszDescription == nullptr) { @@ -479,7 +475,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accDescription(VARIANT varCh } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -493,8 +489,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accRole(VARIANT varChild, VA { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarRole == nullptr) { @@ -526,7 +522,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accRole(VARIANT varChild, VA } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -540,8 +536,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accState(VARIANT varChild, V { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarState == nullptr) { @@ -586,7 +582,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accState(VARIANT varChild, V } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -641,9 +637,9 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { - ISDESTROY() + if (m_isDestroy) return S_FALSE; // #CHECK# if(pszKeyboardShortcut == nullptr) { @@ -781,7 +777,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -794,8 +790,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarChild == nullptr) { @@ -822,7 +818,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild) } return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -837,8 +833,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accSelection(VARIANT *pvarCh { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarChildren == nullptr) { @@ -871,7 +867,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accSelection(VARIANT *pvarCh } return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -888,8 +884,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accLocation(long *pxLeft, long * { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pxLeft == nullptr || pyTop == nullptr || pcxWidth == nullptr || pcyHeight == nullptr) { @@ -932,7 +928,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accLocation(long *pxLeft, long * } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -946,8 +942,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accNavigate(long navDir, VARIANT { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarEndUpAt == nullptr) { @@ -981,15 +977,15 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accNavigate(long navDir, VARIANT } return ret; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accHitTest(long xLeft, long yTop, VARIANT *pvarChild) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarChild == nullptr) { @@ -1036,7 +1032,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accHitTest(long xLeft, long yTop } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1063,8 +1059,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::put_accName(VARIANT varChild, BS { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(varChild.vt==VT_I4) { if(varChild.lVal==CHILDID_SELF) @@ -1083,7 +1079,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::put_accName(VARIANT varChild, BS } return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1097,8 +1093,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::put_accValue(VARIANT varChild, B { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(varChild.vt==VT_I4) { if(varChild.lVal==CHILDID_SELF) @@ -1117,7 +1113,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::put_accValue(VARIANT varChild, B } return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1129,8 +1125,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccName(const OLECHAR __RPC { // internal IMAccessible - no mutex meeded - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pszName == nullptr) { @@ -1143,7 +1139,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccName(const OLECHAR __RPC return E_FAIL; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1207,8 +1203,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccValue(const OLECHAR __RP { // internal IMAccessible - no mutex meeded - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pszAccValue == nullptr) { @@ -1220,7 +1216,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccValue(const OLECHAR __RP return E_FAIL; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1233,12 +1229,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccWindowHandle(HWND hwnd) { // internal IMAccessible - no mutex meeded - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; m_hwnd = hwnd; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1250,8 +1246,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccFocus(long dChildID) { // internal IMAccessible - no mutex meeded - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(dChildID==CHILDID_SELF) { @@ -1272,7 +1268,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccFocus(long dChildID) } return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1492,8 +1488,8 @@ IMAccessible* CMAccessible::GetNavigateChildForDM(VARIANT varCur, short flags) HRESULT CMAccessible::GetFirstChild(VARIANT varStart,VARIANT* pvarEndUpAt) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarEndUpAt == nullptr) { @@ -1516,7 +1512,7 @@ HRESULT CMAccessible::GetFirstChild(VARIANT varStart,VARIANT* pvarEndUpAt) pvarEndUpAt->vt = VT_EMPTY; return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1529,8 +1525,8 @@ HRESULT CMAccessible::GetFirstChild(VARIANT varStart,VARIANT* pvarEndUpAt) HRESULT CMAccessible::GetLastChild(VARIANT varStart,VARIANT* pvarEndUpAt) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarEndUpAt == nullptr) { @@ -1552,7 +1548,7 @@ HRESULT CMAccessible::GetLastChild(VARIANT varStart,VARIANT* pvarEndUpAt) pvarEndUpAt->vt = VT_EMPTY; return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1565,8 +1561,8 @@ HRESULT CMAccessible::GetLastChild(VARIANT varStart,VARIANT* pvarEndUpAt) HRESULT CMAccessible::GetNextSibling(VARIANT varStart,VARIANT* pvarEndUpAt) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(varStart.vt != VT_I4) { pvarEndUpAt->vt = VT_EMPTY; @@ -1588,7 +1584,7 @@ HRESULT CMAccessible::GetNextSibling(VARIANT varStart,VARIANT* pvarEndUpAt) pvarEndUpAt->vt = VT_EMPTY; return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1600,8 +1596,8 @@ HRESULT CMAccessible::GetNextSibling(VARIANT varStart,VARIANT* pvarEndUpAt) HRESULT CMAccessible::GetPreSibling(VARIANT varStart,VARIANT* pvarEndUpAt) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pvarEndUpAt == nullptr) { @@ -1628,7 +1624,7 @@ HRESULT CMAccessible::GetPreSibling(VARIANT varStart,VARIANT* pvarEndUpAt) pvarEndUpAt->vt = VT_EMPTY; return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -1638,8 +1634,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR * { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(nRelations == nullptr) @@ -1662,15 +1658,15 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR * *nRelations = pRrelationSet->getRelationCount(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(relation == nullptr) { @@ -1724,15 +1720,15 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_relation( long relationIndex return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation, long __RPC_FAR *nRelations) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(relation == nullptr || nRelations == nullptr) @@ -1785,20 +1781,20 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_relations( long, IAccessible *nRelations = nCount; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::role(long __RPC_FAR *role) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK + try { (*role) = m_iRole; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } @@ -1808,7 +1804,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_nActions(long __RPC_FAR *nAc try { - ISDESTROY() + if (m_isDestroy) return S_FALSE; // #CHECK# if(nActions == nullptr) { @@ -1869,8 +1865,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_groupPosition(long __RPC_FAR { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(groupLevel == nullptr || similarItemsInGroup == nullptr || positionInGroup == nullptr) { @@ -2038,7 +2034,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_groupPosition(long __RPC_FAR } return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_extendedStates(long, BSTR __RPC_FAR *__RPC_FAR *, long __RPC_FAR *) @@ -2051,8 +2047,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_uniqueID(long __RPC_FAR *uni { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(uniqueID == nullptr) { @@ -2061,15 +2057,15 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_uniqueID(long __RPC_FAR *uni *uniqueID = m_dChildID; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_windowHandle(HWND __RPC_FAR *windowHandle) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(windowHandle == nullptr) { @@ -2092,7 +2088,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_windowHandle(HWND __RPC_FAR *windowHandle = nHwnd; return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2141,8 +2137,8 @@ Reference< XAccessibleSelection > CMAccessible::GetSelection() HRESULT CMAccessible::SelectChild(XAccessible* pItem) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; XAccessibleContext* pParentContext = GetContextByXAcc(m_xAccessible.get()); XAccessibleContext* pContext = GetContextByXAcc( pItem ); if( pParentContext == nullptr || pContext == nullptr ) @@ -2155,7 +2151,7 @@ HRESULT CMAccessible::SelectChild(XAccessible* pItem) pRSelection->selectAccessibleChild( Index ); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2166,8 +2162,8 @@ HRESULT CMAccessible::SelectChild(XAccessible* pItem) HRESULT CMAccessible::DeSelectChild(XAccessible* pItem) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; XAccessibleContext* pParentContext = GetContextByXAcc(m_xAccessible.get()); ; XAccessibleContext* pContext = GetContextByXAcc( pItem ); @@ -2182,7 +2178,7 @@ HRESULT CMAccessible::DeSelectChild(XAccessible* pItem) return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2194,8 +2190,8 @@ HRESULT CMAccessible::DeSelectChild(XAccessible* pItem) HRESULT CMAccessible::SelectMultipleChidren( XAccessible** pItem,int size ) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pItem == nullptr) { @@ -2207,7 +2203,7 @@ HRESULT CMAccessible::SelectMultipleChidren( XAccessible** pItem,int size ) } return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2219,8 +2215,8 @@ HRESULT CMAccessible::SelectMultipleChidren( XAccessible** pItem,int size ) HRESULT CMAccessible::DeSelectMultipleChildren( XAccessible** pItem,int size ) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pItem == nullptr) { @@ -2232,7 +2228,7 @@ HRESULT CMAccessible::DeSelectMultipleChildren( XAccessible** pItem,int size ) } return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2267,8 +2263,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accSelect(long flagsSelect, VARI { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if( (flagsSelect&SELFLAG_ADDSELECTION) && (SELFLAG_REMOVESELECTION&flagsSelect) ) return E_INVALIDARG; @@ -2352,7 +2348,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::accSelect(long flagsSelect, VARI pSelectAcc->Release(); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2395,8 +2391,8 @@ COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE CMAccessible::get_accDefaultActio { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(pszDefaultAction == nullptr) { @@ -2422,7 +2418,7 @@ COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE CMAccessible::get_accDefaultActio } return S_FALSE; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2434,8 +2430,8 @@ COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE CMAccessible::accDoDefaultAction( { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if( varChild.vt != VT_I4 ) return E_INVALIDARG; if (!m_xAction.is()) @@ -2457,7 +2453,7 @@ COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE CMAccessible::accDoDefaultAction( return E_FAIL; return pChild->accDoDefaultAction( varChild ); - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /** @@ -2469,8 +2465,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_ActionDescription( const OLE { // internal IMAccessible - no mutex meeded - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(szAction == nullptr) { @@ -2480,7 +2476,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_ActionDescription( const OLE m_pszActionDescription = SysAllocString( szAction ); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } bool CMAccessible::GetXInterfaceFromXAccessible(XAccessible* pXAcc, XInterface** ppXI, XInterfaceType eType) @@ -2561,9 +2557,9 @@ static AggMapEntry g_CMAccessible_AggMap[] = { HRESULT WINAPI CMAccessible::SmartQI(void* /*pv*/, REFIID iid, void** ppvObject) { - ENTER_PROTECTED_BLOCK + try { - ISDESTROY() + if (m_isDestroy) return S_FALSE; if (InlineIsEqualGUID(iid,IID_IAccIdentity) || InlineIsEqualGUID(iid,IID_IStdMarshalInfo) || InlineIsEqualGUID(iid,IID_IMarshal) || @@ -2615,7 +2611,7 @@ HRESULT WINAPI CMAccessible::SmartQI(void* /*pv*/, REFIID iid, void** ppvObject) } return E_FAIL; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } bool CMAccessible::get_IAccessibleFromXAccessible(XAccessible* pXAcc, IAccessible** ppIA) @@ -2981,8 +2977,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_states(AccessibleStates __RP { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if (!m_xContext.is()) return E_FAIL; @@ -3012,7 +3008,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_states(AccessibleStates __RP return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } // return the UNO roles @@ -3040,8 +3036,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_localizedExtendedStates(long COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_indexInParent(long __RPC_FAR *accParentIndex) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; // #CHECK# if(accParentIndex == nullptr) return E_INVALIDARG; @@ -3053,12 +3049,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_indexInParent(long __RPC_FAR return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_locale( IA2Locale __RPC_FAR *locale ) { - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(locale == nullptr) return E_INVALIDARG; @@ -3072,57 +3068,57 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_locale( IA2Locale __RPC_FAR return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_appName(BSTR __RPC_FAR *name) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(name == nullptr) return E_INVALIDARG; *name = SysAllocString(OLESTR("Hannover")); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_appVersion(BSTR __RPC_FAR *version) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(version == nullptr) return E_INVALIDARG; *version=SysAllocString(OLESTR("3.0")); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_toolkitName(BSTR __RPC_FAR *name) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(name == nullptr) return E_INVALIDARG; *name = SysAllocString(OLESTR(" ")); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_toolkitVersion(BSTR __RPC_FAR *version) { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if(version == nullptr) return E_INVALIDARG; *version = SysAllocString(OLESTR(" ")); return S_OK; - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } @@ -3130,8 +3126,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *p { SolarMutexGuard g; - ENTER_PROTECTED_BLOCK - ISDESTROY() + try { + if (m_isDestroy) return S_FALSE; if (!m_xAccessible.is()) return E_FAIL; @@ -3159,7 +3155,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *p return S_OK; } - LEAVE_PROTECTED_BLOCK + } catch(...) { return E_FAIL; } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/stdafx.h b/winaccessibility/source/UAccCOM/stdafx.h index b31de7a3f0d6..53044645f326 100644 --- a/winaccessibility/source/UAccCOM/stdafx.h +++ b/winaccessibility/source/UAccCOM/stdafx.h @@ -59,17 +59,6 @@ extern CComModule _Module; #undef OPAQUE -#define ENTER_PROTECTED_BLOCK \ - try \ - { - -#define LEAVE_PROTECTED_BLOCK \ - } \ - catch(...) \ - { \ - return E_FAIL; \ - } - //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line.