Commit 932c6f5b authored by Laurent Vromman's avatar Laurent Vromman Committed by Alexandre Julliard

gdi32: Correct WidenPath behaviour when working on an open path.

parent 525fd823
...@@ -1778,13 +1778,13 @@ static BOOL PATH_WidenPath(DC *dc) ...@@ -1778,13 +1778,13 @@ static BOOL PATH_WidenPath(DC *dc)
pPath = &dc->path; pPath = &dc->path;
PATH_FlattenPath(pPath); if(pPath->state == PATH_Open) {
SetLastError(ERROR_CAN_NOT_COMPLETE);
if(pPath->state != PATH_Closed) {
ERR("Path Closed\n");
return FALSE; return FALSE;
} }
PATH_FlattenPath(pPath);
size = GetObjectW( dc->hPen, 0, NULL ); size = GetObjectW( dc->hPen, 0, NULL );
if (!size) return FALSE; if (!size) return FALSE;
......
...@@ -35,7 +35,8 @@ static void test_widenpath(void) ...@@ -35,7 +35,8 @@ static void test_widenpath(void)
HPEN greenPen, narrowPen; HPEN greenPen, narrowPen;
HPEN oldPen; HPEN oldPen;
POINT pnt[6]; POINT pnt[6];
INT nSize; INT nSize, ret;
DWORD error;
/* Create a pen to be used in WidenPath */ /* Create a pen to be used in WidenPath */
greenPen = CreatePen(PS_SOLID, 10, RGB(0,0,0)); greenPen = CreatePen(PS_SOLID, 10, RGB(0,0,0));
...@@ -70,12 +71,12 @@ static void test_widenpath(void) ...@@ -70,12 +71,12 @@ static void test_widenpath(void)
AbortPath(hdc); AbortPath(hdc);
todo_wine { /* Test WidenPath with an open path */
/* Test WidenPath with an empty path */ SetLastError(0xdeadbeef);
SetLastError(0xdeadbeef); BeginPath(hdc);
BeginPath(hdc); ret = WidenPath(hdc);
ok(WidenPath(hdc) == FALSE, "WidenPath fails while widening an empty path. Error : %d\n", GetLastError()); 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); AbortPath(hdc);
......
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