Marcin Grześkowiak : user32: Use charset of currently selected font in DrawTextExA.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 28 06:42:08 CDT 2007


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

Author: Marcin Grześkowiak <mgrzeskowiak at tlen.pl>
Date:   Mon Mar 26 22:58:20 2007 +0200

user32: Use charset of currently selected font in DrawTextExA.

---

 dlls/user32/text.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/text.c b/dlls/user32/text.c
index e03130e..cd1cc75 100644
--- a/dlls/user32/text.c
+++ b/dlls/user32/text.c
@@ -1030,6 +1030,7 @@ INT WINAPI DrawTextExA( HDC hdc, LPSTR str, INT count,
    DWORD wcount;
    DWORD wmax;
    DWORD amax;
+   UINT cp;
 
    if (!count) return 0;
    if( !str || ((count == -1) && !(count = strlen(str))))
@@ -1041,7 +1042,8 @@ INT WINAPI DrawTextExA( HDC hdc, LPSTR str, INT count,
         }
         return 0;
    }
-   wcount = MultiByteToWideChar( CP_ACP, 0, str, count, NULL, 0 );
+   cp = GdiGetCodePage( hdc );
+   wcount = MultiByteToWideChar( cp, 0, str, count, NULL, 0 );
    wmax = wcount;
    amax = count;
    if (flags & DT_MODIFYSTRING)
@@ -1052,7 +1054,7 @@ INT WINAPI DrawTextExA( HDC hdc, LPSTR str, INT count,
    wstr = HeapAlloc(GetProcessHeap(), 0, wmax * sizeof(WCHAR));
    if (wstr)
    {
-       MultiByteToWideChar( CP_ACP, 0, str, count, wstr, wcount );
+       MultiByteToWideChar( cp, 0, str, count, wstr, wcount );
        if (flags & DT_MODIFYSTRING)
            for (i=4, p=wstr+wcount; i--; p++) *p=0xFFFE;
            /* Initialise the extra characters so that we can see which ones
@@ -1066,7 +1068,7 @@ INT WINAPI DrawTextExA( HDC hdc, LPSTR str, INT count,
              * and so we need to measure it ourselves.
              */
             for (i=4, p=wstr+wcount; i-- && *p != 0xFFFE; p++) wcount++;
-            WideCharToMultiByte( CP_ACP, 0, wstr, wcount, str, amax, NULL, NULL );
+            WideCharToMultiByte( cp, 0, wstr, wcount, str, amax, NULL, NULL );
        }
        HeapFree(GetProcessHeap(), 0, wstr);
    }




More information about the wine-cvs mailing list