Commit 3311bbb3 authored by Kusanagi Kouichi's avatar Kusanagi Kouichi Committed by Alexandre Julliard

gdi32: Check if a character is double byte or single byte.

parent c8ebdff8
...@@ -2495,16 +2495,15 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat, ...@@ -2495,16 +2495,15 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat,
LPGLYPHMETRICS lpgm, DWORD cbBuffer, LPGLYPHMETRICS lpgm, DWORD cbBuffer,
LPVOID lpBuffer, const MAT2 *lpmat2 ) LPVOID lpBuffer, const MAT2 *lpmat2 )
{ {
LPWSTR p = NULL;
DWORD ret;
UINT c;
if (!lpmat2) return GDI_ERROR; if (!lpmat2) return GDI_ERROR;
if(!(fuFormat & GGO_GLYPH_INDEX)) { if(!(fuFormat & GGO_GLYPH_INDEX)) {
UINT cp;
int len; int len;
char mbchs[2]; char mbchs[2];
if(uChar > 0xff) { /* but, 2 bytes character only */
cp = GdiGetCodePage(hdc);
if (IsDBCSLeadByteEx(cp, uChar >> 8)) {
len = 2; len = 2;
mbchs[0] = (uChar & 0xff00) >> 8; mbchs[0] = (uChar & 0xff00) >> 8;
mbchs[1] = (uChar & 0xff); mbchs[1] = (uChar & 0xff);
...@@ -2512,14 +2511,11 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat, ...@@ -2512,14 +2511,11 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat,
len = 1; len = 1;
mbchs[0] = (uChar & 0xff); mbchs[0] = (uChar & 0xff);
} }
p = FONT_mbtowc(hdc, mbchs, len, NULL, NULL); MultiByteToWideChar(cp, 0, mbchs, len, (LPWSTR)&uChar, 1);
c = p[0]; }
} else
c = uChar; return GetGlyphOutlineW(hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer,
ret = GetGlyphOutlineW(hdc, c, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2);
lpmat2);
HeapFree(GetProcessHeap(), 0, p);
return ret;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -3194,7 +3194,6 @@ static void test_GetGlyphOutline(void) ...@@ -3194,7 +3194,6 @@ static void test_GetGlyphOutline(void)
ret = GetGlyphOutlineA(hdc, 0x8041, GGO_BITMAP, &gm, 0, NULL, &mat); ret = GetGlyphOutlineA(hdc, 0x8041, GGO_BITMAP, &gm, 0, NULL, &mat);
ret2 = GetGlyphOutlineA(hdc, 0x41, GGO_BITMAP, &gm2, 0, NULL, &mat); ret2 = GetGlyphOutlineA(hdc, 0x41, GGO_BITMAP, &gm2, 0, NULL, &mat);
todo_wine
ok(ret == ret2 && memcmp(&gm, &gm2, sizeof gm) == 0, "%d %d\n", ret, ret2); ok(ret == ret2 && memcmp(&gm, &gm2, sizeof gm) == 0, "%d %d\n", ret, ret2);
ret = GetGlyphOutlineA(hdc, c[i].a, GGO_BITMAP, &gm, 0, NULL, &mat); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_BITMAP, &gm, 0, NULL, &mat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment