Connor McAdams : uiautomationcore: Add support for UIAutomationType_Double properties.

Alexandre Julliard julliard at winehq.org
Mon Jul 25 16:18:23 CDT 2022


Module: wine
Branch: master
Commit: d83c019102d8dc26e5223cf797b6a72bbea2274d
URL:    https://gitlab.winehq.org/wine/wine/-/commit/d83c019102d8dc26e5223cf797b6a72bbea2274d

Author: Connor McAdams <cmcadams at codeweavers.com>
Date:   Mon Jun 20 16:05:12 2022 -0400

uiautomationcore: Add support for UIAutomationType_Double properties.

Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>

---

 dlls/uiautomationcore/tests/uiautomation.c | 10 ++--------
 dlls/uiautomationcore/uia_client.c         | 18 ++++++++++++++++++
 dlls/uiautomationcore/uia_ids.c            |  9 ++++++---
 3 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c
index 7dd598822a4..7378e78d73d 100644
--- a/dlls/uiautomationcore/tests/uiautomation.c
+++ b/dlls/uiautomationcore/tests/uiautomation.c
@@ -4237,19 +4237,13 @@ static void check_uia_prop_val(PROPERTYID prop_id, enum UIAutomationType type, V
         break;
 
     case UIAutomationType_Double:
-        todo_wine ok(V_VT(v) == VT_R8, "Unexpected VT %d\n", V_VT(v));
-        if (V_VT(v) != VT_R8)
-            break;
-
+        ok(V_VT(v) == VT_R8, "Unexpected VT %d\n", V_VT(v));
         ok(V_R8(v) == uia_r8_prop_val, "Unexpected R8 %lf\n", V_R8(v));
         ok_method_sequence(get_prop_seq, NULL);
         break;
 
     case UIAutomationType_DoubleArray:
-        todo_wine ok(V_VT(v) == (VT_ARRAY | VT_R8), "Unexpected VT %d\n", V_VT(v));
-        if (V_VT(v) != (VT_ARRAY | VT_R8))
-            break;
-
+        ok(V_VT(v) == (VT_ARRAY | VT_R8), "Unexpected VT %d\n", V_VT(v));
         for (idx = 0; idx < ARRAY_SIZE(uia_r8_arr_prop_val); idx++)
         {
             double val;
diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c
index ba15ed0c1f1..d2f05648b11 100644
--- a/dlls/uiautomationcore/uia_client.c
+++ b/dlls/uiautomationcore/uia_client.c
@@ -369,6 +369,24 @@ static HRESULT WINAPI uia_provider_get_prop_val(IWineUiaProvider *iface,
         *ret_val = v;
         break;
 
+    case UIAutomationType_Double:
+        if (V_VT(&v) != VT_R8)
+        {
+            WARN("Invalid vt %d for UIAutomationType_Double\n", V_VT(&v));
+            goto exit;
+        }
+        *ret_val = v;
+        break;
+
+    case UIAutomationType_DoubleArray:
+        if (V_VT(&v) != (VT_R8 | VT_ARRAY))
+        {
+            WARN("Invalid vt %d for UIAutomationType_DoubleArray\n", V_VT(&v));
+            goto exit;
+        }
+        *ret_val = v;
+        break;
+
     case UIAutomationType_Element:
     {
         IRawElementProviderSimple *elprov;
diff --git a/dlls/uiautomationcore/uia_ids.c b/dlls/uiautomationcore/uia_ids.c
index 72bc3ba6991..10eea31adc3 100644
--- a/dlls/uiautomationcore/uia_ids.c
+++ b/dlls/uiautomationcore/uia_ids.c
@@ -48,7 +48,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &Transform2_ZoomLevel_Property_GUID,               UIA_Transform2ZoomLevelPropertyId, },
     { &Name_Property_GUID,                               UIA_NamePropertyId, },
     { &GridItem_RowSpan_Property_GUID,                   UIA_GridItemRowSpanPropertyId, },
-    { &Size_Property_GUID,                               UIA_SizePropertyId, },
+    { &Size_Property_GUID,                               UIA_SizePropertyId,
+      UIAutomationType_DoubleArray, },
     { &IsTextPattern2Available_Property_GUID,            UIA_IsTextPattern2AvailablePropertyId, },
     { &Styles_FillPatternStyle_Property_GUID,            UIA_StylesFillPatternStylePropertyId, },
     { &FlowsTo_Property_GUID,                            UIA_FlowsToPropertyId,
@@ -143,7 +144,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &Drag_DropEffect_Property_GUID,                    UIA_DragDropEffectPropertyId, },
     { &MultipleView_CurrentView_Property_GUID,           UIA_MultipleViewCurrentViewPropertyId, },
     { &Styles_FillColor_Property_GUID,                   UIA_StylesFillColorPropertyId, },
-    { &Rotation_Property_GUID,                           UIA_RotationPropertyId, },
+    { &Rotation_Property_GUID,                           UIA_RotationPropertyId,
+      UIAutomationType_Double, },
     { &SpreadsheetItem_Formula_Property_GUID,            UIA_SpreadsheetItemFormulaPropertyId, },
     { &IsEnabled_Property_GUID,                          UIA_IsEnabledPropertyId, },
     { &LocalizedLandmarkType_Property_GUID,              UIA_LocalizedLandmarkTypePropertyId, },
@@ -198,7 +200,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &Table_RowOrColumnMajor_Property_GUID,             UIA_TableRowOrColumnMajorPropertyId, },
     { &IsDockPatternAvailable_Property_GUID,             UIA_IsDockPatternAvailablePropertyId, },
     { &IsSynchronizedInputPatternAvailable_Property_GUID,UIA_IsSynchronizedInputPatternAvailablePropertyId, },
-    { &OutlineThickness_Property_GUID,                   UIA_OutlineThicknessPropertyId, },
+    { &OutlineThickness_Property_GUID,                   UIA_OutlineThicknessPropertyId,
+      UIAutomationType_DoubleArray, },
     { &IsLegacyIAccessiblePatternAvailable_Property_GUID,UIA_IsLegacyIAccessiblePatternAvailablePropertyId, },
     { &AnnotationObjects_Property_GUID,                  UIA_AnnotationObjectsPropertyId,
       UIAutomationType_ElementArray, },




More information about the wine-cvs mailing list