From fd87a4c7f620bd01af4be6e7624901436f770872 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Tue, 24 Apr 2012 13:20:07 +0200 Subject: [PATCH] Make NVDA read aloud stuff from a Qt app again. Previously, NVDA did not read aloud anything from a Qt app. Change-Id: Ie738e7e7d7acc54f45fab9195adc09bfde930174 Reviewed-by: Frederik Gladhorn --- .../platforms/windows/accessible/iaccessible2.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp index ddab3cb0f2..132a04dd9c 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp +++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp @@ -1363,15 +1363,16 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryService(REFGUID guidServic Q_UNUSED(guidService); *iface = 0; accessibleDebug("QWindowsIA2Accessible::QS(): %s", IIDToString(riid).constData()); - if (riid == IID_IAccessible || riid == IID_IUnknown || riid == IID_IDispatch) { - *iface = static_cast(this); - } else if (/*guidService == IID_IAccessible && */riid == IID_IAccessible2) { + + if (guidService == IID_IAccessible && riid == IID_IAccessible2) { + // The conditions for entering here should be ok (from _dicoveringInterfaces in IAccessible2.idl) *iface = static_cast(this); - } else if (riid == IID_IAccessibleApplication) { + } else if (guidService == IID_IAccessible && (riid == IID_IAccessible || riid == IID_IUnknown || riid == IID_IDispatch)) { + // The above conditions works with AccProbe and NVDA. + *iface = static_cast(this); + } else if (riid == IID_IAccessibleApplication) { *iface = new AccessibleApplication; return S_OK; - } else { - QueryInterface(riid, iface); } if (*iface) { AddRef();