[PATCH v2 6/7] oleacc: Add put_value function for edit client accessible object.

Connor McAdams cmcadams at codeweavers.com
Wed Sep 22 15:12:40 CDT 2021


Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>
---
 dlls/oleacc/client.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c
index a5620a4f24c..3bf4a5a39fe 100644
--- a/dlls/oleacc/client.c
+++ b/dlls/oleacc/client.c
@@ -47,6 +47,7 @@ struct win_class_vtbl {
     HRESULT (*get_name)(Client *, BSTR *);
     HRESULT (*get_kbd_shortcut)(Client *, BSTR *);
     HRESULT (*get_value)(Client *, BSTR *);
+    HRESULT (*put_value)(Client *, VARIANT, BSTR);
 };
 
 static HRESULT acc_client_get_name_str(WCHAR *name, UINT len, BSTR *pszName)
@@ -491,7 +492,12 @@ static HRESULT WINAPI Client_put_accName(IAccessible *iface, VARIANT varID, BSTR
 static HRESULT WINAPI Client_put_accValue(IAccessible *iface, VARIANT varID, BSTR pszValue)
 {
     Client *This = impl_from_Client(iface);
+
+    if (This->vtbl && This->vtbl->put_value)
+        return This->vtbl->put_value(This, varID, pszValue);
+
     FIXME("(%p)->(%s %s)\n", This, debugstr_variant(&varID), debugstr_w(pszValue));
+
     return E_NOTIMPL;
 }
 
@@ -825,11 +831,24 @@ static HRESULT edit_get_value(Client *client, BSTR *out_value)
     return S_OK;
 }
 
+static HRESULT edit_put_value(Client *client, VARIANT var_id, BSTR value)
+{
+    TRACE("(%p, %s, %s)\n", client, debugstr_variant(&var_id), debugstr_w(value));
+
+    if(convert_child_id(&var_id) != CHILDID_SELF || !IsWindow(client->hwnd))
+        return E_INVALIDARG;
+
+    SendMessageW(client->hwnd, WM_SETTEXT, 0, (LPARAM)value);
+
+    return S_OK;
+}
+
 const win_class_vtbl edit_class_vtbl = {
     edit_get_state,
     edit_get_name,
     edit_get_kbd_shortcut,
     edit_get_value,
+    edit_put_value,
 };
 
 HRESULT create_edit_client_object(HWND hwnd, const IID *iid, void **obj)
-- 
2.25.1




More information about the wine-devel mailing list