Module: wine Branch: master Commit: f3e2027b43fd5c28534036d11b9f7b2dc746a2b6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f3e2027b43fd5c28534036d11b... Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Feb 2 10:25:16 2009 -0600 msctf: Implement ITfDocumentMgr::Pop. --- dlls/msctf/documentmgr.c | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/msctf/documentmgr.c b/dlls/msctf/documentmgr.c index eb6e4d2..040db7b 100644 --- a/dlls/msctf/documentmgr.c +++ b/dlls/msctf/documentmgr.c @@ -129,8 +129,29 @@ static HRESULT WINAPI DocumentMgr_Push(ITfDocumentMgr *iface, ITfContext *pic) static HRESULT WINAPI DocumentMgr_Pop(ITfDocumentMgr *iface, DWORD dwFlags) { DocumentMgr *This = (DocumentMgr *)iface; - FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + TRACE("(%p) 0x%x\n",This,dwFlags); + + if (dwFlags == TF_POPF_ALL) + { + if (This->contextStack[0]) + ITfContext_Release(This->contextStack[0]); + if (This->contextStack[1]) + ITfContext_Release(This->contextStack[1]); + This->contextStack[0] = This->contextStack[1] = NULL; + return S_OK; + } + + if (dwFlags) + return E_INVALIDARG; + + if (This->contextStack[0] == NULL) /* Cannot pop last context */ + return E_FAIL; + + ITfContext_Release(This->contextStack[0]); + This->contextStack[0] = This->contextStack[1]; + This->contextStack[1] = NULL; + + return S_OK; } static HRESULT WINAPI DocumentMgr_GetTop(ITfDocumentMgr *iface, ITfContext **ppic)