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
f54aa407
Commit
f54aa407
authored
Oct 18, 2007
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Oct 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Single-line control must refuse to insert carriage returns (with tests).
parent
c54219fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
editor.c
dlls/riched20/editor.c
+3
-1
editor.c
dlls/riched20/tests/editor.c
+51
-0
No files found.
dlls/riched20/editor.c
View file @
f54aa407
...
...
@@ -2431,7 +2431,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
SendMessageW
(
editor
->
hWnd
,
EM_UNDO
,
0
,
0
);
return
0
;
}
if
(((
unsigned
)
wstr
)
>=
' '
||
wstr
==
'\r'
||
wstr
==
'\t'
)
{
if
(((
unsigned
)
wstr
)
>=
' '
||
(
wstr
==
'\r'
&&
(
GetWindowLongW
(
hWnd
,
GWL_STYLE
)
&
ES_MULTILINE
))
||
wstr
==
'\t'
)
{
/* FIXME maybe it would make sense to call EM_REPLACESEL instead ? */
/* WM_CHAR is restricted to nTextLimit */
int
from
,
to
;
...
...
dlls/riched20/tests/editor.c
View file @
f54aa407
...
...
@@ -2058,6 +2058,56 @@ static void test_unicode_conversions(void)
DestroyWindow
(
hwnd
);
}
static
void
test_WM_CHAR
(
void
)
{
HWND
hwnd
;
int
ret
;
const
char
*
char_list
=
"abc
\r
abc
\r
"
;
const
char
*
expected_content_single
=
"abcabc"
;
const
char
*
expected_content_multi
=
"abc
\r\n
abc
\r\n
"
;
char
buffer
[
64
]
=
{
0
};
const
char
*
p
;
/* single-line control must IGNORE carriage returns */
hwnd
=
CreateWindowExA
(
0
,
"RichEdit20W"
,
NULL
,
WS_POPUP
,
0
,
0
,
200
,
60
,
0
,
0
,
0
,
0
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %u
\n
"
,
GetLastError
());
p
=
char_list
;
while
(
*
p
!=
'\0'
)
{
SendMessageA
(
hwnd
,
WM_KEYDOWN
,
*
p
,
1
);
ret
=
SendMessageA
(
hwnd
,
WM_CHAR
,
*
p
,
1
);
ok
(
ret
==
0
,
"WM_CHAR('%c') ret=%d
\n
"
,
*
p
,
ret
);
SendMessageA
(
hwnd
,
WM_KEYUP
,
*
p
,
1
);
p
++
;
}
SendMessage
(
hwnd
,
WM_GETTEXT
,
sizeof
(
buffer
),
(
LPARAM
)
buffer
);
ret
=
strcmp
(
buffer
,
expected_content_single
);
ok
(
ret
==
0
,
"WM_GETTEXT recovered incorrect string!
\n
"
);
DestroyWindow
(
hwnd
);
/* multi-line control inserts CR normally */
hwnd
=
CreateWindowExA
(
0
,
"RichEdit20W"
,
NULL
,
WS_POPUP
|
ES_MULTILINE
,
0
,
0
,
200
,
60
,
0
,
0
,
0
,
0
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %u
\n
"
,
GetLastError
());
p
=
char_list
;
while
(
*
p
!=
'\0'
)
{
SendMessageA
(
hwnd
,
WM_KEYDOWN
,
*
p
,
1
);
ret
=
SendMessageA
(
hwnd
,
WM_CHAR
,
*
p
,
1
);
ok
(
ret
==
0
,
"WM_CHAR('%c') ret=%d
\n
"
,
*
p
,
ret
);
SendMessageA
(
hwnd
,
WM_KEYUP
,
*
p
,
1
);
p
++
;
}
SendMessage
(
hwnd
,
WM_GETTEXT
,
sizeof
(
buffer
),
(
LPARAM
)
buffer
);
ret
=
strcmp
(
buffer
,
expected_content_multi
);
ok
(
ret
==
0
,
"WM_GETTEXT recovered incorrect string!
\n
"
);
DestroyWindow
(
hwnd
);
}
static
void
test_EM_GETTEXTLENGTHEX
(
void
)
{
...
...
@@ -2205,6 +2255,7 @@ START_TEST( editor )
hmoduleRichEdit
=
LoadLibrary
(
"RICHED20.DLL"
);
ok
(
hmoduleRichEdit
!=
NULL
,
"error: %d
\n
"
,
(
int
)
GetLastError
());
test_WM_CHAR
();
test_EM_FINDTEXT
();
test_EM_GETLINE
();
test_EM_SCROLLCARET
();
...
...
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