From ab13e8a841f140c98be77b276df072bec41d2edc Mon Sep 17 00:00:00 2001 From: The Wine Synchronizer Date: Mon, 14 Jan 2008 13:00:47 +0000 Subject: [PATCH] Autosyncing with Wine HEAD svn path=/trunk/; revision=31777 --- reactos/dll/win32/imm32/imm.c | 36 ++++++++++++++++++---------- reactos/dll/win32/imm32/imm32.rbuild | 2 ++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/reactos/dll/win32/imm32/imm.c b/reactos/dll/win32/imm32/imm.c index 4f5f6589336..4acbde39fa7 100644 --- a/reactos/dll/win32/imm32/imm.c +++ b/reactos/dll/win32/imm32/imm.c @@ -240,6 +240,9 @@ static HIMCC updateCompStr(HIMCC old, LPWSTR compstr, DWORD len) TRACE("%s, %i\n",debugstr_wn(compstr,len),len); + if (old == NULL && compstr == NULL && len == 0) + return NULL; + if (old != NULL) { olddata = ImmLockIMCC(old); @@ -373,6 +376,9 @@ static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len) TRACE("%s, %i\n",debugstr_wn(resultstr,len),len); + if (old == NULL && resultstr == NULL && len == 0) + return NULL; + if (old != NULL) { olddata = ImmLockIMCC(old); @@ -1076,7 +1082,7 @@ HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd) TRACE("Default created (%p)\n",hwndDefault); } - return (HWND)hwndDefault; + return hwndDefault; } /*********************************************************************** @@ -1400,15 +1406,18 @@ BOOL WINAPI ImmNotifyIME( case CPS_CANCEL: TRACE("%s - %s\n","NI_COMPOSITIONSTR","CPS_CANCEL"); { - HIMCC newCompStr; + BOOL send; + if (pX11DRV_ForceXIMReset) pX11DRV_ForceXIMReset(root_context->IMC.hWnd); - newCompStr = updateCompStr(root_context->IMC.hCompStr, NULL, 0); - ImmDestroyIMCC(root_context->IMC.hCompStr); - root_context->IMC.hCompStr = newCompStr; + send = (root_context->IMC.hCompStr!=NULL); - ImmInternalPostIMEMessage(WM_IME_COMPOSITION, 0, + ImmDestroyIMCC(root_context->IMC.hCompStr); + root_context->IMC.hCompStr = NULL; + + if (send) + ImmInternalPostIMEMessage(WM_IME_COMPOSITION, 0, GCS_COMPSTR); rc = TRUE; } @@ -1419,7 +1428,7 @@ BOOL WINAPI ImmNotifyIME( pX11DRV_ForceXIMReset(root_context->IMC.hWnd); { HIMCC newCompStr; - DWORD cplen; + DWORD cplen = 0; LPWSTR cpstr; LPCOMPOSITIONSTRING cs = NULL; LPBYTE cdata = NULL; @@ -1429,11 +1438,14 @@ BOOL WINAPI ImmNotifyIME( ImmDestroyIMCC(root_context->IMC.hCompStr); root_context->IMC.hCompStr = newCompStr; - cdata = ImmLockIMCC(root_context->IMC.hCompStr); - cs = (LPCOMPOSITIONSTRING)cdata; - cplen = cs->dwCompStrLen; - cpstr = (LPWSTR)&(cdata[cs->dwCompStrOffset]); - ImmUnlockIMCC(root_context->IMC.hCompStr); + if (root_context->IMC.hCompStr) + { + cdata = ImmLockIMCC(root_context->IMC.hCompStr); + cs = (LPCOMPOSITIONSTRING)cdata; + cplen = cs->dwCompStrLen; + cpstr = (LPWSTR)&(cdata[cs->dwCompStrOffset]); + ImmUnlockIMCC(root_context->IMC.hCompStr); + } if (cplen > 0) { WCHAR param = cpstr[0]; diff --git a/reactos/dll/win32/imm32/imm32.rbuild b/reactos/dll/win32/imm32/imm32.rbuild index 35c59bb8374..d0c4cceefb7 100644 --- a/reactos/dll/win32/imm32/imm32.rbuild +++ b/reactos/dll/win32/imm32/imm32.rbuild @@ -1,5 +1,6 @@ + . @@ -16,3 +17,4 @@ version.rc imm32.spec +