gdiplus: Copy custom dashes in GdipClonePen.

This commit is contained in:
Vincent Povirk 2013-08-14 16:35:11 -05:00 committed by Alexandre Julliard
parent dc047ecdaa
commit 2c3142f0ee
1 changed files with 10 additions and 0 deletions

View File

@ -102,6 +102,7 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
(*clonepen)->customstart = NULL;
(*clonepen)->customend = NULL;
(*clonepen)->brush = NULL;
(*clonepen)->dashes = NULL;
stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);
@ -111,6 +112,15 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
if (stat == Ok && pen->customend)
stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
if (stat == Ok && pen->dashes)
{
(*clonepen)->dashes = GdipAlloc(pen->numdashes * sizeof(REAL));
if ((*clonepen)->dashes)
memcpy((*clonepen)->dashes, pen->dashes, pen->numdashes * sizeof(REAL));
else
stat = OutOfMemory;
}
if (stat != Ok)
{
GdipDeletePen(*clonepen);