diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c index fbc6a1bdbf3..cac3b8f9045 100644 --- a/graphics/x11drv/xfont.c +++ b/graphics/x11drv/xfont.c @@ -2993,10 +2993,6 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font ) hPrevFont = dc->w.hFont; dc->w.hFont = hfont; - dc->w.codepage = CP_ACP; - /* NOTE: the codepage of UNICODE is treated as CP_ACP(=0) */ - if ( CHECK_PFONT(physDev->font) ) - dc->w.codepage = __PFONT(physDev->font)->fi->codepage; LeaveCriticalSection( &crtsc_fonts_X11 ); diff --git a/include/gdi.h b/include/gdi.h index 736c8533bc3..91b5fd186ab 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -134,7 +134,6 @@ typedef struct XFORM xformWorld2Vport; /* World-to-viewport transformation */ XFORM xformVport2World; /* Inverse of the above transformation */ BOOL vport2WorldValid; /* Is xformVport2World valid? */ - WORD codepage; /* codepage of the selected font */ } WIN_DC_INFO; diff --git a/objects/dc.c b/objects/dc.c index b7c761d22ac..7ed1bf50fcb 100644 --- a/objects/dc.c +++ b/objects/dc.c @@ -73,7 +73,6 @@ static void DC_Init_DC_INFO( WIN_DC_INFO *win_dc_info ) win_dc_info->xformWorld2Vport = win_dc_info->xformWorld2Wnd; win_dc_info->xformVport2World = win_dc_info->xformWorld2Wnd; win_dc_info->vport2WorldValid = TRUE; - win_dc_info->codepage = CP_ACP; PATH_InitGdiPath(&win_dc_info->path); } diff --git a/objects/font.c b/objects/font.c index f1f930adb94..d8eff58af17 100644 --- a/objects/font.c +++ b/objects/font.c @@ -890,6 +890,7 @@ BOOL WINAPI GetTextExtentPoint32A( HDC hdc, LPCSTR str, INT count, LPSIZE size ) { BOOL ret = FALSE; + UINT codepage = CP_ACP; /* FIXME: get codepage of font charset */ DC * dc = DC_GetDCPtr( hdc ); if (!dc) return FALSE; @@ -899,11 +900,11 @@ BOOL WINAPI GetTextExtentPoint32A( HDC hdc, LPCSTR str, INT count, /* str may not be 0 terminated so we can't use HEAP_strdupWtoA. * So we use MultiByteToWideChar. */ - UINT wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,NULL,0); + UINT wlen = MultiByteToWideChar(codepage,0,str,count,NULL,0); LPWSTR p = HeapAlloc( GetProcessHeap(), 0, wlen * sizeof(WCHAR) ); if (p) { - wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,p,wlen); + wlen = MultiByteToWideChar(codepage,0,str,count,p,wlen); ret = dc->funcs->pGetTextExtentPoint( dc, p, wlen, size ); HeapFree( GetProcessHeap(), 0, p ); } diff --git a/objects/text.c b/objects/text.c index e43af0d46fa..9a599b85670 100644 --- a/objects/text.c +++ b/objects/text.c @@ -54,6 +54,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, { DC * dc = DC_GetDCUpdate( hdc ); LPWSTR p; + UINT codepage = CP_ACP; /* FIXME: get codepage of font charset */ BOOL ret = FALSE; LPINT lpDxW = NULL; @@ -61,7 +62,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, if (dc->funcs->pExtTextOut) { - UINT wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,NULL,0); + UINT wlen = MultiByteToWideChar(codepage,0,str,count,NULL,0); if (lpDx) { int i = 0, j = 0; @@ -69,7 +70,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, lpDxW = (LPINT)HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(INT)); while(i < count) { - if(IsDBCSLeadByteEx(dc->w.codepage, str[i])) + if(IsDBCSLeadByteEx(codepage, str[i])) { lpDxW[j++] = lpDx[i] + lpDx[i+1]; i = i + 2; @@ -83,7 +84,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, } if ((p = HeapAlloc( GetProcessHeap(), 0, wlen * sizeof(WCHAR) ))) { - wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,p,wlen); + wlen = MultiByteToWideChar(codepage,0,str,count,p,wlen); ret = dc->funcs->pExtTextOut( dc, x, y, flags, lprect, p, wlen, lpDxW ); HeapFree( GetProcessHeap(), 0, p ); }