Map QAccessible::Role to the proper IA2Role.
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Wed, 25 Apr 2012 08:46:30 +0000 (10:46 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 26 Apr 2012 09:45:01 +0000 (11:45 +0200)
All enum values after the MSAA-specific roles needs a special
mapping.

Change-Id: I6c77abf09b68d2d3d772937be986d532db2e5292
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
src/plugins/platforms/windows/accessible/iaccessible2.cpp

index 2e843ef..71a26af 100644 (file)
@@ -341,7 +341,16 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::role(long *ia2role)
     if (!accessible->isValid())
         return E_FAIL;
 
-    *ia2role = accessible->role();
+    long r = accessible->role();
+
+    switch (r) {
+    case QAccessible::LayeredPane: r = IA2_ROLE_LAYERED_PANE; break;
+    case QAccessible::Terminal: r = IA2_ROLE_TERMINAL; break;
+    case QAccessible::Desktop: r = IA2_ROLE_DESKTOP_PANE; break;
+    default: break;
+    }
+
+    *ia2role = r;
     return S_OK;
 }