msctf: Context initialization happens before OnPushContext sink.

This commit is contained in:
Aric Stewart 2009-06-24 17:29:51 +09:00 committed by Alexandre Julliard
parent 2dd5a3bea2
commit e73b17d018
2 changed files with 15 additions and 1 deletions

View File

@ -145,8 +145,8 @@ static HRESULT WINAPI DocumentMgr_Push(ITfDocumentMgr *iface, ITfContext *pic)
This->contextStack[1] = This->contextStack[0];
This->contextStack[0] = check;
ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check);
Context_Initialize(check, iface);
ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check);
return S_OK;
}

View File

@ -439,6 +439,20 @@ ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus)
static HRESULT WINAPI ThreadMgrEventSink_OnPushContext(ITfThreadMgrEventSink *iface,
ITfContext *pic)
{
HRESULT hr;
ITfDocumentMgr *docmgr;
ITfContext *test;
hr = ITfContext_GetDocumentMgr(pic,&docmgr);
ok(SUCCEEDED(hr),"GetDocumenMgr failed\n");
test = (ITfContext*)0xdeadbeef;
ITfDocumentMgr_Release(docmgr);
hr = ITfDocumentMgr_GetTop(docmgr,&test);
ok(SUCCEEDED(hr),"GetTop failed\n");
ok(test == pic, "Wrong context is on top\n");
if (test)
ITfContext_Release(test);
ok(test_OnPushContext == SINK_EXPECTED, "Unexpected OnPushContext sink\n");
test_OnPushContext = SINK_FIRED;
return S_OK;