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

msctf: Implement ITfContext::GetDocumentMgr.

parent 413934ca
...@@ -74,6 +74,7 @@ typedef struct tagContext { ...@@ -74,6 +74,7 @@ typedef struct tagContext {
TfClientId tidOwner; TfClientId tidOwner;
TfEditCookie defaultCookie; TfEditCookie defaultCookie;
TS_STATUS documentStatus; TS_STATUS documentStatus;
ITfDocumentMgr *manager;
ITextStoreACP *pITextStoreACP; ITextStoreACP *pITextStoreACP;
ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink; ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink;
...@@ -506,8 +507,15 @@ static HRESULT WINAPI Context_GetDocumentMgr (ITfContext *iface, ...@@ -506,8 +507,15 @@ static HRESULT WINAPI Context_GetDocumentMgr (ITfContext *iface,
ITfDocumentMgr **ppDm) ITfDocumentMgr **ppDm)
{ {
Context *This = (Context *)iface; Context *This = (Context *)iface;
FIXME("STUB:(%p)\n",This); TRACE("(%p) %p\n",This,ppDm);
return E_NOTIMPL;
if (!ppDm)
return E_INVALIDARG;
*ppDm = This->manager;
if (!This->manager)
return S_FALSE;
return S_OK;
} }
static HRESULT WINAPI Context_CreateRangeBackup (ITfContext *iface, static HRESULT WINAPI Context_CreateRangeBackup (ITfContext *iface,
...@@ -758,7 +766,7 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp ...@@ -758,7 +766,7 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp
return S_OK; return S_OK;
} }
HRESULT Context_Initialize(ITfContext *iface) HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager)
{ {
Context *This = (Context *)iface; Context *This = (Context *)iface;
...@@ -769,6 +777,7 @@ HRESULT Context_Initialize(ITfContext *iface) ...@@ -769,6 +777,7 @@ HRESULT Context_Initialize(ITfContext *iface)
(IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS); (IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS);
} }
This->connected = TRUE; This->connected = TRUE;
This->manager = manager;
return S_OK; return S_OK;
} }
...@@ -783,6 +792,7 @@ HRESULT Context_Uninitialize(ITfContext *iface) ...@@ -783,6 +792,7 @@ HRESULT Context_Uninitialize(ITfContext *iface)
This->pITextStoreACPSink = NULL; This->pITextStoreACPSink = NULL;
} }
This->connected = FALSE; This->connected = FALSE;
This->manager = NULL;
return S_OK; return S_OK;
} }
......
...@@ -146,7 +146,7 @@ static HRESULT WINAPI DocumentMgr_Push(ITfDocumentMgr *iface, ITfContext *pic) ...@@ -146,7 +146,7 @@ static HRESULT WINAPI DocumentMgr_Push(ITfDocumentMgr *iface, ITfContext *pic)
This->contextStack[0] = check; This->contextStack[0] = check;
ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check); ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check);
Context_Initialize(check); Context_Initialize(check, iface);
return S_OK; return S_OK;
} }
......
...@@ -40,7 +40,7 @@ extern HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, ...@@ -40,7 +40,7 @@ extern HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore,
extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut); extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut);
extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This); extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This);
extern HRESULT Context_Initialize(ITfContext *cxt); extern HRESULT Context_Initialize(ITfContext *cxt, ITfDocumentMgr *manager);
extern HRESULT Context_Uninitialize(ITfContext *cxt); extern HRESULT Context_Uninitialize(ITfContext *cxt);
extern HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp); extern HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp);
......
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