gdi32: Use GdiGetCodePage() instead of duplicating its functionality.
This commit is contained in:
parent
4bb8d9c1c2
commit
95156d1b5f
@ -2483,8 +2483,7 @@ BOOL WINAPI CreateScalableFontResourceW( DWORD fHidden,
|
|||||||
DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs,
|
DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs,
|
||||||
LPKERNINGPAIR kern_pairA )
|
LPKERNINGPAIR kern_pairA )
|
||||||
{
|
{
|
||||||
INT charset;
|
UINT cp;
|
||||||
CHARSETINFO csi;
|
|
||||||
CPINFO cpi;
|
CPINFO cpi;
|
||||||
DWORD i, total_kern_pairs, kern_pairs_copied = 0;
|
DWORD i, total_kern_pairs, kern_pairs_copied = 0;
|
||||||
KERNINGPAIR *kern_pairW;
|
KERNINGPAIR *kern_pairW;
|
||||||
@ -2495,22 +2494,17 @@ DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
charset = GetTextCharset(hDC);
|
cp = GdiGetCodePage(hDC);
|
||||||
if (!TranslateCharsetInfo(ULongToPtr(charset), &csi, TCI_SRCCHARSET))
|
|
||||||
{
|
|
||||||
FIXME("Can't find codepage for charset %d\n", charset);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* GetCPInfo() will fail on CP_SYMBOL, and WideCharToMultiByte is supposed
|
/* GetCPInfo() will fail on CP_SYMBOL, and WideCharToMultiByte is supposed
|
||||||
* to fail on an invalid character for CP_SYMBOL.
|
* to fail on an invalid character for CP_SYMBOL.
|
||||||
*/
|
*/
|
||||||
cpi.DefaultChar[0] = 0;
|
cpi.DefaultChar[0] = 0;
|
||||||
if (csi.ciACP != CP_SYMBOL && !GetCPInfo(csi.ciACP, &cpi))
|
if (cp != CP_SYMBOL && !GetCPInfo(cp, &cpi))
|
||||||
{
|
{
|
||||||
FIXME("Can't find codepage %u info\n", csi.ciACP);
|
FIXME("Can't find codepage %u info\n", cp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
TRACE("charset %d => codepage %u\n", charset, csi.ciACP);
|
|
||||||
|
|
||||||
total_kern_pairs = GetKerningPairsW(hDC, 0, NULL);
|
total_kern_pairs = GetKerningPairsW(hDC, 0, NULL);
|
||||||
if (!total_kern_pairs) return 0;
|
if (!total_kern_pairs) return 0;
|
||||||
@ -2522,10 +2516,10 @@ DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs,
|
|||||||
{
|
{
|
||||||
char first, second;
|
char first, second;
|
||||||
|
|
||||||
if (!WideCharToMultiByte(csi.ciACP, 0, &kern_pairW[i].wFirst, 1, &first, 1, NULL, NULL))
|
if (!WideCharToMultiByte(cp, 0, &kern_pairW[i].wFirst, 1, &first, 1, NULL, NULL))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!WideCharToMultiByte(csi.ciACP, 0, &kern_pairW[i].wSecond, 1, &second, 1, NULL, NULL))
|
if (!WideCharToMultiByte(cp, 0, &kern_pairW[i].wSecond, 1, &second, 1, NULL, NULL))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (first == cpi.DefaultChar[0] || second == cpi.DefaultChar[0])
|
if (first == cpi.DefaultChar[0] || second == cpi.DefaultChar[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user