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
5faab43d
Commit
5faab43d
authored
Aug 01, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Filter invalid indices when setting selection mark.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
28bb9d15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
listview.c
dlls/comctl32/listview.c
+2
-1
listview.c
dlls/comctl32/tests/listview.c
+23
-1
No files found.
dlls/comctl32/listview.c
View file @
5faab43d
...
...
@@ -9053,7 +9053,8 @@ static INT LISTVIEW_SetSelectionMark(LISTVIEW_INFO *infoPtr, INT nIndex)
TRACE
(
"(nIndex=%d)
\n
"
,
nIndex
);
infoPtr
->
nSelectionMark
=
nIndex
;
if
(
nIndex
>=
-
1
&&
nIndex
<
infoPtr
->
nItemCount
)
infoPtr
->
nSelectionMark
=
nIndex
;
return
nOldIndex
;
}
...
...
dlls/comctl32/tests/listview.c
View file @
5faab43d
...
...
@@ -2257,7 +2257,29 @@ static void test_multiselect(void)
item_count
=
SendMessageA
(
hwnd
,
LVM_GETITEMCOUNT
,
0
,
0
);
expect
(
items
,
item_count
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
r
=
SendMessageA
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
1
);
ok
(
r
==
-
1
,
"got %d
\n
"
,
r
);
r
=
SendMessageA
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
0
);
ok
(
r
==
-
1
,
"got %d
\n
"
,
r
);
r
=
SendMessageA
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
0
);
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
/* out of range index */
r
=
SendMessageA
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
items
);
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
r
=
SendMessageA
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
r
=
SendMessageA
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
2
);
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
r
=
SendMessageA
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
for
(
i
=
0
;
i
<
sizeof
(
task_list
)
/
sizeof
(
task_list
[
0
]);
i
++
)
{
DWORD
selected_count
;
LVITEMA
item
;
...
...
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