Module: wine Branch: master Commit: bf395eb172ad0f103f3c7f82bbb6f91356c6c09e URL: http://source.winehq.org/git/wine.git/?a=commit;h=bf395eb172ad0f103f3c7f82bb...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Nov 19 16:17:52 2013 +0400
msctf: Remove some duplication.
---
dlls/msctf/documentmgr.c | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/dlls/msctf/documentmgr.c b/dlls/msctf/documentmgr.c index 956932b..d9ba057 100644 --- a/dlls/msctf/documentmgr.c +++ b/dlls/msctf/documentmgr.c @@ -183,19 +183,17 @@ static HRESULT WINAPI DocumentMgr_Pop(ITfDocumentMgr *iface, DWORD dwFlags)
if (dwFlags == TF_POPF_ALL) { - if (This->contextStack[0]) - { - ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[0]); - Context_Uninitialize(This->contextStack[0]); - ITfContext_Release(This->contextStack[0]); - } - if (This->contextStack[1]) - { - ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[1]); - Context_Uninitialize(This->contextStack[1]); - ITfContext_Release(This->contextStack[1]); - } - This->contextStack[0] = This->contextStack[1] = NULL; + int i; + + for (i = 0; i < sizeof(This->contextStack)/sizeof(This->contextStack[0]); i++) + if (This->contextStack[i]) + { + ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink, This->contextStack[i]); + Context_Uninitialize(This->contextStack[i]); + ITfContext_Release(This->contextStack[i]); + This->contextStack[i] = NULL; + } + ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface); return S_OK; }