Aric Stewart : msctf: Implement ITfCompartment::SetValue.

Alexandre Julliard julliard at winehq.org
Mon Jun 22 09:04:16 CDT 2009


Module: wine
Branch: master
Commit: 3a18408dd590ccbb8d28bc66615b4a8801c9af12
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3a18408dd590ccbb8d28bc66615b4a8801c9af12

Author: Aric Stewart <aric at codeweavers.com>
Date:   Mon Jun 22 12:03:35 2009 +0900

msctf: Implement ITfCompartment::SetValue.

---

 dlls/msctf/compartmentmgr.c |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/msctf/compartmentmgr.c b/dlls/msctf/compartmentmgr.c
index 253bec7..09b71b1 100644
--- a/dlls/msctf/compartmentmgr.c
+++ b/dlls/msctf/compartmentmgr.c
@@ -429,8 +429,31 @@ static HRESULT WINAPI Compartment_SetValue(ITfCompartment *iface,
     TfClientId tid, const VARIANT *pvarValue)
 {
     Compartment *This = (Compartment *)iface;
-    FIXME("STUB:(%p)\n",This);
-    return E_NOTIMPL;
+
+    TRACE("(%p) %i %p\n",This,tid,pvarValue);
+
+    if (!pvarValue)
+        return E_INVALIDARG;
+
+    if (!(V_VT(pvarValue) == VT_BSTR || V_VT(pvarValue) == VT_I4 ||
+          V_VT(pvarValue) == VT_UNKNOWN))
+        return E_INVALIDARG;
+
+    if (!This->valueData->owner)
+        This->valueData->owner = tid;
+
+    VariantClear(&This->variant);
+
+    /* Shallow copy of value and type */
+    This->variant = *pvarValue;
+
+    if (V_VT(pvarValue) == VT_BSTR)
+        V_BSTR(&This->variant) = SysAllocStringByteLen((char*)V_BSTR(pvarValue),
+                SysStringByteLen(V_BSTR(pvarValue)));
+    else if (V_VT(pvarValue) == VT_UNKNOWN)
+        IUnknown_AddRef(V_UNKNOWN(&This->variant));
+
+    return S_OK;
 }
 
 static HRESULT WINAPI Compartment_GetValue(ITfCompartment *iface,




More information about the wine-cvs mailing list