summaryrefslogtreecommitdiff
path: root/winaccessibility/source/UAccCOM/AccComponentBase.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-03-23 11:22:30 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-03-23 11:14:03 +0100
commitc5c4dc5fc90e775537dd98439a581ba7764a4fd0 (patch)
tree0b943626427b1d1cc5c77c124558da164833c84e /winaccessibility/source/UAccCOM/AccComponentBase.cxx
parent7619bd3a386dfed2e03e257f42a543e1e7be76ef (diff)
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.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'winaccessibility/source/UAccCOM/AccComponentBase.cxx')
-rw-r--r--winaccessibility/source/UAccCOM/AccComponentBase.cxx106
1 files changed, 59 insertions, 47 deletions
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: */