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
7fdceb22
Commit
7fdceb22
authored
Feb 16, 2001
by
James Hatheway
Committed by
Alexandre Julliard
Feb 16, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update selection after sorting (in LISTVIEW_SortItems) by making sure
selection list matches states of individual items.
parent
4e92e653
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
listview.c
dlls/comctl32/listview.c
+18
-1
No files found.
dlls/comctl32/listview.c
View file @
7fdceb22
...
...
@@ -7382,8 +7382,11 @@ static INT WINAPI LISTVIEW_CallBackCompare(
static
LRESULT
LISTVIEW_SortItems
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LISTVIEW_INFO
*
infoPtr
=
(
LISTVIEW_INFO
*
)
GetWindowLongA
(
hwnd
,
0
);
int
nCount
;
int
nCount
,
i
;
UINT
lStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
HDPA
*
hdpaSubItems
=
NULL
;
LISTVIEW_ITEM
*
pLVItem
=
NULL
;
if
(
lStyle
&
LVS_OWNERDATA
)
return
FALSE
;
...
...
@@ -7401,6 +7404,20 @@ static LRESULT LISTVIEW_SortItems(HWND hwnd, WPARAM wParam, LPARAM lParam)
DPA_Sort
(
infoPtr
->
hdpaItems
,
LISTVIEW_CallBackCompare
,
hwnd
);
}
/* Adjust selections so that they are the way they should be after
the sort (otherwise, the list items move around, but whatever
is at the item's previous original position will be selected instead) */
for
(
i
=
0
;
i
<
nCount
;
i
++
)
{
hdpaSubItems
=
(
HDPA
)
DPA_GetPtr
(
infoPtr
->
hdpaItems
,
i
);
pLVItem
=
(
LISTVIEW_ITEM
*
)
DPA_GetPtr
(
hdpaSubItems
,
0
);
if
(
pLVItem
->
state
&
LVIS_SELECTED
)
LISTVIEW_AddSelectionRange
(
hwnd
,
i
,
i
);
else
LISTVIEW_RemoveSelectionRange
(
hwnd
,
i
,
i
);
}
/* align the items */
LISTVIEW_AlignTop
(
hwnd
);
...
...
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