summaryrefslogtreecommitdiff
path: root/accessibility/source
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-10-28 08:43:20 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-10-28 12:13:56 +0100
commit9437babbcdcb9a33d82a091d57957e8ff8702db7 (patch)
tree08848ab3d295bbd11527c2443f814703d80bdb83 /accessibility/source
parentd8ab848c05c66695eba558530b0955221a3be886 (diff)
a11y: Return early in AccessibleGridControl::getAccessibleAtPoint
Change-Id: I0da4d4321f26e83fa8fba41ae49a4d23a0939e00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175712 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'accessibility/source')
-rw-r--r--accessibility/source/extended/AccessibleGridControl.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index 483b75ed4c8f..6dcd09748d79 100644
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -146,16 +146,15 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint )
SolarMutexGuard aSolarGuard;
ensureIsAlive();
- css::uno::Reference< css::accessibility::XAccessible > xChild;
sal_Int32 nIndex = 0;
if (m_aTable.ConvertPointToControlIndex(nIndex, VCLUnoHelper::ConvertToVCLPoint(rPoint)))
- xChild = m_aTable.CreateAccessibleControl( nIndex );
+ return m_aTable.CreateAccessibleControl(nIndex);
else
{
// try whether point is in one of the fixed children
// (table, header bars, corner control)
Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint));
- for( nIndex = 0; (nIndex < 3) && !xChild.is(); ++nIndex )
+ for (nIndex = 0; nIndex < 3; ++nIndex)
{
css::uno::Reference< css::accessibility::XAccessible > xCurrChild( implGetFixedChild( nIndex ) );
css::uno::Reference< css::accessibility::XAccessibleComponent >
@@ -163,10 +162,10 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint )
if (xCurrChildComp.is()
&& VCLUnoHelper::ConvertToVCLRect(xCurrChildComp->getBounds()).Contains(aPoint))
- xChild = std::move(xCurrChild);
+ return xCurrChild;
}
}
- return xChild;
+ return nullptr;
}