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 <frederik.gladhorn@nokia.com>
This commit is contained in:
Jan-Arve Saether 2012-04-25 10:17:08 +02:00 committed by Qt by Nokia
parent 3fef4b4635
commit 5a09e71fc3
2 changed files with 8 additions and 5 deletions

View File

@ -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;

View File

@ -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 {