Commit 5e8253aa authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

gdiplus: Assign to structs instead of using memcpy.

parent da0a48d2
......@@ -95,7 +95,7 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
if(!font || !graphics || !lfw)
return InvalidParameter;
memcpy(lfw, &font->lfw, sizeof(LOGFONTW));
*lfw = font->lfw;
return Ok;
}
......@@ -1426,7 +1426,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
* width, angle). */
SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw));
GetTextMetricsW(graphics->hdc, &textmet);
memcpy(&lfw, &font->lfw, sizeof(LOGFONTW));
lfw = font->lfw;
lfw.lfHeight = roundr(((REAL)lfw.lfHeight) * rel_height);
lfw.lfWidth = roundr(textmet.tmAveCharWidth * rel_width);
......@@ -1811,7 +1811,7 @@ GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix
if(!graphics || !matrix)
return InvalidParameter;
memcpy(matrix, graphics->worldtrans, sizeof(GpMatrix));
*matrix = *graphics->worldtrans;
return Ok;
}
......
......@@ -281,7 +281,7 @@ GpStatus WINGDIPAPI GdipClonePath(GpPath* path, GpPath **clone)
*clone = GdipAlloc(sizeof(GpPath));
if(!*clone) return OutOfMemory;
memcpy(*clone, path, sizeof(GpPath));
**clone = *path;
(*clone)->pathdata.Points = GdipAlloc(path->datalen * sizeof(PointF));
(*clone)->pathdata.Types = GdipAlloc(path->datalen);
......
......@@ -441,7 +441,7 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
if(!image || !srcRect || !srcUnit)
return InvalidParameter;
if(image->type == ImageTypeMetafile){
memcpy(srcRect, &((GpMetafile*)image)->bounds, sizeof(GpRectF));
*srcRect = ((GpMetafile*)image)->bounds;
*srcUnit = ((GpMetafile*)image)->unit;
}
else if(image->type == ImageTypeBitmap){
......
......@@ -97,7 +97,7 @@ GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone)
*clone = GdipAlloc(sizeof(GpMatrix));
if(!*clone) return OutOfMemory;
memcpy(*clone, matrix, sizeof(GpMatrix));
**clone = *matrix;
return Ok;
}
......
......@@ -75,7 +75,7 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
*clonepen = GdipAlloc(sizeof(GpPen));
if(!*clonepen) return OutOfMemory;
memcpy(*clonepen, pen, sizeof(GpPen));
**clonepen = *pen;
GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);
GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
......
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