Commit fc03398c authored by Kusanagi Kouichi's avatar Kusanagi Kouichi Committed by Alexandre Julliard

gdi32: Add a helper function to create a full name from a family name and a style name.

parent d696d5fe
...@@ -4626,6 +4626,15 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf, ...@@ -4626,6 +4626,15 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
free_font(font); free_font(font);
} }
static void create_full_name(WCHAR *full_name, const WCHAR *family_name, const WCHAR *style_name)
{
static const WCHAR spaceW[] = { ' ', 0 };
strcpyW(full_name, family_name);
strcatW(full_name, spaceW);
strcatW(full_name, style_name);
}
static BOOL family_matches(Family *family, const LOGFONTW *lf) static BOOL family_matches(Family *family, const LOGFONTW *lf)
{ {
struct list *face_elem_ptr; struct list *face_elem_ptr;
...@@ -4634,7 +4643,6 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf) ...@@ -4634,7 +4643,6 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
LIST_FOR_EACH(face_elem_ptr, &family->faces) LIST_FOR_EACH(face_elem_ptr, &family->faces)
{ {
static const WCHAR spaceW[] = { ' ',0 };
WCHAR full_family_name[LF_FULLFACESIZE]; WCHAR full_family_name[LF_FULLFACESIZE];
Face *face = LIST_ENTRY(face_elem_ptr, Face, entry); Face *face = LIST_ENTRY(face_elem_ptr, Face, entry);
...@@ -4645,9 +4653,7 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf) ...@@ -4645,9 +4653,7 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
continue; continue;
} }
strcpyW(full_family_name, family->FamilyName); create_full_name(full_family_name, family->FamilyName, face->StyleName);
strcatW(full_family_name, spaceW);
strcatW(full_family_name, face->StyleName);
if (!strcmpiW(lf->lfFaceName, full_family_name)) return TRUE; if (!strcmpiW(lf->lfFaceName, full_family_name)) return TRUE;
} }
...@@ -4656,7 +4662,6 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf) ...@@ -4656,7 +4662,6 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
static BOOL face_matches(Face *face, const LOGFONTW *lf) static BOOL face_matches(Face *face, const LOGFONTW *lf)
{ {
static const WCHAR spaceW[] = { ' ',0 };
WCHAR full_family_name[LF_FULLFACESIZE]; WCHAR full_family_name[LF_FULLFACESIZE];
if (!strcmpiW(lf->lfFaceName, face->family->FamilyName)) return TRUE; if (!strcmpiW(lf->lfFaceName, face->family->FamilyName)) return TRUE;
...@@ -4668,9 +4673,7 @@ static BOOL face_matches(Face *face, const LOGFONTW *lf) ...@@ -4668,9 +4673,7 @@ static BOOL face_matches(Face *face, const LOGFONTW *lf)
return FALSE; return FALSE;
} }
strcpyW(full_family_name, face->family->FamilyName); create_full_name(full_family_name, face->family->FamilyName, face->StyleName);
strcatW(full_family_name, spaceW);
strcatW(full_family_name, face->StyleName);
return !strcmpiW(lf->lfFaceName, full_family_name); return !strcmpiW(lf->lfFaceName, full_family_name);
} }
......
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