[Libreoffice-commits] core.git: svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 23 20:15:06 UTC 2021
svx/source/dialog/weldeditview.cxx | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
New commits:
commit 5366811e24532ae0f6b124a2eb85021b59d47f4b
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Apr 23 14:52:49 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Apr 23 22:14:12 2021 +0200
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 at redhat.com>
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;
More information about the Libreoffice-commits
mailing list