From 59bab7c98bcf9603252d3c8d6ec2dc0754b7b44e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 9 Sep 2026 17:29:55 +0200 Subject: [PATCH] sw a11y: Drop local XAccessible var Just return the result directly instead of first assigning it to a local variable. Change-Id: Iaf7e6409d2843507b2c725a537145c7789ad15b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210614 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- sw/source/core/access/acccontext.cxx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index 183b2c63581a..fed4b5699776 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -722,8 +722,6 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAtPoint ThrowIfDisposed(); - uno::Reference< XAccessible > xAcc; - vcl::Window *pWin = GetWindow(); if (!pWin) { @@ -741,19 +739,13 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAtPoint const SwAccessibleChild aChild( GetChildAtPixel( aPixPoint, *(GetMap()) ) ); if( aChild.GetSwFrame() ) - { - xAcc = GetMap()->GetContext( aChild.GetSwFrame() ); - } - else if( aChild.GetDrawObject() ) - { - xAcc = GetMap()->GetContext( aChild.GetDrawObject(), this ); - } - else if ( aChild.GetWindow() ) - { - xAcc = aChild.GetWindow()->GetAccessible(); - } + return GetMap()->GetContext(aChild.GetSwFrame()); + if (aChild.GetDrawObject()) + return GetMap()->GetContext(aChild.GetDrawObject(), this); + if (aChild.GetWindow()) + return aChild.GetWindow()->GetAccessible(); - return xAcc; + return {}; } /**