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
22bc001c
Commit
22bc001c
authored
Aug 09, 2006
by
Matt Finnicum
Committed by
Alexandre Julliard
Aug 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add conformance tests for WM_SETFONT.
parent
13e4ddd2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
editor.c
dlls/riched20/editor.c
+1
-1
editor.c
dlls/riched20/tests/editor.c
+62
-0
No files found.
dlls/riched20/editor.c
View file @
22bc001c
...
@@ -1875,7 +1875,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
...
@@ -1875,7 +1875,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
BOOL
bRepaint
=
LOWORD
(
lParam
);
BOOL
bRepaint
=
LOWORD
(
lParam
);
if
(
!
wParam
)
if
(
!
wParam
)
wParam
=
(
WPARAM
)
GetStockObject
(
DEFAULT_GUI
_FONT
);
wParam
=
(
WPARAM
)
GetStockObject
(
SYSTEM
_FONT
);
GetObjectW
((
HGDIOBJ
)
wParam
,
sizeof
(
LOGFONTW
),
&
lf
);
GetObjectW
((
HGDIOBJ
)
wParam
,
sizeof
(
LOGFONTW
),
&
lf
);
hDC
=
GetDC
(
hWnd
);
hDC
=
GetDC
(
hWnd
);
ME_CharFormatFromLogFont
(
hDC
,
&
lf
,
&
fmt
);
ME_CharFormatFromLogFont
(
hDC
,
&
lf
,
&
fmt
);
...
...
dlls/riched20/tests/editor.c
View file @
22bc001c
...
@@ -1062,6 +1062,67 @@ static void test_EM_GETLIMITTEXT(void)
...
@@ -1062,6 +1062,67 @@ static void test_EM_GETLIMITTEXT(void)
DestroyWindow
(
hwndRichEdit
);
DestroyWindow
(
hwndRichEdit
);
}
}
static
void
test_WM_SETFONT
()
{
/* There is no invalid input or error conditions for this function.
* NULL wParam and lParam just fall back to their default values
* It should be noted that even if you use a gibberish name for your fonts
* here, it will still work because the name is stored. They will display as
* System, but will report their name to be whatever they were created as */
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
HFONT
testFont1
=
CreateFontA
(
0
,
0
,
0
,
0
,
FW_LIGHT
,
0
,
0
,
0
,
ANSI_CHARSET
,
OUT_DEFAULT_PRECIS
,
CLIP_DEFAULT_PRECIS
,
DEFAULT_QUALITY
,
DEFAULT_PITCH
|
FF_DONTCARE
,
"Marlett"
);
HFONT
testFont2
=
CreateFontA
(
0
,
0
,
0
,
0
,
FW_LIGHT
,
0
,
0
,
0
,
ANSI_CHARSET
,
OUT_TT_PRECIS
,
CLIP_DEFAULT_PRECIS
,
DEFAULT_QUALITY
,
DEFAULT_PITCH
|
FF_DONTCARE
,
"MS Sans Serif"
);
HFONT
testFont3
=
CreateFontA
(
0
,
0
,
0
,
0
,
FW_LIGHT
,
0
,
0
,
0
,
ANSI_CHARSET
,
OUT_DEFAULT_PRECIS
,
CLIP_DEFAULT_PRECIS
,
DEFAULT_QUALITY
,
DEFAULT_PITCH
|
FF_DONTCARE
,
"Courier"
);
LOGFONTA
sentLogFont
;
CHARFORMAT2A
returnedCF2A
;
returnedCF2A
.
cbSize
=
sizeof
(
returnedCF2A
);
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"x"
);
SendMessage
(
hwndRichEdit
,
WM_SETFONT
,
(
WPARAM
)
testFont1
,(
LPARAM
)
MAKELONG
((
WORD
)
TRUE
,
0
));
SendMessage
(
hwndRichEdit
,
EM_GETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
returnedCF2A
);
GetObjectA
(
testFont1
,
sizeof
(
LOGFONTA
),
&
sentLogFont
);
ok
(
!
strcmp
(
sentLogFont
.
lfFaceName
,
returnedCF2A
.
szFaceName
),
"EM_GETCHARFOMAT: Returned wrong font on test 1. Sent: %s, Returned: %s
\n
"
,
sentLogFont
.
lfFaceName
,
returnedCF2A
.
szFaceName
);
SendMessage
(
hwndRichEdit
,
WM_SETFONT
,
(
WPARAM
)
testFont2
,(
LPARAM
)
MAKELONG
((
WORD
)
TRUE
,
0
));
SendMessage
(
hwndRichEdit
,
EM_GETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
returnedCF2A
);
GetObjectA
(
testFont2
,
sizeof
(
LOGFONTA
),
&
sentLogFont
);
ok
(
!
strcmp
(
sentLogFont
.
lfFaceName
,
returnedCF2A
.
szFaceName
),
"EM_GETCHARFOMAT: Returned wrong font on test 2. Sent: %s, Returned: %s
\n
"
,
sentLogFont
.
lfFaceName
,
returnedCF2A
.
szFaceName
);
SendMessage
(
hwndRichEdit
,
WM_SETFONT
,
(
WPARAM
)
testFont3
,(
LPARAM
)
MAKELONG
((
WORD
)
TRUE
,
0
));
SendMessage
(
hwndRichEdit
,
EM_GETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
returnedCF2A
);
GetObjectA
(
testFont3
,
sizeof
(
LOGFONTA
),
&
sentLogFont
);
ok
(
!
strcmp
(
sentLogFont
.
lfFaceName
,
returnedCF2A
.
szFaceName
),
"EM_GETCHARFOMAT: Returned wrong font on test 3. Sent: %s, Returned: %s
\n
"
,
sentLogFont
.
lfFaceName
,
returnedCF2A
.
szFaceName
);
/* This last test is special since we send in NULL. We clear the variables
* and just compare to "System" instead of the sent in font name. */
ZeroMemory
(
&
returnedCF2A
,
sizeof
(
returnedCF2A
));
ZeroMemory
(
&
sentLogFont
,
sizeof
(
sentLogFont
));
returnedCF2A
.
cbSize
=
sizeof
(
returnedCF2A
);
SendMessage
(
hwndRichEdit
,
WM_SETFONT
,
(
WPARAM
)
NULL
,(
LPARAM
)
MAKELONG
((
WORD
)
TRUE
,
0
));
SendMessage
(
hwndRichEdit
,
EM_GETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
returnedCF2A
);
GetObjectA
(
NULL
,
sizeof
(
LOGFONTA
),
&
sentLogFont
);
ok
(
!
strcmp
(
"System"
,
returnedCF2A
.
szFaceName
),
"EM_GETCHARFOMAT: Returned wrong font on test 4. Sent: NULL, Returned: %s. Expected
\"
System
\"
.
\n
"
,
returnedCF2A
.
szFaceName
);
DestroyWindow
(
hwndRichEdit
);
}
START_TEST
(
editor
)
START_TEST
(
editor
)
{
{
MSG
msg
;
MSG
msg
;
...
@@ -1085,6 +1146,7 @@ START_TEST( editor )
...
@@ -1085,6 +1146,7 @@ START_TEST( editor )
test_EM_SETTEXTEX
();
test_EM_SETTEXTEX
();
test_EM_EXLIMITTEXT
();
test_EM_EXLIMITTEXT
();
test_EM_GETLIMITTEXT
();
test_EM_GETLIMITTEXT
();
test_WM_SETFONT
();
/* Set the environment variable WINETEST_RICHED20 to keep windows
/* Set the environment variable WINETEST_RICHED20 to keep windows
* responsive and open for 30 seconds. This is useful for debugging.
* responsive and open for 30 seconds. This is useful for debugging.
...
...
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