Aric Stewart : msctf: Hook up ITfContextOwnerCompositionSink if present.
Alexandre Julliard
julliard at winehq.org
Mon Feb 9 10:29:12 CST 2009
Module: wine
Branch: master
Commit: a840c35d42e00455a578f5ff873751df8410e652
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a840c35d42e00455a578f5ff873751df8410e652
Author: Aric Stewart <aric at codeweavers.com>
Date: Fri Feb 6 14:02:21 2009 -0600
msctf: Hook up ITfContextOwnerCompositionSink if present.
---
dlls/msctf/context.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/dlls/msctf/context.c b/dlls/msctf/context.c
index 37c651c..feef421 100644
--- a/dlls/msctf/context.c
+++ b/dlls/msctf/context.c
@@ -63,7 +63,7 @@ typedef struct tagContext {
TfClientId tidOwner;
ITextStoreACP *pITextStoreACP;
- /* ITfContextOwnerCompositionSink */
+ ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink;
ITextStoreACPSink *pITextStoreACPSink;
@@ -112,6 +112,9 @@ static void Context_Destructor(Context *This)
if (This->pITextStoreACP)
ITextStoreACPSink_Release(This->pITextStoreACP);
+ if (This->pITfContextOwnerCompositionSink)
+ ITextStoreACPSink_Release(This->pITfContextOwnerCompositionSink);
+
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pContextKeyEventSink)
{
ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry);
@@ -428,15 +431,22 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp
This->refCount = 1;
This->tidOwner = tidOwner;
- if (punk && SUCCEEDED(IUnknown_QueryInterface(punk, &IID_ITextStoreACP,
- (LPVOID*)&This->pITextStoreACP)))
+ if (punk)
{
- if (SUCCEEDED(TextStoreACPSink_Constructor(&This->pITextStoreACPSink, This)))
- ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink,
- (IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS);
+ if (SUCCEEDED(IUnknown_QueryInterface(punk, &IID_ITextStoreACP,
+ (LPVOID*)&This->pITextStoreACP)))
+ {
+ if (SUCCEEDED(TextStoreACPSink_Constructor(&This->pITextStoreACPSink, This)))
+ ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink,
+ (IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS);
+ }
+
+ IUnknown_QueryInterface(punk, &IID_ITfContextOwnerCompositionSink,
+ (LPVOID*)&This->pITfContextOwnerCompositionSink);
+
+ if (!This->pITextStoreACP && !This->pITfContextOwnerCompositionSink)
+ FIXME("Unhandled pUnk\n");
}
- else if (punk)
- FIXME("Unhandled pUnk\n");
TRACE("returning %p\n", This);
*ppOut = (ITfContext*)This;
More information about the wine-cvs
mailing list