Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
dcfbe58e
Commit
dcfbe58e
authored
Jul 13, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix GdipCreatePathIter to handle NULL as path. Fix tests.
parent
6ef6f716
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
pathiterator.c
dlls/gdiplus/pathiterator.c
+21
-11
pathiterator.c
dlls/gdiplus/tests/pathiterator.c
+1
-1
No files found.
dlls/gdiplus/pathiterator.c
View file @
dcfbe58e
...
...
@@ -31,24 +31,30 @@ GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath* path)
{
INT
size
;
if
(
!
iterator
||
!
path
)
if
(
!
iterator
)
return
InvalidParameter
;
size
=
path
->
pathdata
.
Count
;
*
iterator
=
GdipAlloc
(
sizeof
(
GpPathIterator
));
if
(
!*
iterator
)
return
OutOfMemory
;
(
*
iterator
)
->
pathdata
.
Types
=
GdipAlloc
(
size
);
(
*
iterator
)
->
pathdata
.
Points
=
GdipAlloc
(
size
*
sizeof
(
PointF
))
;
if
(
path
){
size
=
path
->
pathdata
.
Count
;
memcpy
((
*
iterator
)
->
pathdata
.
Types
,
path
->
pathdata
.
Types
,
size
);
memcpy
((
*
iterator
)
->
pathdata
.
Points
,
path
->
pathdata
.
Points
,
size
*
sizeof
(
PointF
));
(
*
iterator
)
->
pathdata
.
Count
=
size
;
(
*
iterator
)
->
pathdata
.
Types
=
GdipAlloc
(
size
);
(
*
iterator
)
->
pathdata
.
Points
=
GdipAlloc
(
size
*
sizeof
(
PointF
));
(
*
iterator
)
->
subpath_pos
=
0
;
(
*
iterator
)
->
marker_pos
=
0
;
memcpy
((
*
iterator
)
->
pathdata
.
Types
,
path
->
pathdata
.
Types
,
size
);
memcpy
((
*
iterator
)
->
pathdata
.
Points
,
path
->
pathdata
.
Points
,
size
*
sizeof
(
PointF
));
(
*
iterator
)
->
pathdata
.
Count
=
size
;
}
else
{
(
*
iterator
)
->
pathdata
.
Types
=
NULL
;
(
*
iterator
)
->
pathdata
.
Points
=
NULL
;
(
*
iterator
)
->
pathdata
.
Count
=
0
;
}
(
*
iterator
)
->
subpath_pos
=
0
;
(
*
iterator
)
->
marker_pos
=
0
;
(
*
iterator
)
->
pathtype_pos
=
0
;
return
Ok
;
...
...
@@ -156,6 +162,10 @@ GpStatus WINGDIPAPI GdipPathIterNextSubpath(GpPathIterator* iterator,
count
=
iterator
->
pathdata
.
Count
;
/* iterator created with NULL path */
if
(
count
==
0
)
return
Ok
;
if
(
iterator
->
subpath_pos
==
count
){
*
startIndex
=
*
endIndex
=
*
resultCount
=
0
;
*
isClosed
=
1
;
...
...
dlls/gdiplus/tests/pathiterator.c
View file @
dcfbe58e
...
...
@@ -37,7 +37,7 @@ static void test_constructor_destructor(void)
stat
=
GdipCreatePathIter
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreatePathIter
(
&
iter
,
NULL
);
expect
(
InvalidParameter
,
stat
);
expect
(
Ok
,
stat
);
stat
=
GdipCreatePathIter
(
NULL
,
path
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipDeletePathIter
(
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment