Aric Stewart : imm: Implement GetCompositionFont.

Alexandre Julliard julliard at winehq.org
Tue Apr 1 16:44:15 CDT 2008


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Apr  1 11:13:36 2008 -0500

imm: Implement GetCompositionFont.

---

 dlls/imm32/imm.c |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 866c3e3..ab57bce 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -917,9 +917,19 @@ BOOL WINAPI ImmGetCandidateWindow(
  */
 BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
 {
-  FIXME("(%p, %p): stub\n", hIMC, lplf);
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return FALSE;
+    LOGFONTW lfW;
+    BOOL rc;
+
+    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,
+                        LF_FACESIZE, NULL, NULL);
+    }
+    return rc;
 }
 
 /***********************************************************************
@@ -927,9 +937,16 @@ BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
  */
 BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
 {
-  FIXME("(%p, %p): stub\n", hIMC, lplf);
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return FALSE;
+    InputContextData *data = (InputContextData*)hIMC;
+
+    TRACE("(%p, %p):\n", hIMC, lplf);
+
+    if (!data)
+        return FALSE;
+
+    *lplf = data->IMC.lfFont.W;
+
+    return TRUE;
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list