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
fd99c33e
Commit
fd99c33e
authored
Oct 12, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Oct 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize a bunch of dc values to their default before enumerating an
enhmetafile. Add tests for these and for some values that don't get reset.
parent
793f9a51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
enhmetafile.c
dlls/gdi/enhmetafile.c
+11
-1
metafile.c
dlls/gdi/tests/metafile.c
+32
-0
No files found.
dlls/gdi/enhmetafile.c
View file @
fd99c33e
...
...
@@ -2147,7 +2147,7 @@ BOOL WINAPI EnumEnhMetaFile(
enum_emh_data
*
info
;
SIZE
vp_size
,
win_size
;
POINT
vp_org
,
win_org
;
INT
mapMode
=
MM_TEXT
;
INT
mapMode
=
MM_TEXT
,
old_align
=
0
,
old_rop2
=
0
,
old_arcdir
=
0
,
old_polyfill
=
0
,
old_stretchblt
=
0
;
COLORREF
old_text_color
=
0
,
old_bk_color
=
0
;
if
(
!
lpRect
&&
hdc
)
...
...
@@ -2201,6 +2201,11 @@ BOOL WINAPI EnumEnhMetaFile(
old_text_color
=
SetTextColor
(
hdc
,
RGB
(
0
,
0
,
0
));
old_bk_color
=
SetBkColor
(
hdc
,
RGB
(
0xff
,
0xff
,
0xff
));
old_align
=
SetTextAlign
(
hdc
,
0
);
old_rop2
=
SetROP2
(
hdc
,
R2_COPYPEN
);
old_arcdir
=
SetArcDirection
(
hdc
,
AD_COUNTERCLOCKWISE
);
old_polyfill
=
SetPolyFillMode
(
hdc
,
ALTERNATE
);
old_stretchblt
=
SetStretchBltMode
(
hdc
,
BLACKONWHITE
);
}
info
->
mode
=
MM_TEXT
;
...
...
@@ -2280,6 +2285,11 @@ BOOL WINAPI EnumEnhMetaFile(
if
(
hdc
)
{
SetStretchBltMode
(
hdc
,
old_stretchblt
);
SetPolyFillMode
(
hdc
,
old_polyfill
);
SetArcDirection
(
hdc
,
old_arcdir
);
SetROP2
(
hdc
,
old_rop2
);
SetTextAlign
(
hdc
,
old_align
);
SetBkColor
(
hdc
,
old_bk_color
);
SetTextColor
(
hdc
,
old_text_color
);
...
...
dlls/gdi/tests/metafile.c
View file @
fd99c33e
...
...
@@ -55,6 +55,18 @@ static int CALLBACK emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
switch
(
emr
->
iType
)
{
case
EMR_HEADER
:
ok
(
GetTextAlign
(
hdc
)
==
0
,
"text align %08x
\n
"
,
GetTextAlign
(
hdc
));
ok
(
GetBkColor
(
hdc
)
==
RGB
(
0xff
,
0xff
,
0xff
),
"bk color %08lx
\n
"
,
GetBkColor
(
hdc
));
ok
(
GetTextColor
(
hdc
)
==
RGB
(
0x0
,
0x0
,
0x0
),
"text color %08lx
\n
"
,
GetTextColor
(
hdc
));
ok
(
GetROP2
(
hdc
)
==
R2_COPYPEN
,
"rop %d
\n
"
,
GetROP2
(
hdc
));
ok
(
GetArcDirection
(
hdc
)
==
AD_COUNTERCLOCKWISE
,
"arc dir %d
\n
"
,
GetArcDirection
(
hdc
));
ok
(
GetPolyFillMode
(
hdc
)
==
ALTERNATE
,
"poly fill %d
\n
"
,
GetPolyFillMode
(
hdc
));
ok
(
GetStretchBltMode
(
hdc
)
==
BLACKONWHITE
,
"stretchblt mode %d
\n
"
,
GetStretchBltMode
(
hdc
));
/* GetBkMode, GetRelAbs do not get reset to the default value */
ok
(
GetBkMode
(
hdc
)
==
OPAQUE
,
"bk mode %d
\n
"
,
GetBkMode
(
hdc
));
ok
(
GetRelAbs
(
hdc
,
0
)
==
RELATIVE
,
"relabs %d
\n
"
,
GetRelAbs
(
hdc
,
0
));
n_record
=
0
;
break
;
...
...
@@ -189,9 +201,29 @@ static void test_ExtTextOut(void)
ret
=
PlayEnhMetaFile
(
hdcDisplay
,
hMetafile
,
&
rc
);
ok
(
ret
,
"PlayEnhMetaFile error %ld
\n
"
,
GetLastError
());
SetTextAlign
(
hdcDisplay
,
TA_UPDATECP
|
TA_CENTER
|
TA_BASELINE
|
TA_RTLREADING
);
SetBkColor
(
hdcDisplay
,
RGB
(
0xff
,
0
,
0
));
SetTextColor
(
hdcDisplay
,
RGB
(
0
,
0xff
,
0
));
SetROP2
(
hdcDisplay
,
R2_NOT
);
SetArcDirection
(
hdcDisplay
,
AD_CLOCKWISE
);
SetPolyFillMode
(
hdcDisplay
,
WINDING
);
SetStretchBltMode
(
hdcDisplay
,
HALFTONE
);
SetRelAbs
(
hdcDisplay
,
RELATIVE
);
SetBkMode
(
hdcDisplay
,
OPAQUE
);
ret
=
EnumEnhMetaFile
(
hdcDisplay
,
hMetafile
,
emf_enum_proc
,
dx
,
&
rc
);
ok
(
ret
,
"EnumEnhMetaFile error %ld
\n
"
,
GetLastError
());
ok
(
GetTextAlign
(
hdcDisplay
)
==
(
TA_UPDATECP
|
TA_CENTER
|
TA_BASELINE
|
TA_RTLREADING
),
"text align %08x
\n
"
,
GetTextAlign
(
hdcDisplay
));
ok
(
GetBkColor
(
hdcDisplay
)
==
RGB
(
0xff
,
0
,
0
),
"bk color %08lx
\n
"
,
GetBkColor
(
hdcDisplay
));
ok
(
GetTextColor
(
hdcDisplay
)
==
RGB
(
0
,
0xff
,
0
),
"text color %08lx
\n
"
,
GetTextColor
(
hdcDisplay
));
ok
(
GetROP2
(
hdcDisplay
)
==
R2_NOT
,
"rop2 %d
\n
"
,
GetROP2
(
hdcDisplay
));
ok
(
GetArcDirection
(
hdcDisplay
)
==
AD_CLOCKWISE
,
"arc dir %d
\n
"
,
GetArcDirection
(
hdcDisplay
));
ok
(
GetPolyFillMode
(
hdcDisplay
)
==
WINDING
,
"poly fill %d
\n
"
,
GetPolyFillMode
(
hdcDisplay
));
ok
(
GetStretchBltMode
(
hdcDisplay
)
==
HALFTONE
,
"stretchblt mode %d
\n
"
,
GetStretchBltMode
(
hdcDisplay
));
ok
(
emr_processed
,
"EnumEnhMetaFile couldn't find EMR_EXTTEXTOUTA or EMR_EXTTEXTOUTW record
\n
"
);
ok
(
!
EnumEnhMetaFile
(
hdcDisplay
,
hMetafile
,
emf_enum_proc
,
dx
,
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