Commit a840c35d authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

msctf: Hook up ITfContextOwnerCompositionSink if present.

parent 42be55d7
...@@ -63,7 +63,7 @@ typedef struct tagContext { ...@@ -63,7 +63,7 @@ typedef struct tagContext {
TfClientId tidOwner; TfClientId tidOwner;
ITextStoreACP *pITextStoreACP; ITextStoreACP *pITextStoreACP;
/* ITfContextOwnerCompositionSink */ ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink;
ITextStoreACPSink *pITextStoreACPSink; ITextStoreACPSink *pITextStoreACPSink;
...@@ -112,6 +112,9 @@ static void Context_Destructor(Context *This) ...@@ -112,6 +112,9 @@ static void Context_Destructor(Context *This)
if (This->pITextStoreACP) if (This->pITextStoreACP)
ITextStoreACPSink_Release(This->pITextStoreACP); ITextStoreACPSink_Release(This->pITextStoreACP);
if (This->pITfContextOwnerCompositionSink)
ITextStoreACPSink_Release(This->pITfContextOwnerCompositionSink);
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pContextKeyEventSink) LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pContextKeyEventSink)
{ {
ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry);
...@@ -428,15 +431,22 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp ...@@ -428,15 +431,22 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp
This->refCount = 1; This->refCount = 1;
This->tidOwner = tidOwner; This->tidOwner = tidOwner;
if (punk && SUCCEEDED(IUnknown_QueryInterface(punk, &IID_ITextStoreACP, if (punk)
(LPVOID*)&This->pITextStoreACP)))
{ {
if (SUCCEEDED(TextStoreACPSink_Constructor(&This->pITextStoreACPSink, This))) if (SUCCEEDED(IUnknown_QueryInterface(punk, &IID_ITextStoreACP,
ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink, (LPVOID*)&This->pITextStoreACP)))
(IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS); {
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); TRACE("returning %p\n", This);
*ppOut = (ITfContext*)This; *ppOut = (ITfContext*)This;
......
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