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

Alexandre Julliard julliard at winehq.org
Tue Apr 14 16:00:03 CDT 2009


Module: wine
Branch: master
Commit: 846093ea26a5be6724320fbb26954800e51729b8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=846093ea26a5be6724320fbb26954800e51729b8

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri Apr 10 13:16:11 2009 -0500

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

---

 dlls/msctf/documentmgr.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/msctf/documentmgr.c b/dlls/msctf/documentmgr.c
index ab250cb..4ffd0b6 100644
--- a/dlls/msctf/documentmgr.c
+++ b/dlls/msctf/documentmgr.c
@@ -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];
+
+    if (tgt)
+        ITfContext_AddRef(tgt);
 
-    *ppic = This->contextStack[1];
+    *ppic = tgt;
 
     return S_OK;
 }




More information about the wine-cvs mailing list