msctf: Add ITfComponentMgr to documentmgr.

This commit is contained in:
Aric Stewart 2009-06-11 13:33:23 -05:00 committed by Alexandre Julliard
parent 819518c461
commit 1ffa3515dd
1 changed files with 10 additions and 0 deletions

View File

@ -45,6 +45,9 @@ typedef struct tagDocumentMgr {
const ITfSourceVtbl *SourceVtbl;
LONG refCount;
/* Aggregation */
ITfCompartmentMgr *CompartmentMgr;
ITfContext* contextStack[2]; /* limit of 2 contexts */
ITfThreadMgrEventSink* ThreadMgrSink;
} DocumentMgr;
@ -61,6 +64,7 @@ static void DocumentMgr_Destructor(DocumentMgr *This)
ITfContext_Release(This->contextStack[0]);
if (This->contextStack[1])
ITfContext_Release(This->contextStack[1]);
CompartmentMgr_Destructor(This->CompartmentMgr);
HeapFree(GetProcessHeap(),0,This);
}
@ -77,6 +81,10 @@ static HRESULT WINAPI DocumentMgr_QueryInterface(ITfDocumentMgr *iface, REFIID i
{
*ppvOut = &This->SourceVtbl;
}
else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
{
*ppvOut = This->CompartmentMgr;
}
if (*ppvOut)
{
@ -303,6 +311,8 @@ HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink *ThreadMgrSink, ITfDocumen
This->refCount = 1;
This->ThreadMgrSink = ThreadMgrSink;
CompartmentMgr_Constructor((IUnknown*)This, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
TRACE("returning %p\n", This);
*ppOut = (ITfDocumentMgr*)This;
return S_OK;