From 5a09e71fc38205574a9f1b3b6775845108c3ab1c Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Wed, 25 Apr 2012 10:17:08 +0200 Subject: MSAA bridge should not return any IA2-specific roles from get_accRole() Small cleanup/improvement. This patch just does what the removed ### says. Change-Id: I0d16541d2e4b8f948f32734ef0138fde5517932a Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/windows/accessible/iaccessible2.cpp | 3 --- .../platforms/windows/accessible/qwindowsmsaaaccessible.cpp | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp index 132a04dd9c..2e843ef74a 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp +++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp @@ -338,9 +338,6 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_relations(long maxRelations HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::role(long *ia2role) { accessibleDebugClientCalls(accessible); - //### Change QAccessibleInterface::role() to return both MSAA and IA2 roles. - // When that is completed, we must patch the MSAA bridge not not return any - // IA2-specific roles from get_accRole(). if (!accessible->isValid()) return E_FAIL; diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp index 6c4d217cb4..5003d9effd 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp @@ -998,8 +998,14 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accRole(VARIANT varID, VAR } if (role != QAccessible::NoRole) { - if (role == QAccessible::LayeredPane) - role = QAccessible::Pane; + if (role >= QAccessible::LayeredPane) { + // This block should hopefully only be entered if the AT client + // does not support IAccessible2, since it should prefer IA2::role() then. + if (role == QAccessible::LayeredPane) + role = QAccessible::Pane; + else + role = QAccessible::Client; + } (*pvarRole).vt = VT_I4; (*pvarRole).lVal = role; } else { -- cgit v1.2.3