From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/pathiterator.c | 25 ++++++++++++++++++++++--- dlls/gdiplus/tests/pathiterator.c | 18 ++++++++++++++++-- 2 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/dlls/gdiplus/pathiterator.c b/dlls/gdiplus/pathiterator.c index 2addbc3bc57..1e440c080ec 100644 --- a/dlls/gdiplus/pathiterator.c +++ b/dlls/gdiplus/pathiterator.c @@ -295,12 +295,31 @@ GpStatus WINGDIPAPI GdipPathIterIsValid(GpPathIterator* iterator, BOOL* valid) GpStatus WINGDIPAPI GdipPathIterNextPathType(GpPathIterator* iter, INT* result, BYTE* type, INT* start, INT* end) { - FIXME("(%p, %p, %p, %p, %p) stub\n", iter, result, type, start, end); + INT i; + TRACE("(%p, %p, %p, %p, %p)\n", iter, result, type, start, end);
- if(!iter || !result || !type || !start || !end) + if (!iter || !result || !type || !start || !end) return InvalidParameter;
- return NotImplemented; + if (iter->pathtype_pos >= iter->pathdata.Count) + { + *result = 0; + return Ok; + } + iter->pathtype_pos++; + *start = *end = iter->pathtype_pos; + *type = iter->pathdata.Types[iter->pathtype_pos] & PathPointTypePathMarker; + + if (iter->pathtype_pos < iter->pathdata.Count) { + for (i = iter->pathtype_pos + 1; i < iter->pathdata.Count; i++) { + if ((iter->pathdata.Types[i] & PathPointTypePathMarker) != *type) + break; + } + *end = i; + } + *result = *end - *start; + + return Ok; }
GpStatus WINGDIPAPI GdipPathIterNextSubpathPath(GpPathIterator* iter, INT* result, diff --git a/dlls/gdiplus/tests/pathiterator.c b/dlls/gdiplus/tests/pathiterator.c index 9bd3ac5452e..a064352d3c4 100644 --- a/dlls/gdiplus/tests/pathiterator.c +++ b/dlls/gdiplus/tests/pathiterator.c @@ -512,10 +512,10 @@ static void test_nextpathtype(void) /* empty path */ start = end = result = (INT)0xdeadbeef; stat = GdipPathIterNextPathType(iter, &result, &type, &start, &end); - todo_wine expect(Ok, stat); + expect(Ok, stat); expect((INT)0xdeadbeef, start); expect((INT)0xdeadbeef, end); - todo_wine expect(0, result); + expect(0, result); GdipDeletePathIter(iter);
/* single figure */ @@ -531,6 +531,20 @@ static void test_nextpathtype(void) todo_wine expect(0, result); GdipDeletePathIter(iter);
+ // Create PathPointTypeBezier type + stat = GdipAddPathBezier(path, 10.0, 10.0, 20.0, 10.0, 20.0, 20.0, 30.0, 20.0); + expect(Ok, stat); + GdipCreatePathIter(&iter, path); + start = end = result = (INT)0xdeadbeef; + type = 255; /* out of range */ + stat = GdipPathIterNextPathType(iter, &result, &type, &start, &end); + todo_wine expect(Ok, stat); + expect((INT)0xdeadbeef, start); + expect((INT)0xdeadbeef, end); + expect(255, type); + todo_wine expect(0, result); + GdipDeletePathIter(iter); + stat = GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0); expect(Ok, stat); GdipCreatePathIter(&iter, path);