[Libreoffice-commits] core.git: include/vcl svtools/source vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Thu May 31 20:06:43 UTC 2018


 include/vcl/weld.hxx                |    6 ++++--
 svtools/source/control/valueacc.cxx |   13 +++++--------
 svtools/source/control/valueset.cxx |    6 +++---
 vcl/source/app/salvtables.cxx       |    5 +++++
 vcl/unx/gtk3/gtk3gtkinst.cxx        |    9 +++++++++
 5 files changed, 26 insertions(+), 13 deletions(-)

New commits:
commit 66a1cec7366f28e9287ce88d64bb357bb9dd6c99
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 31 11:03:56 2018 +0100

    connect up accessibility location
    
    Change-Id: I226e42cf6bd7aa455514439f7303b490aa6d192d
    Reviewed-on: https://gerrit.libreoffice.org/55137
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index fe45e32e0b03..7caac3ec0686 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -833,10 +833,12 @@ public:
     virtual void queue_draw() = 0;
     virtual void queue_draw_area(int x, int y, int width, int height) = 0;
     virtual void queue_resize() = 0;
-    virtual a11yref get_accessible_parent() = 0;
-    virtual a11yrelationset get_accessible_relation_set() = 0;
     // use return here just to generate matching VirtualDevices
     virtual OutputDevice& get_ref_device() = 0;
+
+    virtual a11yref get_accessible_parent() = 0;
+    virtual a11yrelationset get_accessible_relation_set() = 0;
+    virtual Point get_accessible_location() = 0;
 };
 
 class VCL_DLLPUBLIC Menu
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 34cf5c41a0aa..093fd4d2de92 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -1373,18 +1373,15 @@ awt::Point SAL_CALL SvtValueItemAcc::getLocation()
 awt::Point SAL_CALL SvtValueItemAcc::getLocationOnScreen()
 {
     const SolarMutexGuard aSolarGuard;
-    uno::Reference<accessibility::XAccessible> xParent(getAccessibleParent());
     awt::Point          aRet;
 
-    if (mpParent && xParent)
+    if( mpParent )
     {
-        uno::Reference<accessibility::XAccessibleContext> xParentContext(xParent->getAccessibleContext());
-        uno::Reference<accessibility::XAccessibleComponent> xParentComponent(xParentContext, css::uno::UNO_QUERY_THROW);
-        awt::Point aParentScreenLoc(xParentComponent->getLocationOnScreen());
-        const Point aOwnRelativeLoc = mpParent->mrParent.GetItemRect(mpParent->mnId).TopLeft();
+        const Point aPos = mpParent->mrParent.GetItemRect(mpParent->mnId).TopLeft();
+        const Point aScreenPos( mpParent->mrParent.GetDrawingArea()->get_accessible_location() );
 
-        aRet.X = aParentScreenLoc.X + aOwnRelativeLoc.X();
-        aRet.X = aParentScreenLoc.Y + aOwnRelativeLoc.Y();
+        aRet.X = aPos.X() + aScreenPos.X();
+        aRet.Y = aPos.Y() + aScreenPos.Y();
     }
 
     return aRet;
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index dc5e52896641..292c89a097b2 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -2824,7 +2824,7 @@ void SvtValueSet::SelectItem( sal_uInt16 nItemId )
 
             if( nPos != VALUESET_ITEM_NOTFOUND )
             {
-                ValueItemAcc* pItemAcc = ValueItemAcc::getImplementation(
+                SvtValueItemAcc* pItemAcc = SvtValueItemAcc::getImplementation(
                     mItemList[nPos]->GetAccessible( false/*bIsTransientChildrenDisabled*/ ) );
 
                 if( pItemAcc )
@@ -2846,9 +2846,9 @@ void SvtValueSet::SelectItem( sal_uInt16 nItemId )
         else
             pItem = mpNoneItem.get();
 
-        ValueItemAcc* pItemAcc = nullptr;
+        SvtValueItemAcc* pItemAcc = nullptr;
         if (pItem != nullptr)
-            pItemAcc = ValueItemAcc::getImplementation( pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ ) );
+            pItemAcc = SvtValueItemAcc::getImplementation( pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ ) );
 
         if( pItemAcc )
         {
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 065818715ff4..590d0acefa8d 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1829,6 +1829,11 @@ public:
         return xSet;
     }
 
+    virtual Point get_accessible_location() override
+    {
+        return m_xDrawingArea->OutputToAbsoluteScreenPixel(Point());
+    }
+
     virtual ~SalInstanceDrawingArea() override
     {
         m_xDrawingArea->SetQueryTooltipHdl(Link<tools::Rectangle&, OUString>());
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index d13cb73df419..78d81061bb34 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3951,6 +3951,15 @@ public:
         return uno::Reference<css::accessibility::XAccessibleRelationSet>();
     }
 
+    virtual Point get_accessible_location() override
+    {
+        AtkObject* pAtkObject = default_drawing_area_get_accessible(m_pWidget);
+        gint x(0), y(0);
+        if (pAtkObject && ATK_IS_COMPONENT(pAtkObject))
+            atk_component_get_extents(ATK_COMPONENT(pAtkObject), &x, &y, nullptr, nullptr, ATK_XY_WINDOW);
+        return Point(x, y);
+    }
+
     virtual void set_accessible_name(const OUString& rName) override
     {
         AtkObject* pAtkObject = default_drawing_area_get_accessible(m_pWidget);


More information about the Libreoffice-commits mailing list