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
5a1f8c57
Commit
5a1f8c57
authored
Mar 03, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Mar 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix case where EM_SCROLL with page down results in trying to scroll up past the beginning.
parent
598052b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
edit.c
dlls/user32/edit.c
+1
-1
edit.c
dlls/user32/tests/edit.c
+17
-0
No files found.
dlls/user32/edit.c
View file @
5a1f8c57
...
...
@@ -1632,7 +1632,7 @@ static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action)
INT
vlc
=
get_vertical_line_count
(
es
);
/* check if we are going to move too far */
if
(
es
->
y_offset
+
dy
>
es
->
line_count
-
vlc
)
dy
=
es
->
line_count
-
vlc
-
es
->
y_offset
;
dy
=
max
(
es
->
line_count
-
vlc
,
0
)
-
es
->
y_offset
;
/* Notification is done in EDIT_EM_LineScroll */
if
(
dy
)
{
...
...
dlls/user32/tests/edit.c
View file @
5a1f8c57
...
...
@@ -1320,6 +1320,7 @@ static void test_edit_control_limittext(void)
static
void
test_edit_control_scroll
(
void
)
{
static
const
char
*
single_line_str
=
"a"
;
static
const
char
*
multiline_str
=
"Test
\r\n
Text"
;
HWND
hwEdit
;
LONG
ret
;
...
...
@@ -1348,6 +1349,22 @@ static void test_edit_control_scroll(void)
ok
(
!
ret
,
"Returned %x, expected 0.
\n
"
,
ret
);
DestroyWindow
(
hwEdit
);
/* SB_PAGEDOWN while at the beginning of a buffer with few lines
should not cause EM_SCROLL to return a negative value of
scrolled lines that would put us "before" the beginning. */
hwEdit
=
CreateWindow
(
"EDIT"
,
multiline_str
,
WS_VSCROLL
|
ES_MULTILINE
,
0
,
0
,
100
,
100
,
NULL
,
NULL
,
hinst
,
NULL
);
assert
(
hwEdit
);
ret
=
SendMessage
(
hwEdit
,
EM_SCROLL
,
SB_PAGEDOWN
,
0
);
ok
(
!
ret
,
"Returned %x, expected 0.
\n
"
,
ret
);
DestroyWindow
(
hwEdit
);
}
static
void
test_margins
(
void
)
...
...
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