Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
991e785f
Commit
991e785f
authored
Jun 25, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix GdipGetPathData implementation and test.
Previous version (commit
3bacdaf6
) was totally incorrect. Thanks to Paul Vriens for pointing this out.
parent
c42d9374
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
graphicspath.c
dlls/gdiplus/graphicspath.c
+2
-11
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+9
-1
No files found.
dlls/gdiplus/graphicspath.c
View file @
991e785f
...
@@ -484,17 +484,8 @@ GpStatus WINGDIPAPI GdipGetPathData(GpPath *path, GpPathData* pathData)
...
@@ -484,17 +484,8 @@ GpStatus WINGDIPAPI GdipGetPathData(GpPath *path, GpPathData* pathData)
if
(
!
path
||
!
pathData
)
if
(
!
path
||
!
pathData
)
return
InvalidParameter
;
return
InvalidParameter
;
pathData
->
Count
=
path
->
pathdata
.
Count
;
/* Only copy data. pathData allocation/freeing controlled by wrapper class.
Assumed that pathData is enough wide to get all data - controlled by wrapper too. */
pathData
->
Points
=
GdipAlloc
(
sizeof
(
PointF
)
*
pathData
->
Count
);
if
(
!
pathData
->
Points
)
return
OutOfMemory
;
pathData
->
Types
=
GdipAlloc
(
pathData
->
Count
);
if
(
!
pathData
->
Points
)
return
OutOfMemory
;
/* copy data */
memcpy
(
pathData
->
Points
,
path
->
pathdata
.
Points
,
sizeof
(
PointF
)
*
pathData
->
Count
);
memcpy
(
pathData
->
Points
,
path
->
pathdata
.
Points
,
sizeof
(
PointF
)
*
pathData
->
Count
);
memcpy
(
pathData
->
Types
,
path
->
pathdata
.
Types
,
pathData
->
Count
);
memcpy
(
pathData
->
Types
,
path
->
pathdata
.
Types
,
pathData
->
Count
);
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
991e785f
...
@@ -154,14 +154,22 @@ static void test_getpathdata(void)
...
@@ -154,14 +154,22 @@ static void test_getpathdata(void)
GpPath
*
path
;
GpPath
*
path
;
GpPathData
data
;
GpPathData
data
;
GpStatus
status
;
GpStatus
status
;
INT
count
;
GdipCreatePath
(
FillModeAlternate
,
&
path
);
GdipCreatePath
(
FillModeAlternate
,
&
path
);
status
=
GdipAddPathLine
(
path
,
5
.
0
,
5
.
0
,
100
.
0
,
50
.
0
);
status
=
GdipAddPathLine
(
path
,
5
.
0
,
5
.
0
,
100
.
0
,
50
.
0
);
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
/* Prepare storage. Made by wrapper class. */
status
=
GdipGetPointCount
(
path
,
&
count
);
expect
(
Ok
,
status
);
data
.
Count
=
2
;
data
.
Types
=
GdipAlloc
(
sizeof
(
BYTE
)
*
count
);
data
.
Points
=
GdipAlloc
(
sizeof
(
PointF
)
*
count
);
status
=
GdipGetPathData
(
path
,
&
data
);
status
=
GdipGetPathData
(
path
,
&
data
);
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
expect
((
data
.
Count
==
2
),
TRUE
);
expect
((
data
.
Points
[
0
].
X
==
5
.
0
)
&&
(
data
.
Points
[
0
].
Y
==
5
.
0
)
&&
expect
((
data
.
Points
[
0
].
X
==
5
.
0
)
&&
(
data
.
Points
[
0
].
Y
==
5
.
0
)
&&
(
data
.
Points
[
1
].
X
==
100
.
0
)
&&
(
data
.
Points
[
1
].
Y
==
50
.
0
),
TRUE
);
(
data
.
Points
[
1
].
X
==
100
.
0
)
&&
(
data
.
Points
[
1
].
Y
==
50
.
0
),
TRUE
);
expect
((
data
.
Types
[
0
]
==
PathPointTypeStart
)
&&
(
data
.
Types
[
1
]
==
PathPointTypeLine
),
TRUE
);
expect
((
data
.
Types
[
0
]
==
PathPointTypeStart
)
&&
(
data
.
Types
[
1
]
==
PathPointTypeLine
),
TRUE
);
...
...
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