diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-08-09 10:08:14 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-08-09 15:45:35 +0200 |
commit | 63a004f51f063cad68c007d79d5cd4f56adde96b (patch) | |
tree | 1f750bd25c5101ec1a8068d8bb1b7cd07c45d5a4 /winaccessibility/source/UAccCOM/EnumVariant.cxx | |
parent | d2c1a4fa508572cc2908787deeebc5baa9d6e0c3 (diff) |
wina11y: Use return value instead of out param
... to return the `IAccessible*` in
`AccObjectWinManager::GetIAccessibleFromXAccessible` and
`CMAccessible::get_IAccessibleFromXAccessible` and adapt
the call sites accordingly.
This is more straight-forward and the extra bool return
value didn't add anything, since it was also just
saying whether the pointer was a nullptr, so rather
check that directly.
Also drop `AccObjectWinManager::GetIMAccByXAcc` that
does the same thing and switch the only call site
to use `AccObjectWinManager::GetIAccessibleFromXAccessible`
instead.
Change-Id: I72933df62aa9ac1ff3f2a84c5045dfae354c18e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155505
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'winaccessibility/source/UAccCOM/EnumVariant.cxx')
-rw-r--r-- | winaccessibility/source/UAccCOM/EnumVariant.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/winaccessibility/source/UAccCOM/EnumVariant.cxx b/winaccessibility/source/UAccCOM/EnumVariant.cxx index 5f26159cef7f..cdac95f6b34b 100644 --- a/winaccessibility/source/UAccCOM/EnumVariant.cxx +++ b/winaccessibility/source/UAccCOM/EnumVariant.cxx @@ -64,10 +64,8 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR * for (l1 = m_nCurrent, l2 = 0; l1 < nChildCount && l2 < cElements; l1++, l2++) { Reference< XAccessible > pRXAcc = m_pXAccessibleSelection->getSelectedAccessibleChild(l1); - IAccessible* pChild = nullptr; - bool isGet = CMAccessible::get_IAccessibleFromXAccessible(pRXAcc.get(), - &pChild); - if(isGet) + IAccessible* pChild = CMAccessible::get_IAccessibleFromXAccessible(pRXAcc.get()); + if(pChild) { pvar[l2].vt = VT_DISPATCH; pvar[l2].pdispVal = pChild; @@ -77,9 +75,8 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR * { if (CMAccessible::g_pAccObjectManager) CMAccessible::g_pAccObjectManager->InsertAccObj(pRXAcc.get(),pUNOInterface); - isGet = CMAccessible::get_IAccessibleFromXAccessible( - pRXAcc.get(), &pChild); - if(isGet) + pChild = CMAccessible::get_IAccessibleFromXAccessible(pRXAcc.get()); + if(pChild) { pvar[l2].vt = VT_DISPATCH; pvar[l2].pdispVal = pChild; |