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/AccRelation.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/AccRelation.cxx')
-rw-r--r-- | winaccessibility/source/UAccCOM/AccRelation.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx b/winaccessibility/source/UAccCOM/AccRelation.cxx index ef3265000bab..2c815c674f24 100644 --- a/winaccessibility/source/UAccCOM/AccRelation.cxx +++ b/winaccessibility/source/UAccCOM/AccRelation.cxx @@ -108,12 +108,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_target(long targetIndex, IUn return E_FAIL; Reference<XAccessible> xRAcc(xTargets[targetIndex], UNO_QUERY); - IAccessible* pRet = nullptr; - - bool isGet = CMAccessible::get_IAccessibleFromXAccessible(xRAcc.get(), &pRet); - if(isGet) + IAccessible* pRet = CMAccessible::get_IAccessibleFromXAccessible(xRAcc.get()); + if (pRet) { - *target = /*(IAccessible2 *)*/pRet; + *target = pRet; pRet->AddRef(); return S_OK; } |