Commit 638f63d1 authored by Adam Petaccia's avatar Adam Petaccia Committed by Alexandre Julliard

gdiplus: Implement GdipCloneFontFamily.

parent cbce6180
......@@ -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;
}
/*******************************************************************************
......
......@@ -150,7 +150,7 @@ static void test_logfont(void)
static void test_fontfamily (void)
{
GpFontFamily* family;
GpFontFamily *family, *clonedFontFamily;
WCHAR itsName[LF_FACESIZE];
GpStatus stat;
......@@ -180,7 +180,16 @@ static void test_fontfamily (void)
expect (Ok, stat);
}
/* Make sure we don't read old data */
ZeroMemory (itsName, sizeof(itsName));
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);
}
......
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