Huw Davies : gdi32: Use a separate variable to indicate the default has been retrieved.
Alexandre Julliard
julliard at winehq.org
Wed Sep 28 14:45:46 CDT 2011
Module: wine
Branch: master
Commit: b4430319f16753270397e11310ac327736d438a4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b4430319f16753270397e11310ac327736d438a4
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Sep 28 13:46:48 2011 +0100
gdi32: Use a separate variable to indicate the default has been retrieved.
---
dlls/gdi32/freetype.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index d71b0c5..81c704b 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -4602,16 +4602,21 @@ DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
LPWORD pgi, DWORD flags)
{
int i;
- int default_char = -1;
+ WORD default_char;
+ BOOL got_default = FALSE;
- if (flags & GGI_MARK_NONEXISTING_GLYPHS) default_char = 0xffff; /* XP would use 0x1f for bitmap fonts */
+ if (flags & GGI_MARK_NONEXISTING_GLYPHS)
+ {
+ default_char = 0xffff; /* XP would use 0x1f for bitmap fonts */
+ got_default = TRUE;
+ }
for(i = 0; i < count; i++)
{
pgi[i] = get_glyph_index(font, lpstr[i]);
if (pgi[i] == 0)
{
- if (default_char == -1)
+ if (!got_default)
{
if (FT_IS_SFNT(font->ft_face))
{
@@ -4624,6 +4629,7 @@ DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
WineEngGetTextMetrics(font, &textm);
default_char = textm.tmDefaultChar;
}
+ got_default = TRUE;
}
pgi[i] = default_char;
}
More information about the wine-cvs
mailing list