Commit 7ad7ec5b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Store font code page in DC_ATTR.

parent 6caf861a
......@@ -80,8 +80,8 @@ static void set_initial_dc_state( DC *dc )
dc->attr->vport_ext.cy = 1;
dc->attr->miter_limit = 10.0f; /* 10.0 is the default, from MSDN */
dc->attr->layout = 0;
dc->font_code_page = CP_ACP;
dc->attr->rop_mode = R2_COPYPEN;
dc->attr->font_code_page = CP_ACP;
dc->attr->poly_fill_mode = ALTERNATE;
dc->attr->stretch_blt_mode = BLACKONWHITE;
dc->attr->rel_abs_mode = ABSOLUTE;
......
......@@ -4164,22 +4164,6 @@ static BOOL get_char_positions_indices( DC *dc, const WORD *indices, INT count,
}
/***********************************************************************
* GdiGetCodePage (GDI32.@)
*/
DWORD WINAPI GdiGetCodePage( HDC hdc )
{
UINT cp = CP_ACP;
DC *dc = get_dc_ptr( hdc );
if (dc)
{
cp = dc->font_code_page;
release_dc_ptr( dc );
}
return cp;
}
/***********************************************************************
* get_text_charset_info
*
* Internal version of GetTextCharsetInfo() that takes a DC pointer.
......@@ -4457,14 +4441,14 @@ static void update_font_code_page( DC *dc, HANDLE font )
/* Hmm, nicely designed api this one! */
if (TranslateCharsetInfo( ULongToPtr(charset), &csi, TCI_SRCCHARSET) )
dc->font_code_page = csi.ciACP;
dc->attr->font_code_page = csi.ciACP;
else {
switch(charset) {
case OEM_CHARSET:
dc->font_code_page = GetOEMCP();
dc->attr->font_code_page = GetOEMCP();
break;
case DEFAULT_CHARSET:
dc->font_code_page = GetACP();
dc->attr->font_code_page = GetACP();
break;
case VISCII_CHARSET:
......@@ -4481,17 +4465,17 @@ static void update_font_code_page( DC *dc, HANDLE font )
each of these, but since it's broken anyway we'll just
use CP_ACP and hope it'll go away...
*/
dc->font_code_page = CP_ACP;
dc->attr->font_code_page = CP_ACP;
break;
default:
FIXME("Can't find codepage for charset %d\n", charset);
dc->font_code_page = CP_ACP;
dc->attr->font_code_page = CP_ACP;
break;
}
}
TRACE("charset %d => cp %d\n", charset, dc->font_code_page);
TRACE( "charset %d => cp %d\n", charset, dc->attr->font_code_page );
}
/***********************************************************************
......
......@@ -99,7 +99,6 @@ typedef struct tagDC
const struct font_gamma_ramp *font_gamma_ramp;
UINT font_code_page;
INT breakExtra; /* breakTotalExtra / breakCount */
INT breakRem; /* breakTotalExtra % breakCount */
ABORTPROC pAbortProc; /* AbortProc for Printing */
......
......@@ -738,6 +738,15 @@ static void text_metric_WtoA( const TEXTMETRICW *tmW, TEXTMETRICA *tmA )
}
/***********************************************************************
* GdiGetCodePage (GDI32.@)
*/
DWORD WINAPI GdiGetCodePage( HDC hdc )
{
DC_ATTR *dc_attr = get_dc_attr( hdc );
return dc_attr ? dc_attr->font_code_page : CP_ACP;
}
/***********************************************************************
* ExtTextOutW (GDI32.@)
*/
BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
......
......@@ -156,6 +156,7 @@ typedef struct DC_ATTR
SIZE vport_ext; /* viewport extent */
SIZE virtual_res;
SIZE virtual_size;
UINT font_code_page;
void *emf;
} DC_ATTR;
......
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