gdiplus: Implement GdipCloneFontFamily.
This commit is contained in:
parent
cbce618067
commit
638f63d13f
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue