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
94f6d069
Commit
94f6d069
authored
Jul 09, 2015
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jul 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: GdipConvertToEmfPlus parameter succ is optional.
parent
b71075ad
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
1 deletion
+81
-1
metafile.c
dlls/gdiplus/metafile.c
+2
-1
metafile.c
dlls/gdiplus/tests/metafile.c
+79
-0
No files found.
dlls/gdiplus/metafile.c
View file @
94f6d069
...
...
@@ -1127,9 +1127,10 @@ GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics* ref,
TRACE
(
"(%p,%p,%p,%u,%s,%p)
\n
"
,
ref
,
metafile
,
succ
,
emfType
,
debugstr_w
(
description
),
out_metafile
);
if
(
!
ref
||
!
metafile
||
!
out_metafile
)
if
(
!
ref
||
!
metafile
||
!
out_metafile
||
emfType
<
EmfTypeEmfOnly
||
emfType
>
EmfTypeEmfPlusDual
)
return
InvalidParameter
;
if
(
succ
)
*
succ
=
FALSE
;
*
out_metafile
=
NULL
;
...
...
dlls/gdiplus/tests/metafile.c
View file @
94f6d069
...
...
@@ -946,6 +946,84 @@ static void test_pagetransform(void)
expect
(
Ok
,
stat
);
}
static
void
test_converttoemfplus
(
void
)
{
GpStatus
(
WINAPI
*
pGdipConvertToEmfPlus
)(
const
GpGraphics
*
graphics
,
GpMetafile
*
metafile
,
BOOL
*
succ
,
EmfType
emfType
,
const
WCHAR
*
description
,
GpMetafile
**
outmetafile
);
static
const
GpRectF
frame
=
{
0
.
0
,
0
.
0
,
100
.
0
,
100
.
0
};
static
const
WCHAR
description
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
};
GpStatus
stat
;
GpMetafile
*
metafile
,
*
metafile2
=
NULL
,
*
emhmeta
;
GpGraphics
*
graphics
;
HDC
hdc
;
BOOL
succ
;
HMODULE
mod
=
GetModuleHandleA
(
"gdiplus.dll"
);
pGdipConvertToEmfPlus
=
(
void
*
)
GetProcAddress
(
mod
,
"GdipConvertToEmfPlus"
);
if
(
!
pGdipConvertToEmfPlus
)
{
/* GdipConvertToEmfPlus was introduced in Windows Vista. */
win_skip
(
"GDIPlus version 1.1 not available
\n
"
);
return
;
}
hdc
=
CreateCompatibleDC
(
0
);
stat
=
GdipRecordMetafile
(
hdc
,
MetafileTypeEmf
,
&
frame
,
MetafileFrameUnitPixel
,
description
,
&
metafile
);
expect
(
Ok
,
stat
);
stat
=
GdipRecordMetafile
(
hdc
,
EmfTypeEmfPlusOnly
,
&
frame
,
MetafileFrameUnitPixel
,
description
,
&
emhmeta
);
expect
(
Ok
,
stat
);
DeleteDC
(
hdc
);
if
(
stat
!=
Ok
)
return
;
stat
=
GdipGetImageGraphicsContext
((
GpImage
*
)
metafile
,
&
graphics
);
expect
(
Ok
,
stat
);
/* Invalid Parameters */
stat
=
pGdipConvertToEmfPlus
(
NULL
,
metafile
,
&
succ
,
EmfTypeEmfPlusOnly
,
description
,
&
metafile2
);
expect
(
InvalidParameter
,
stat
);
stat
=
pGdipConvertToEmfPlus
(
graphics
,
NULL
,
&
succ
,
EmfTypeEmfPlusOnly
,
description
,
&
metafile2
);
expect
(
InvalidParameter
,
stat
);
stat
=
pGdipConvertToEmfPlus
(
graphics
,
metafile
,
&
succ
,
EmfTypeEmfPlusOnly
,
description
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
pGdipConvertToEmfPlus
(
graphics
,
metafile
,
NULL
,
MetafileTypeInvalid
,
NULL
,
&
metafile2
);
expect
(
InvalidParameter
,
stat
);
stat
=
pGdipConvertToEmfPlus
(
graphics
,
metafile
,
NULL
,
MetafileTypeEmfPlusDual
+
1
,
NULL
,
&
metafile2
);
expect
(
InvalidParameter
,
stat
);
/* If we are already an Enhanced Metafile then the conversion fails. */
stat
=
pGdipConvertToEmfPlus
(
graphics
,
emhmeta
,
NULL
,
EmfTypeEmfPlusOnly
,
NULL
,
&
metafile2
);
todo_wine
expect
(
InvalidParameter
,
stat
);
stat
=
pGdipConvertToEmfPlus
(
graphics
,
metafile
,
NULL
,
EmfTypeEmfPlusOnly
,
NULL
,
&
metafile2
);
todo_wine
expect
(
Ok
,
stat
);
if
(
metafile2
)
GdipDisposeImage
((
GpImage
*
)
metafile2
);
succ
=
FALSE
;
stat
=
pGdipConvertToEmfPlus
(
graphics
,
metafile
,
&
succ
,
EmfTypeEmfPlusOnly
,
NULL
,
&
metafile2
);
todo_wine
expect
(
Ok
,
stat
);
if
(
metafile2
)
GdipDisposeImage
((
GpImage
*
)
metafile2
);
stat
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipDisposeImage
((
GpImage
*
)
metafile
);
expect
(
Ok
,
stat
);
stat
=
GdipDisposeImage
((
GpImage
*
)
emhmeta
);
expect
(
Ok
,
stat
);
}
START_TEST
(
metafile
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -970,6 +1048,7 @@ START_TEST(metafile)
test_emfonly
();
test_fillrect
();
test_pagetransform
();
test_converttoemfplus
();
GdiplusShutdown
(
gdiplusToken
);
}
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