From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 23 +++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 7d2ed8674b8..424d46acff9 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -226,8 +226,27 @@ static HRESULT WINAPI Accessible_get_accParent(IAccessible *iface, IDispatch** d
static HRESULT WINAPI Accessible_get_accChildCount(IAccessible *iface, LONG *count) { - FIXME("%p\n", iface); - return E_NOTIMPL; + SYSLINK_ACC *This = impl_from_IAccessible(iface); + DOC_ITEM *current; + LONG result = 0; + + TRACE("%p\n", iface); + + if (!This->infoPtr) + { + WARN("control was destroyed\n"); + return E_FAIL; + } + + LIST_FOR_EACH_ENTRY(current, &This->infoPtr->Items, DOC_ITEM, entry) + { + if (current->Type == slLink) + result++; + } + + *count = result; + + return S_OK; }
static HRESULT WINAPI Accessible_get_accChild(IAccessible *iface, VARIANT childid, IDispatch **disp) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 5eca972aa6d..55df8d8b59c 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -338,11 +338,11 @@ static void test_msaa(void) hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
-todo_wine { hr = IAccessible_get_accChildCount(acc, &count); ok(hr == S_OK, "accChildCount failed, hr=%lx\n", hr); ok(count == 2, "accChildCount returned %li\n", count);
+todo_wine { /* child 1 */ V_I4(&varChild) = 1; hr = IAccessible_get_accChild(acc, varChild, &child);