mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
gdiplus: Return copies of fonts from GdipGetFontCollectionFamilyList.
This commit is contained in:
parent
3847c2dec9
commit
5694825ae3
@ -963,18 +963,33 @@ GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(
|
||||
GpFontFamily* gpfamilies[], INT* numFound)
|
||||
{
|
||||
INT i;
|
||||
GpStatus stat=Ok;
|
||||
|
||||
TRACE("%p, %d, %p, %p\n", fontCollection, numSought, gpfamilies, numFound);
|
||||
|
||||
if (!(fontCollection && gpfamilies && numFound))
|
||||
return InvalidParameter;
|
||||
|
||||
for (i = 0; i < numSought && i < fontCollection->count; i++)
|
||||
memset(gpfamilies, 0, sizeof(*gpfamilies) * numSought);
|
||||
|
||||
for (i = 0; i < numSought && i < fontCollection->count && stat == Ok; i++)
|
||||
{
|
||||
gpfamilies[i] = fontCollection->FontFamilies[i];
|
||||
stat = GdipCloneFontFamily(fontCollection->FontFamilies[i], &gpfamilies[i]);
|
||||
}
|
||||
*numFound = i;
|
||||
return Ok;
|
||||
|
||||
if (stat == Ok)
|
||||
*numFound = i;
|
||||
else
|
||||
{
|
||||
int numToFree=i;
|
||||
for (i=0; i<numToFree; i++)
|
||||
{
|
||||
GdipDeleteFontFamily(gpfamilies[i]);
|
||||
gpfamilies[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
void free_installed_fonts(void)
|
||||
|
Loading…
Reference in New Issue
Block a user