From 932c6f5bdda350b2a24fb2b35e202ec36f2eca25 Mon Sep 17 00:00:00 2001 From: Laurent Vromman Date: Tue, 3 Apr 2007 07:45:40 +0200 Subject: [PATCH] gdi32: Correct WidenPath behaviour when working on an open path. --- dlls/gdi32/path.c | 8 ++++---- dlls/gdi32/tests/path.c | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index c3b1f1c768e..22c153f0993 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -1778,13 +1778,13 @@ static BOOL PATH_WidenPath(DC *dc) pPath = &dc->path; - PATH_FlattenPath(pPath); - - if(pPath->state != PATH_Closed) { - ERR("Path Closed\n"); + if(pPath->state == PATH_Open) { + SetLastError(ERROR_CAN_NOT_COMPLETE); return FALSE; } + PATH_FlattenPath(pPath); + size = GetObjectW( dc->hPen, 0, NULL ); if (!size) return FALSE; diff --git a/dlls/gdi32/tests/path.c b/dlls/gdi32/tests/path.c index 074a151080a..e9a6d39aeeb 100644 --- a/dlls/gdi32/tests/path.c +++ b/dlls/gdi32/tests/path.c @@ -35,7 +35,8 @@ static void test_widenpath(void) HPEN greenPen, narrowPen; HPEN oldPen; POINT pnt[6]; - INT nSize; + INT nSize, ret; + DWORD error; /* Create a pen to be used in WidenPath */ greenPen = CreatePen(PS_SOLID, 10, RGB(0,0,0)); @@ -70,12 +71,12 @@ static void test_widenpath(void) AbortPath(hdc); - todo_wine { - /* Test WidenPath with an empty path */ - SetLastError(0xdeadbeef); - BeginPath(hdc); - ok(WidenPath(hdc) == FALSE, "WidenPath fails while widening an empty path. Error : %d\n", GetLastError()); - } + /* Test WidenPath with an open path */ + SetLastError(0xdeadbeef); + BeginPath(hdc); + ret = WidenPath(hdc); + error = GetLastError(); + ok(ret == FALSE && GetLastError() == ERROR_CAN_NOT_COMPLETE, "WidenPath fails while widening an open path. Return value is %d, should be %d. Error is %08x, should be %08x\n", ret, FALSE, GetLastError(), ERROR_CAN_NOT_COMPLETE); AbortPath(hdc); -- 2.11.4.GIT