diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2012-01-09 13:13:33 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-11 11:18:51 +0100 |
commit | 30ad53a0a6b1f6d5d50fe12777dc1045dec22803 (patch) | |
tree | 8801287de779c5554e86daafeac8bed69c2ea680 /src/plugins/platforms | |
parent | 630131d58542dc3a69587b4a982b04544d30b92b (diff) |
Make QAccessibleInterface::indexOfChild() 0-based.
Makes the code nicer and more consistent with the rest of the world.
Change-Id: I5ba0ee39f5b0afd1a079a3cea9990d123955ed3f
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsaccessibility.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index 1441a02d1e..deacf518af 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -232,7 +232,7 @@ static QAccessibleInterface *acast(void *ptr) // hit a child, forward to child accessible interface. int childIndex = acast(accessibleInterface)->indexOfChild(childInterface); - QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement elementWithIndex:childIndex -1 parent:self accessibleInterface: childInterface]; + QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement elementWithIndex:childIndex parent:self accessibleInterface: childInterface]; return [accessibleElement accessibilityHitTest:point]; } diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/qwindowsaccessibility.cpp index afd92701f7..82e65f66b5 100644 --- a/src/plugins/platforms/windows/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/qwindowsaccessibility.cpp @@ -676,8 +676,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT v if (parent) { int index = parent->indexOfChild(accessible); index += (navDir == NAVDIR_NEXT) ? 1 : -1; - if (index > 0 && index <= parent->childCount()) - acc = parent->child(index - 1); + if (index >= 0 && index < parent->childCount()) + acc = parent->child(index); delete parent; } } else { |