From 51a482bc0452003dbbd396cb39bb9c2b1261df64 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 22 Oct 2024 12:17:03 +0200 Subject: a11y: Return early in AccessibleTabBar::getAccessibleAtPoint Just return `xAcc` right away instead of first assigning it to a local variable. Change-Id: If11c88266b4ec72b2d5d927e3f28a14bf0cdc304 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175404 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- accessibility/source/extended/accessibletabbar.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'accessibility') diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx index 55318298d1ae..2b1522f30a28 100644 --- a/accessibility/source/extended/accessibletabbar.cxx +++ b/accessibility/source/extended/accessibletabbar.cxx @@ -354,7 +354,6 @@ namespace accessibility { OExternalLockGuard aGuard( this ); - Reference< XAccessible > xChild; for( sal_Int64 i = 0; i < getAccessibleChildCount(); ++i ) { Reference< XAccessible > xAcc = getAccessibleChild( i ); @@ -367,14 +366,13 @@ namespace accessibility Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { - xChild = std::move(xAcc); - break; + return xAcc; } } } } - return xChild; + return nullptr; } void AccessibleTabBar::grabFocus( ) -- cgit