ByeongSik Jeon : imm32: Updated implementation of the Imm{Get|Set}CompositionFont{A|W}.
Alexandre Julliard
julliard at winehq.org
Mon Apr 28 08:01:34 CDT 2008
Module: wine
Branch: master
Commit: 4ce9b42c80472150df22cad924e65d1ece99f6aa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4ce9b42c80472150df22cad924e65d1ece99f6aa
Author: ByeongSik Jeon <bsjeon at hanmail.net>
Date: Sat Apr 26 00:19:42 2008 +0900
imm32: Updated implementation of the Imm{Get|Set}CompositionFont{A|W}.
---
dlls/imm32/imm.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 2a29361..2247cf4 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -774,13 +774,13 @@ BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
TRACE("(%p, %p):\n", hIMC, lplf);
rc = ImmGetCompositionFontW(hIMC,&lfW);
- if (rc)
- {
- memcpy(lplf,&lfW,sizeof(LOGFONTA));
- WideCharToMultiByte(CP_ACP, 0, lfW.lfFaceName, -1, lplf->lfFaceName,
+ if (!rc || !lplf)
+ return FALSE;
+
+ memcpy(lplf,&lfW,sizeof(LOGFONTA));
+ WideCharToMultiByte(CP_ACP, 0, lfW.lfFaceName, -1, lplf->lfFaceName,
LF_FACESIZE, NULL, NULL);
- }
- return rc;
+ return TRUE;
}
/***********************************************************************
@@ -792,7 +792,7 @@ BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
TRACE("(%p, %p):\n", hIMC, lplf);
- if (!data)
+ if (!data || !lplf)
return FALSE;
*lplf = data->IMC.lfFont.W;
@@ -1658,12 +1658,13 @@ BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
InputContextData *data = (InputContextData*)hIMC;
TRACE("(%p, %p)\n", hIMC, lplf);
- if (!data)
+ if (!data || !lplf)
return FALSE;
memcpy(&data->IMC.lfFont.W,lplf,sizeof(LOGFONTA));
MultiByteToWideChar(CP_ACP, 0, lplf->lfFaceName, -1, data->IMC.lfFont.W.lfFaceName,
LF_FACESIZE);
+ ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, 0, IMC_SETCOMPOSITIONFONT);
ImmInternalSendIMENotify(data, IMN_SETCOMPOSITIONFONT, 0);
return TRUE;
@@ -1677,10 +1678,11 @@ BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
InputContextData *data = (InputContextData*)hIMC;
TRACE("(%p, %p)\n", hIMC, lplf);
- if (!data)
+ if (!data || !lplf)
return FALSE;
data->IMC.lfFont.W = *lplf;
+ ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, 0, IMC_SETCOMPOSITIONFONT);
ImmInternalSendIMENotify(data, IMN_SETCOMPOSITIONFONT, 0);
return TRUE;
More information about the wine-cvs
mailing list