msctf: ITfDocumentMgr::GetBase returns the top if there is only one context pushed.

This commit is contained in:
Aric Stewart 2009-04-10 13:16:11 -05:00 committed by Alexandre Julliard
parent af860c1a85
commit 846093ea26
1 changed files with 9 additions and 2 deletions

View File

@ -199,14 +199,21 @@ static HRESULT WINAPI DocumentMgr_GetTop(ITfDocumentMgr *iface, ITfContext **ppi
static HRESULT WINAPI DocumentMgr_GetBase(ITfDocumentMgr *iface, ITfContext **ppic)
{
DocumentMgr *This = (DocumentMgr *)iface;
ITfContext *tgt;
TRACE("(%p)\n",This);
if (!ppic)
return E_INVALIDARG;
if (This->contextStack[1])
ITfContext_AddRef(This->contextStack[1]);
tgt = This->contextStack[1];
else
tgt = This->contextStack[0];
*ppic = This->contextStack[1];
if (tgt)
ITfContext_AddRef(tgt);
*ppic = tgt;
return S_OK;
}