[Gdiplus 06/16] Implement GdipCloneFontFamily

Adam Petaccia adam at tpetaccia.com
Thu Jul 3 13:26:22 CDT 2008


---
 dlls/gdiplus/font.c       |   19 +++++++++++++++++--
 dlls/gdiplus/tests/font.c |    3 ---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 6ad0502..0919b66 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -411,10 +411,25 @@ GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily* FontFamily, GpFontFamily**
 {
     if (!(FontFamily && clonedFontFamily)) return InvalidParameter;
 
-    FIXME("stub: %p (%s), %p\n", FontFamily,
+    TRACE("stub: %p (%s), %p\n", FontFamily,
             debugstr_w(FontFamily->FamilyName), clonedFontFamily);
 
-    return NotImplemented;
+    *clonedFontFamily = GdipAlloc(sizeof(GpFontFamily));
+    if (!*clonedFontFamily) return OutOfMemory;
+
+    **clonedFontFamily = *FontFamily;
+
+    (*clonedFontFamily)->FamilyName = GdipAlloc(sizeof(WCHAR) * LF_FACESIZE);
+    if (!(*clonedFontFamily)->FamilyName)
+    {
+        GdipFree (clonedFontFamily);
+        return OutOfMemory;
+    }
+
+    lstrcpynW((*clonedFontFamily)->FamilyName, FontFamily->FamilyName,
+            LF_FACESIZE);
+
+    return Ok;
 }
 
 /*******************************************************************************
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index ebb2ef3..0aa597d 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -182,15 +182,12 @@ static void test_fontfamily (void)
 
     /* Make sure we don't read old data */
     ZeroMemory (itsName, sizeof(itsName));
-todo_wine
-{
     stat = GdipCloneFontFamily(family, &clonedFontFamily);
     expect (Ok, stat);
     GdipDeleteFontFamily(family);
     stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL);
     expect(Ok, stat);
     expect(0, lstrcmpiW(itsName, arial));
-}
 
     GdipDeleteFontFamily(clonedFontFamily);
 }
-- 
1.5.4.3




More information about the wine-patches mailing list