Module: wine Branch: master Commit: ea323d1349bbe5ae59d18af620dd7f24242b3547 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ea323d1349bbe5ae59d18af620...
Author: Hans Leidekker hans@codeweavers.com Date: Mon Nov 24 10:21:55 2008 +0100
gdiplus: Implement GdipNewPrivateFontCollection and GdipDeletePrivateFontCollection.
---
dlls/gdiplus/font.c | 18 ++++++++++++++---- dlls/gdiplus/gdiplus_private.h | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 9348f5b..71df288 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -789,12 +789,17 @@ 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)->FontFamilies = NULL; + (*fontCollection)->count = 0; + return Ok; }
/***************************************************************************** @@ -802,12 +807,17 @@ GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection** fontCollecti */ GpStatus WINGDIPAPI GdipDeletePrivateFontCollection(GpFontCollection **fontCollection) { - FIXME("stub %p\n", fontCollection); + INT i; + + TRACE("%p\n", fontCollection);
if (!fontCollection) return InvalidParameter;
- return NotImplemented; + for (i = 0; i < (*fontCollection)->count; i++) GdipFree((*fontCollection)->FontFamilies[i]); + GdipFree(*fontCollection); + + return Ok; }
/***************************************************************************** diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 57d63c2..2dde79b 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -225,7 +225,8 @@ struct GpStringFormat{ };
struct GpFontCollection{ - GpFontFamily* FontFamilies; + GpFontFamily **FontFamilies; + INT count; };
struct GpFontFamily{