From 9d8f019f2ebe5eac1284cef6a3998397f073f498 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Sat, 19 Sep 2026 12:41:34 +0200 Subject: [PATCH] sc a11y: Drop redundant OAccessible::getAccessibleContext call It returns a reference to itself, so is not needed here. Change-Id: If474740c54f50084ad6f32fde6727ef6df076a9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211209 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- .../ui/Accessibility/AccessibleEditObject.cxx | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index abae71616cc9..aac349b54cee 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -495,20 +495,18 @@ tools::Rectangle ScAccessibleEditControlObject::GetBoundingBox() { tools::Rectangle aBounds( GetBoundingBoxOnScreen() ); - uno::Reference xContext = getAccessibleContext(); - if ( xContext.is() ) + uno::Reference xParent(getAccessibleParent()); + if (xParent.is()) { - uno::Reference< XAccessible > xParent( xContext->getAccessibleParent() ); - if ( xParent.is() ) + uno::Reference xParentComponent(xParent->getAccessibleContext(), + uno::UNO_QUERY); + if (xParentComponent.is()) { - uno::Reference< XAccessibleComponent > xParentComponent( xParent->getAccessibleContext(), uno::UNO_QUERY ); - if ( xParentComponent.is() ) - { - Point aScreenLoc = aBounds.TopLeft(); - awt::Point aParentScreenLoc = xParentComponent->getLocationOnScreen(); - Point aPos( aScreenLoc.getX() - aParentScreenLoc.X, aScreenLoc.getY() - aParentScreenLoc.Y ); - aBounds.SetPos( aPos ); - } + Point aScreenLoc = aBounds.TopLeft(); + awt::Point aParentScreenLoc = xParentComponent->getLocationOnScreen(); + Point aPos(aScreenLoc.getX() - aParentScreenLoc.X, + aScreenLoc.getY() - aParentScreenLoc.Y); + aBounds.SetPos(aPos); } }