[Gdiplus 2/5] Implement GdipNewPrivateFontCollection

Adam Petaccia adam at tpetaccia.com
Sat Aug 16 22:29:15 CDT 2008


---
 dlls/gdiplus/font.c            |   11 +++++++++--
 dlls/gdiplus/gdiplus_private.h |    1 +
 dlls/gdiplus/tests/font.c      |    5 +++--
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 70f7bb0..84a742b 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -668,12 +668,19 @@ GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamil
  */
 GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection** fontCollection)
 {
-    FIXME("stub %p\n", fontCollection);
+    TRACE("%p\n", fontCollection);
 
     if (!fontCollection)
         return InvalidParameter;
 
-    return NotImplemented;
+    *fontCollection = GdipAlloc(sizeof(GpFontCollection));
+    if (!*fontCollection)
+        return OutOfMemory;
+
+    (*fontCollection)->FamilyCount = 0;
+    (*fontCollection)->FontFamilies = NULL;
+
+    return Ok;
 }
 
 /*****************************************************************************
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index 3611239..da150ef 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -208,6 +208,7 @@ struct GpStringFormat{
 
 struct GpFontCollection{
     GpFontFamily* FontFamilies;
+    INT FamilyCount;
 };
 
 struct GpFontFamily{
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index b19f0aa..62ed0f9 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -348,7 +348,6 @@ static void test_fontcollections(void)
     BOOL hastahoma, hastimesnr;
 
     stat = GdipNewPrivateFontCollection(&PrivateFontCollection);
-todo_wine
     expect(Ok, stat);
     stat = GdipPrivateAddFontFile(PrivateFontCollection, NULL);
     expect(InvalidParameter, stat);
@@ -372,6 +371,7 @@ todo_wine{
 
     stat = GdipGetFontCollectionFamilyCount(PrivateFontCollection, &count);
     expect(Ok, stat);
+}
     expect(expected, count);
 
     expected = count;
@@ -380,6 +380,7 @@ todo_wine{
     fontFamily = GdipAlloc(sizeof(GpFontFamily*) * count);
     stat = GdipGetFontCollectionFamilyList(PrivateFontCollection, count,
             fontFamily, &count);
+todo_wine
     expect(Ok, stat);
     expect(expected, count);
     if (stat == Ok)
@@ -407,9 +408,9 @@ todo_wine{
         stat = GdipDeleteFontFamily(fontFamily[i]);
         expect(Ok, stat);
     }
-}
 
     stat = GdipDeletePrivateFontCollection(&PrivateFontCollection);
+todo_wine
     expect(Ok, stat);
 }
 
-- 
1.5.4.3




More information about the wine-patches mailing list