diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-23 14:52:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-23 22:14:12 +0200 |
commit | 5366811e24532ae0f6b124a2eb85021b59d47f4b (patch) | |
tree | fcbfc4426dc777780e9192c813018015f7167200 | |
parent | 1333600682019891efdb4acf51c4c1a9b7d3532d (diff) |
use get_accessible_location_on_screen to get position
instead of digging into parent a11y via getAccessibleParent which
isn't there when hosted in a gtk widget
Change-Id: I417737ae568c823b550bc259c3b3047124a411ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114552
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | svx/source/dialog/weldeditview.cxx | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 5c6c81c9aa60..ebd608ff3624 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -561,22 +561,11 @@ public: css::awt::Point aScreenLoc(0, 0); - css::uno::Reference<css::accessibility::XAccessible> xParent(getAccessibleParent()); - if (xParent) + if (weld::DrawingArea* pDrawingArea = m_pController->GetDrawingArea()) { - css::uno::Reference<css::accessibility::XAccessibleContext> xParentContext( - xParent->getAccessibleContext()); - css::uno::Reference<css::accessibility::XAccessibleComponent> xParentComponent( - xParentContext, css::uno::UNO_QUERY); - OSL_ENSURE(xParentComponent.is(), - "WeldEditAccessible::getLocationOnScreen: no parent component!"); - if (xParentComponent.is()) - { - css::awt::Point aParentScreenLoc(xParentComponent->getLocationOnScreen()); - css::awt::Point aOwnRelativeLoc(getLocation()); - aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X; - aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y; - } + Point aPos = pDrawingArea->get_accessible_location_on_screen(); + aScreenLoc.X = aPos.X(); + aScreenLoc.Y = aPos.Y(); } return aScreenLoc; |