From 1d18fd01645e3b9efcd1a2c5dd030a5fc0f5892a Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Thu, 19 Jan 2012 14:20:54 +0100 Subject: 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 --- .../platforms/windows/qwindowsaccessibility.cpp | 33 ++++++++-------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'src/plugins/platforms/windows') 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; } -- cgit v1.2.3