From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/uiautomationcore/tests/uiautomation.c | 31 +++++++++------------- dlls/uiautomationcore/uia_client.c | 16 ++++++++++- 2 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index e648820a51a..77f01927900 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -7223,17 +7223,15 @@ static void test_UiaGetUpdatedCache(void)
/* Equivalent to: if (!0) */ hr = UiaGetUpdatedCache(node, &cache_req, NormalizeState_View, NULL, &out_req, &tree_struct); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(!!out_req, "out_req == NULL\n"); - todo_wine ok(!!tree_struct, "tree_struct == NULL\n"); - if (out_req) - { - exp_lbound[0] = exp_lbound[1] = 0; - exp_elems[0] = exp_elems[1] = 1; - test_cache_req_sa(out_req, exp_lbound, exp_elems, exp_node_desc); - ok(!wcscmp(tree_struct, L"P)"), "tree structure %s\n", debugstr_w(tree_struct)); - ok_method_sequence(cache_req_seq1, NULL); - } + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!!out_req, "out_req == NULL\n"); + ok(!!tree_struct, "tree_struct == NULL\n"); + + exp_lbound[0] = exp_lbound[1] = 0; + exp_elems[0] = exp_elems[1] = 1; + test_cache_req_sa(out_req, exp_lbound, exp_elems, exp_node_desc); + ok(!wcscmp(tree_struct, L"P)"), "tree structure %s\n", debugstr_w(tree_struct)); + ok_method_sequence(cache_req_seq1, NULL);
SafeArrayDestroy(out_req); SysFreeString(tree_struct); @@ -7245,15 +7243,12 @@ static void test_UiaGetUpdatedCache(void)
/* Equivalent to: if (!1) */ hr = UiaGetUpdatedCache(node, &cache_req, NormalizeState_View, NULL, &out_req, &tree_struct); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - ok_method_sequence(cache_req_seq2, NULL); - + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!out_req, "out_req != NULL\n"); - todo_wine ok(!!tree_struct, "tree_struct == NULL\n"); - if (tree_struct) - ok(!wcscmp(tree_struct, L""), "tree structure %s\n", debugstr_w(tree_struct)); + ok(!!tree_struct, "tree_struct == NULL\n"); + ok(!wcscmp(tree_struct, L""), "tree structure %s\n", debugstr_w(tree_struct)); SysFreeString(tree_struct); + ok_method_sequence(cache_req_seq2, NULL);
/* * ConditionType_Property tests. diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 12b53891dcd..3897b036e09 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -1930,10 +1930,24 @@ static HRESULT uia_condition_check(HUIANODE node, struct UiaCondition *condition case ConditionType_False: return S_FALSE;
+ case ConditionType_Not: + { + struct UiaNotCondition *not_cond = (struct UiaNotCondition *)condition; + HRESULT hr; + + hr = uia_condition_check(node, not_cond->pConditions); + if (FAILED(hr)) + return hr; + + if (uia_condition_matched(hr)) + return S_FALSE; + else + return S_OK; + } + case ConditionType_Property: case ConditionType_And: case ConditionType_Or: - case ConditionType_Not: FIXME("Unhandled condition type %d\n", condition->ConditionType); return E_NOTIMPL;