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

Alexandre Julliard julliard at winehq.org
Tue Mar 13 13:50:36 CDT 2012


Module: wine
Branch: master
Commit: fc03398cd50a338739dc2bc815d09091a535cf8b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fc03398cd50a338739dc2bc815d09091a535cf8b

Author: Kusanagi Kouichi <slash at ac.auone-net.jp>
Date:   Thu Mar  8 22:33:08 2012 +0900

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

---

 dlls/gdi32/freetype.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index c6bfe8d..9a4a6b6 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -4626,6 +4626,15 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
     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)
 {
     struct list *face_elem_ptr;
@@ -4634,7 +4643,6 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
 
     LIST_FOR_EACH(face_elem_ptr, &family->faces)
     {
-        static const WCHAR spaceW[] = { ' ',0 };
         WCHAR full_family_name[LF_FULLFACESIZE];
         Face *face = LIST_ENTRY(face_elem_ptr, Face, entry);
 
@@ -4645,9 +4653,7 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
             continue;
         }
 
-        strcpyW(full_family_name, family->FamilyName);
-        strcatW(full_family_name, spaceW);
-        strcatW(full_family_name, face->StyleName);
+        create_full_name(full_family_name, family->FamilyName, face->StyleName);
         if (!strcmpiW(lf->lfFaceName, full_family_name)) return TRUE;
     }
 
@@ -4656,7 +4662,6 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
 
 static BOOL face_matches(Face *face, const LOGFONTW *lf)
 {
-    static const WCHAR spaceW[] = { ' ',0 };
     WCHAR full_family_name[LF_FULLFACESIZE];
 
     if (!strcmpiW(lf->lfFaceName, face->family->FamilyName)) return TRUE;
@@ -4668,9 +4673,7 @@ static BOOL face_matches(Face *face, const LOGFONTW *lf)
         return FALSE;
     }
 
-    strcpyW(full_family_name, face->family->FamilyName);
-    strcatW(full_family_name, spaceW);
-    strcatW(full_family_name, face->StyleName);
+    create_full_name(full_family_name, face->family->FamilyName, face->StyleName);
     return !strcmpiW(lf->lfFaceName, full_family_name);
 }
 




More information about the wine-cvs mailing list