summaryrefslogtreecommitdiff
path: root/winaccessibility/source
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-08-20 13:40:00 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-08-21 07:47:20 +0200
commitd02d8cf8957c08f479f612ffe3f731b8be46219c (patch)
treecdabf7c9752783d617a4f6ea264ff55532adbc11 /winaccessibility/source
parent353436b265d5e734a3f1a7d5e08d73c88dafb03d (diff)
wina11y: Just use ref instead of having extra pointer var
The extra null check for the pointer is also redundant, as there is a check for `xContext.is()` just above it. Change-Id: I9c0d0ab95c3031d8560506691e78e7994c5dce95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172121 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'winaccessibility/source')
-rw-r--r--winaccessibility/source/service/AccTopWindowListener.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx
index 0f403f3969d6..3d51db848ece 100644
--- a/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -132,11 +132,6 @@ void AccTopWindowListener::AddAllListeners(css::accessibility::XAccessible* pAcc
{
return;
}
- css::accessibility::XAccessibleContext* pAccessibleContext = xContext.get();
- if(pAccessibleContext == nullptr)
- {
- return;
- }
m_aAccObjectManager.InsertAccObj(pAccessible, pParentXAcc, pWND);
@@ -146,7 +141,7 @@ void AccTopWindowListener::AddAllListeners(css::accessibility::XAccessible* pAcc
}
- short role = pAccessibleContext->getAccessibleRole();
+ short role = xContext->getAccessibleRole();
if(css::accessibility::AccessibleRole::DOCUMENT == role ||
css::accessibility::AccessibleRole::DOCUMENT_PRESENTATION == role ||
css::accessibility::AccessibleRole::DOCUMENT_SPREADSHEET == role ||
@@ -158,11 +153,11 @@ void AccTopWindowListener::AddAllListeners(css::accessibility::XAccessible* pAcc
}
}
- sal_Int64 nCount = pAccessibleContext->getAccessibleChildCount();
+ sal_Int64 nCount = xContext->getAccessibleChildCount();
for (sal_Int64 i = 0; i < nCount; i++)
{
Reference<css::accessibility::XAccessible> xAccessible
- = pAccessibleContext->getAccessibleChild(i);
+ = xContext->getAccessibleChild(i);
if (xAccessible.is())
AddAllListeners(xAccessible.get(), pAccessible, pWND);