diff options
author | Jan-Arve Saether <jan-arve.saether@nokia.com> | 2012-01-19 14:20:54 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-06 10:15:09 +0100 |
commit | 1d18fd01645e3b9efcd1a2c5dd030a5fc0f5892a (patch) | |
tree | 84c4e4df3f91f80e07641a5a3b0b0cfcecbe6705 /src/plugins/platforms | |
parent | fdf9ee12916651c708dcd63d557e11e36ec7eb4e (diff) |
Remove QAccessible::FocusChild, add focusChild()
Also cleanup (reduce) all implementations of navigate() in order
to make the final removal of navigate smoother.
Change-Id: I2c216db8f5b2e40afcce8f859fc775053adc2fe3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsaccessibility.cpp | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/qwindowsaccessibility.cpp index 2678fd7f23..8d11745410 100644 --- a/src/plugins/platforms/windows/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/qwindowsaccessibility.cpp @@ -1189,29 +1189,18 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accFocus(VARIANT *pvarID) if (!accessible->isValid()) return E_FAIL; - QAccessibleInterface *acc = 0; - int control = accessible->navigate(QAccessible::FocusChild, 1, &acc); - if (control == -1) { - (*pvarID).vt = VT_EMPTY; - return S_FALSE; - } - if (!acc || control == 0) { - (*pvarID).vt = VT_I4; - (*pvarID).lVal = control ? control : CHILDID_SELF; - return S_OK; - } - - QWindowsAccessible* wacc = new QWindowsAccessible(acc); - IDispatch *iface = 0; - wacc->QueryInterface(IID_IDispatch, (void**)&iface); - if (iface) { - (*pvarID).vt = VT_DISPATCH; - (*pvarID).pdispVal = iface; - return S_OK; - } else { - delete wacc; + if (QAccessibleInterface *acc = accessible->focusChild()) { + QWindowsAccessible* wacc = new QWindowsAccessible(acc); + IDispatch *iface = 0; + wacc->QueryInterface(IID_IDispatch, (void**)&iface); + if (iface) { + (*pvarID).vt = VT_DISPATCH; + (*pvarID).pdispVal = iface; + return S_OK; + } else { + delete wacc; + } } - (*pvarID).vt = VT_EMPTY; return S_FALSE; } |