sfx2/source/control/thumbnailviewacc.cxx |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

New commits:
commit ca512f301faf42b7d23675ca251b20e0ad67db1b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Sep 9 12:09:23 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Sep 9 14:29:34 2021 +0200

    Resolves: tdf#144389 get_accessible_parent should only be called on vcl 
impls
    
    Change-Id: If5d8718fcd9bcccee37e162a99cc68ff4a77de8f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121847
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sfx2/source/control/thumbnailviewacc.cxx 
b/sfx2/source/control/thumbnailviewacc.cxx
index 453f67a8d5b4..468a93cf66f6 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -824,30 +824,19 @@ awt::Point SAL_CALL ThumbnailViewItemAcc::getLocation()
     return aRet;
 }
 
+// get position of the accessible parent in screen coordinates
 awt::Point SAL_CALL ThumbnailViewItemAcc::getLocationOnScreen()
 {
     const SolarMutexGuard aSolarGuard;
     awt::Point          aRet;
 
-    if( mpParent )
+    if (mpParent)
     {
         const Point aPos = mpParent->getDrawArea().TopLeft();
+        const Point 
aScreenPos(mpParent->mrParent.GetDrawingArea()->get_accessible_location_on_screen());
 
-        aRet.X = aPos.X();
-        aRet.Y = aPos.Y();
-
-        // get position of the accessible parent in screen coordinates
-        uno::Reference< XAccessible > xParent = getAccessibleParent();
-        if ( xParent.is() )
-        {
-            uno::Reference<XAccessibleComponent> 
xParentComponent(xParent->getAccessibleContext(), uno::UNO_QUERY);
-            if (xParentComponent.is())
-            {
-                awt::Point aParentScreenLoc = 
xParentComponent->getLocationOnScreen();
-                aRet.X += aParentScreenLoc.X;
-                aRet.Y += aParentScreenLoc.Y;
-            }
-        }
+        aRet.X = aPos.X() + aScreenPos.X();
+        aRet.Y = aPos.Y() + aScreenPos.X();
     }
 
     return aRet;

Reply via email to