Commit 5c987fc5 authored by Kusanagi Kouichi's avatar Kusanagi Kouichi Committed by Alexandre Julliard

gdi32: GetCharABCWidthsA should work for DBCS.

parent fcb4a161
......@@ -2296,18 +2296,33 @@ BOOL WINAPI GetAspectRatioFilterEx( HDC hdc, LPSIZE pAspectRatio )
BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar,
LPABC abc )
{
INT i, wlen, count = (INT)(lastChar - firstChar + 1);
INT i, wlen;
UINT c;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
if(count <= 0) return FALSE;
if (lastChar < firstChar)
return FALSE;
str = HeapAlloc(GetProcessHeap(), 0, count);
for(i = 0; i < count; i++)
str[i] = (BYTE)(firstChar + i);
str = HeapAlloc(GetProcessHeap(), 0, (lastChar - firstChar + 1) * 2 + 1);
if (str == NULL)
return FALSE;
wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL);
for(i = 0, c = firstChar; c <= lastChar; i++, c++)
{
if (c > 0xff)
str[i++] = (BYTE)(c >> 8);
str[i] = (BYTE)c;
}
str[i] = '\0';
wstr = FONT_mbtowc(hdc, str, -1, &wlen, NULL);
if (wstr == NULL)
{
HeapFree(GetProcessHeap(), 0, str);
return FALSE;
}
for(i = 0; i < wlen; i++)
{
......
......@@ -973,7 +973,6 @@ static void test_GetCharABCWidths(void)
memset(a, 0, sizeof a);
memset(w, 0, sizeof w);
hfont = SelectObject(hdc, hfont);
todo_wine
ok(pGetCharABCWidthsA(hdc, c[i].a, c[i].a + 1, a) &&
pGetCharABCWidthsW(hdc, c[i].w, c[i].w + 1, w) &&
memcmp(a, w, sizeof a) == 0,
......
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