Commit 0c1e4223 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Don't call GetObjectW() unless necessary.

parent 41f763ea
......@@ -681,13 +681,15 @@ static void update_font_code_page( DC *dc, HANDLE font )
{
CHARSETINFO csi;
int charset = get_text_charset_info( dc, NULL, 0 );
LOGFONTW lf;
GetObjectW( font, sizeof(lf), &lf );
if (charset == ANSI_CHARSET && get_associated_charset_info() & ASSOC_CHARSET_ANSI)
{
LOGFONTW lf;
if (charset == ANSI_CHARSET && !(lf.lfClipPrecision & CLIP_DFA_DISABLE) &&
get_associated_charset_info() & ASSOC_CHARSET_ANSI)
charset = DEFAULT_CHARSET;
GetObjectW( font, sizeof(lf), &lf );
if (!(lf.lfClipPrecision & CLIP_DFA_DISABLE))
charset = DEFAULT_CHARSET;
}
/* Hmm, nicely designed api this one! */
if (TranslateCharsetInfo( ULongToPtr(charset), &csi, TCI_SRCCHARSET) )
......
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