Commit 74f06be6 authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Add support for UIA_LegacyIAccessibleRolePropertyId.

parent fc3b0d33
......@@ -1119,6 +1119,7 @@ struct Provider_legacy_accessible_pattern_data
{
BOOL is_supported;
int child_id;
DWORD role;
};
static struct Provider
......@@ -2269,8 +2270,10 @@ static HRESULT WINAPI ProviderLegacyIAccessiblePattern_get_Description(ILegacyIA
static HRESULT WINAPI ProviderLegacyIAccessiblePattern_get_Role(ILegacyIAccessibleProvider *iface, DWORD *out_role)
{
ok(0, "unexpected call\n");
return E_NOTIMPL;
struct Provider *Provider = impl_from_ProviderLegacyIAccessiblePattern(iface);
*out_role = Provider->legacy_acc_pattern_data.role;
return S_OK;
}
static HRESULT WINAPI ProviderLegacyIAccessiblePattern_get_State(ILegacyIAccessibleProvider *iface, DWORD *out_state)
......@@ -5708,6 +5711,18 @@ static void test_UiaGetPropertyValue(void)
VariantClear(&v);
}
for (i = 0; i < 2; i++)
{
Provider.legacy_acc_pattern_data.role = i;
hr = UiaGetPropertyValue(node, UIA_LegacyIAccessibleRolePropertyId, &v);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(V_VT(&v) == VT_I4, "Unexpected VT %d\n", V_VT(&v));
ok(V_I4(&v) == i, "Unexpected I4 %#lx\n", V_I4(&v));
ok_method_sequence(get_pattern_prop_seq, NULL);
VariantClear(&v);
}
ok(UiaNodeRelease(node), "UiaNodeRelease returned FALSE\n");
ok(Provider.ref == 1, "Unexpected refcnt %ld\n", Provider.ref);
initialize_provider(&Provider, ProviderOptions_ServerSideProvider, NULL, FALSE);
......
......@@ -1581,6 +1581,16 @@ static HRESULT uia_provider_get_pattern_prop_val(struct uia_provider *prov,
break;
}
case UIA_LegacyIAccessibleRolePropertyId:
{
DWORD val;
hr = ILegacyIAccessibleProvider_get_Role((ILegacyIAccessibleProvider *)pattern_prov, &val);
if (SUCCEEDED(hr))
variant_init_i4(ret_val, val);
break;
}
default:
break;
}
......
......@@ -219,7 +219,9 @@ static const struct uia_prop_info default_uia_properties[] = {
{ &IsDialog_Property_GUID, UIA_IsDialogPropertyId,
PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
{ &IsTextPatternAvailable_Property_GUID, UIA_IsTextPatternAvailablePropertyId, },
{ &LegacyIAccessible_Role_Property_GUID, UIA_LegacyIAccessibleRolePropertyId, },
{ &LegacyIAccessible_Role_Property_GUID, UIA_LegacyIAccessibleRolePropertyId,
PROP_TYPE_PATTERN_PROP, UIAutomationType_Int,
UIA_LegacyIAccessiblePatternId, },
{ &Selection2_ItemCount_Property_GUID, UIA_Selection2ItemCountPropertyId, },
{ &TableItem_RowHeaderItems_Property_GUID, UIA_TableItemRowHeaderItemsPropertyId, },
{ &Styles_ExtendedProperties_Property_GUID, UIA_StylesExtendedPropertiesPropertyId, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment