Commit 90fb4748 authored by David Kahurani's avatar David Kahurani Committed by Alexandre Julliard

gdiplus: Use GdipCreatePath2 in GdipClonePath.

This seems like a more effective interface and avoids code duplication. Signed-off-by: 's avatarDavid Kahurani <k.kahurani@gmail.com>
parent ba6a6d57
......@@ -1185,24 +1185,15 @@ GpStatus WINGDIPAPI GdipClonePath(GpPath* path, GpPath **clone)
if(!path || !clone)
return InvalidParameter;
*clone = malloc(sizeof(GpPath));
if (path->pathdata.Count)
return GdipCreatePath2(path->pathdata.Points, path->pathdata.Types, path->pathdata.Count,
path->fill, clone);
else
{
*clone = calloc(1, sizeof(GpPath));
if(!*clone) return OutOfMemory;
**clone = *path;
(*clone)->pathdata.Points = malloc(path->datalen * sizeof(PointF));
(*clone)->pathdata.Types = malloc(path->datalen);
if(!(*clone)->pathdata.Points || !(*clone)->pathdata.Types){
free((*clone)->pathdata.Points);
free((*clone)->pathdata.Types);
free(*clone);
return OutOfMemory;
}
memcpy((*clone)->pathdata.Points, path->pathdata.Points,
path->datalen * sizeof(PointF));
memcpy((*clone)->pathdata.Types, path->pathdata.Types, path->datalen);
return Ok;
}
......
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