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/service/AccObjectWinManager.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/service/AccObjectWinManager.cxx')
-rw-r--r-- | winaccessibility/source/service/AccObjectWinManager.cxx | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index 963573628372..04f81875cd88 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -998,26 +998,13 @@ bool AccObjectWinManager::IsStateManageDescendant(XAccessible* pAccessible) * @param pXAcc XAccessible interface. * @return Com accobject interface. */ -IMAccessible* AccObjectWinManager::GetIMAccByXAcc(XAccessible* pXAcc) +IMAccessible* AccObjectWinManager::GetIAccessibleFromXAccessible(XAccessible* pXAcc) { AccObject* pAccObj = GetAccObjByXAcc(pXAcc); - if(pAccObj) - { + if (pAccObj) return pAccObj->GetIMAccessible(); - } - else - { - return nullptr; - } -} -bool AccObjectWinManager::GetIAccessibleFromXAccessible(css::accessibility::XAccessible* pXAcc, - IAccessible** ppIA) -{ - *ppIA = GetIMAccByXAcc(pXAcc); - if (*ppIA) - return true; - return false; + return nullptr; } /** |