gdi32: Use the helper function in GetCharWidth32A to support DBCS.

This commit is contained in:
Akihiro Sagawa 2011-01-16 23:00:27 +09:00 committed by Alexandre Julliard
parent b9c41636bb
commit da76ffa90e
1 changed files with 5 additions and 7 deletions

View File

@ -1615,18 +1615,16 @@ BOOL WINAPI GetCharWidth32W( HDC hdc, UINT firstChar, UINT lastChar,
BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar,
LPINT buffer )
{
INT i, wlen, count = (INT)(lastChar - firstChar + 1);
INT i, wlen;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
if(count <= 0) return FALSE;
str = FONT_GetCharsByRangeA(firstChar, lastChar, &i);
if(str == NULL)
return FALSE;
str = HeapAlloc(GetProcessHeap(), 0, count);
for(i = 0; i < count; i++)
str[i] = (BYTE)(firstChar + i);
wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL);
wstr = FONT_mbtowc(hdc, str, i, &wlen, NULL);
for(i = 0; i < wlen; i++)
{