From dfb750b9c2f3d57be332fe97f12a39ee737e7767 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 28 Apr 2016 18:49:07 +0200 Subject: [PATCH] gdi32/enhmfdrv: Don't update document bounds in PolyPolyline within a path. Signed-off-by: Piotr Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/gdi32/enhmfdrv/graphics.c | 5 +++-- dlls/gdi32/tests/metafile.c | 13 +++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index 1b5d26dd495..b139305b173 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -533,6 +533,7 @@ static BOOL EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys, DWORD iType) { + EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev; EMRPOLYPOLYLINE *emr; DWORD cptl = 0, poly, size, i; INT point; @@ -576,7 +577,7 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po if(use_small_emr) emr->emr.iType += EMR_POLYPOLYLINE16 - EMR_POLYPOLYLINE; emr->emr.nSize = size; - if(bounds_valid) + if(bounds_valid && !physDev->path) emr->rclBounds = bounds; else emr->rclBounds = empty; @@ -608,7 +609,7 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po ret = FALSE; SetLastError( ERROR_INVALID_PARAMETER ); } - if(ret) + if(ret && !physDev->path) EMFDRV_UpdateBBox( dev, &emr->rclBounds ); HeapFree( GetProcessHeap(), 0, emr ); return ret; diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 64ad00422fc..9a5c1a58d02 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -3585,7 +3585,7 @@ static const unsigned char EMF_PATH_BITS[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff, 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00, - 0xd4, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x0c, 0x02, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x3e, 0x04, 0x00, 0x00, @@ -3634,6 +3634,13 @@ static const unsigned char EMF_PATH_BITS[] = 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, + 0x5a, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x0a, 0x00, + 0x0a, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, @@ -3643,6 +3650,7 @@ static const unsigned char EMF_PATH_BITS[] = static void test_emf_GetPath(void) { POINT pts[4] = {{10, 10}, {20, 10}, {10, 20}, {20, 20}}; + DWORD counts[2] = {2, 2}; HDC hdcMetafile; HENHMETAFILE hemf; BOOL ret; @@ -3670,10 +3678,11 @@ static void test_emf_GetPath(void) Ellipse(hdcMetafile, 10, 10, 20, 20); RoundRect(hdcMetafile, 10, 10, 20, 20, 3, 5); Polyline(hdcMetafile, pts, 4); + PolyPolyline(hdcMetafile, pts, counts, 2); EndPath(hdcMetafile); size = GetPath(hdcMetafile, NULL, NULL, 0); - todo_wine ok( size == 73, "GetPath returned %d.\n", size); + todo_wine ok( size == 77, "GetPath returned %d.\n", size); hemf = CloseEnhMetaFile(hdcMetafile); ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());