From 1c438f104815e670afd94bfb396922dae09e7dcd Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 5 Mar 2012 16:56:55 +0100 Subject: Fix off by one in updateAccessibility. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that indexOfChild is 0-based, the update notifications should follow. Change-Id: I5e0303516d503d5e23061df5894b2428c00da2ce Reviewed-by: Jan-Arve Sæther Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/windows/qwindowsaccessibility.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/qwindowsaccessibility.cpp index 1a8f593609..134b1c81ce 100644 --- a/src/plugins/platforms/windows/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/qwindowsaccessibility.cpp @@ -844,14 +844,12 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accChild(VARIANT varChildID, I QPair ref = qAccessibleRecentSentEvents()->value(entry); if (ref.first) { acc = QAccessible::queryAccessibleInterface(ref.first); - if (acc && ref.second) { - if (ref.second) { - QAccessibleInterface *res = acc->child(ref.second - 1); - delete acc; - if (!res) - return E_INVALIDARG; - acc = res; - } + if (acc && ref.second >= 0) { + QAccessibleInterface *res = acc->child(ref.second); + delete acc; + if (!res) + return E_INVALIDARG; + acc = res; } } } else { -- cgit v1.2.3