summaryrefslogtreecommitdiff
path: root/winaccessibility/source
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-12-05 13:07:06 +0000
committerMichael Weghorn <m.weghorn@posteo.de>2024-12-05 20:12:29 +0100
commiteed855d70317ce25d267c28b28c0f40f8e7b69cb (patch)
tree05fdf7c920f45f2758b81e336e90d56b0100b2e7 /winaccessibility/source
parentf40a68f58dd1fc8b4cbd89434559c3400e7bd39b (diff)
wina11y: Use existing references + drop duplicate checks
There's no need to have local raw pointer variables in addition to the existing References. Replace all uses of the former by using the latter and drop duplicate checks. Change-Id: I1339dabecbe8e1652e49df8ecd5ce2749b897f47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177888 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'winaccessibility/source')
-rw-r--r--winaccessibility/source/service/AccTopWindowListener.cxx27
1 files changed, 8 insertions, 19 deletions
diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx
index 181d7d8f4fa2..1b61a6436b15 100644
--- a/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -173,34 +173,23 @@ void AccTopWindowListener::windowClosed( const css::lang::EventObject& e )
return;
Reference< css::accessibility::XAccessible > xAccessible ( e.Source, UNO_QUERY );
- css::accessibility::XAccessible* pAccessible = xAccessible.get();
- if ( pAccessible == nullptr)
+ if (!xAccessible.is())
return;
- Reference<css::accessibility::XAccessibleContext> xContext = pAccessible->getAccessibleContext();
+ Reference<css::accessibility::XAccessibleContext> xContext = xAccessible->getAccessibleContext();
if(!xContext.is())
- {
return;
- }
- css::accessibility::XAccessibleContext* pAccessibleContext = xContext.get();
- short role = -1;
- if(pAccessibleContext != nullptr)
+ short role = xContext->getAccessibleRole();
+ if (role == css::accessibility::AccessibleRole::POPUP_MENU ||
+ role == css::accessibility::AccessibleRole::MENU)
{
- role = pAccessibleContext->getAccessibleRole();
-
- if (role == css::accessibility::AccessibleRole::POPUP_MENU ||
- role == css::accessibility::AccessibleRole::MENU)
- {
- m_aAccObjectManager.NotifyAccEvent(pAccessible, UnoMSAAEvent::MENUPOPUPEND);
- }
+ m_aAccObjectManager.NotifyAccEvent(xAccessible.get(), UnoMSAAEvent::MENUPOPUPEND);
}
-
- m_aAccObjectManager.DeleteChildrenAccObj( pAccessible );
+ m_aAccObjectManager.DeleteChildrenAccObj(xAccessible.get());
if( role != css::accessibility::AccessibleRole::POPUP_MENU )
- m_aAccObjectManager.DeleteAccObj( pAccessible );
-
+ m_aAccObjectManager.DeleteAccObj(xAccessible.get());
}
void AccTopWindowListener::windowMinimized( const css::lang::EventObject& )