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
2dc56858
Commit
2dc56858
authored
Nov 02, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Placeable is optional in GdipCreateMetafileFromWmf.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c7bdc888
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
10 deletions
+32
-10
metafile.c
dlls/gdiplus/metafile.c
+15
-10
image.c
dlls/gdiplus/tests/image.c
+17
-0
No files found.
dlls/gdiplus/metafile.c
View file @
2dc56858
...
...
@@ -1076,7 +1076,7 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
TRACE
(
"(%p, %d, %p, %p)
\n
"
,
hwmf
,
delete
,
placeable
,
metafile
);
if
(
!
hwmf
||
!
metafile
||
!
placeable
)
if
(
!
hwmf
||
!
metafile
)
return
InvalidParameter
;
*
metafile
=
NULL
;
...
...
@@ -1094,15 +1094,20 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
if
(
retval
==
Ok
)
{
(
*
metafile
)
->
image
.
xres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
image
.
yres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
bounds
.
X
=
((
REAL
)
placeable
->
BoundingBox
.
Left
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Y
=
((
REAL
)
placeable
->
BoundingBox
.
Top
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Width
=
(
REAL
)(
placeable
->
BoundingBox
.
Right
-
placeable
->
BoundingBox
.
Left
);
(
*
metafile
)
->
bounds
.
Height
=
(
REAL
)(
placeable
->
BoundingBox
.
Bottom
-
placeable
->
BoundingBox
.
Top
);
(
*
metafile
)
->
metafile_type
=
MetafileTypeWmfPlaceable
;
if
(
placeable
)
{
(
*
metafile
)
->
image
.
xres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
image
.
yres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
bounds
.
X
=
((
REAL
)
placeable
->
BoundingBox
.
Left
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Y
=
((
REAL
)
placeable
->
BoundingBox
.
Top
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Width
=
(
REAL
)(
placeable
->
BoundingBox
.
Right
-
placeable
->
BoundingBox
.
Left
);
(
*
metafile
)
->
bounds
.
Height
=
(
REAL
)(
placeable
->
BoundingBox
.
Bottom
-
placeable
->
BoundingBox
.
Top
);
(
*
metafile
)
->
metafile_type
=
MetafileTypeWmfPlaceable
;
}
else
(
*
metafile
)
->
metafile_type
=
MetafileTypeWmf
;
(
*
metafile
)
->
image
.
format
=
ImageFormatWMF
;
if
(
delete
)
DeleteMetaFile
(
hwmf
);
...
...
dlls/gdiplus/tests/image.c
View file @
2dc56858
...
...
@@ -1544,6 +1544,22 @@ static void test_createfromwmf(void)
GdipDisposeImage
(
img
);
}
static
void
test_createfromwmf_noplaceable
(
void
)
{
HMETAFILE
hwmf
;
GpImage
*
img
;
GpStatus
stat
;
hwmf
=
SetMetaFileBitsEx
(
sizeof
(
wmfimage
)
-
sizeof
(
WmfPlaceableFileHeader
),
wmfimage
+
sizeof
(
WmfPlaceableFileHeader
));
ok
(
hwmf
!=
0
,
"SetMetaFileBitsEx failed
\n
"
);
stat
=
GdipCreateMetafileFromWmf
(
hwmf
,
TRUE
,
NULL
,
(
GpMetafile
**
)
&
img
);
expect
(
Ok
,
stat
);
GdipDisposeImage
(
img
);
}
static
void
test_resolution
(
void
)
{
GpStatus
stat
;
...
...
@@ -4758,6 +4774,7 @@ START_TEST(image)
test_getrawformat
();
test_loadwmf
();
test_createfromwmf
();
test_createfromwmf_noplaceable
();
test_resolution
();
test_createhbitmap
();
test_getthumbnail
();
...
...
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