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 <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2026-09-20 22:18:21 +02:00
parent 70003dfd3e
commit 9d8f019f2e
@@ -495,20 +495,18 @@ tools::Rectangle ScAccessibleEditControlObject::GetBoundingBox()
{
tools::Rectangle aBounds( GetBoundingBoxOnScreen() );
uno::Reference<XAccessibleContext> xContext = getAccessibleContext();
if ( xContext.is() )
uno::Reference<XAccessible> xParent(getAccessibleParent());
if (xParent.is())
{
uno::Reference< XAccessible > xParent( xContext->getAccessibleParent() );
if ( xParent.is() )
uno::Reference<XAccessibleComponent> 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);
}
}