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
0588ba7f
Commit
0588ba7f
authored
Apr 20, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Fix a regression caused by
9c1a0e46
.
parent
42bef95c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
listview.c
dlls/comctl32/listview.c
+1
-5
listview.c
dlls/comctl32/tests/listview.c
+18
-0
No files found.
dlls/comctl32/listview.c
View file @
0588ba7f
...
...
@@ -3565,7 +3565,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
if
(
uChanged
&
LVIF_STATE
)
{
if
(
lpItem
&&
(
stateMask
&
~
infoPtr
->
uCallbackMask
&
~
(
LVIS_FOCUSED
|
LVIS_SELECTED
)
))
if
(
lpItem
&&
(
stateMask
&
~
infoPtr
->
uCallbackMask
))
{
lpItem
->
state
&=
~
stateMask
;
lpItem
->
state
|=
(
lpLVItem
->
state
&
stateMask
);
...
...
@@ -3574,12 +3574,10 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
{
if
(
infoPtr
->
dwStyle
&
LVS_SINGLESEL
)
LISTVIEW_DeselectAllSkipItem
(
infoPtr
,
lpLVItem
->
iItem
);
ranges_additem
(
infoPtr
->
selectionRanges
,
lpLVItem
->
iItem
);
lpItem
->
state
|=
LVIS_SELECTED
;
}
else
if
(
stateMask
&
LVIS_SELECTED
)
{
ranges_delitem
(
infoPtr
->
selectionRanges
,
lpLVItem
->
iItem
);
lpItem
->
state
&=
~
LVIS_SELECTED
;
}
/* if we are asked to change focus, and we manage it, do it */
if
(
stateMask
&
~
infoPtr
->
uCallbackMask
&
LVIS_FOCUSED
)
...
...
@@ -3597,13 +3595,11 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
LISTVIEW_SetItemState
(
infoPtr
,
infoPtr
->
nFocusedItem
,
&
item
);
}
lpItem
->
state
|=
LVIS_FOCUSED
;
infoPtr
->
nFocusedItem
=
lpLVItem
->
iItem
;
LISTVIEW_EnsureVisible
(
infoPtr
,
lpLVItem
->
iItem
,
uView
==
LVS_LIST
);
}
else
if
(
infoPtr
->
nFocusedItem
==
lpLVItem
->
iItem
)
{
lpItem
->
state
&=
~
LVIS_FOCUSED
;
infoPtr
->
nFocusedItem
=
-
1
;
}
}
...
...
dlls/comctl32/tests/listview.c
View file @
0588ba7f
...
...
@@ -1532,6 +1532,8 @@ static void test_ownerdata(void)
{
HWND
hwnd
;
LONG_PTR
style
,
ret
;
DWORD
res
;
LVITEMA
item
;
/* it isn't possible to set LVS_OWNERDATA after creation */
hwnd
=
create_listview_control
(
0
);
...
...
@@ -1579,6 +1581,22 @@ static void test_ownerdata(void)
style
=
GetWindowLongPtrA
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
LVS_OWNERDATA
,
"LVS_OWNERDATA is expected
\n
"
);
DestroyWindow
(
hwnd
);
/* try select an item */
hwnd
=
create_listview_control
(
LVS_OWNERDATA
);
ok
(
hwnd
!=
NULL
,
"failed to create a listview window
\n
"
);
res
=
SendMessageA
(
hwnd
,
LVM_SETITEMCOUNT
,
1
,
0
);
ok
(
res
!=
0
,
"Expected LVM_SETITEMCOUNT to succeed
\n
"
);
res
=
SendMessageA
(
hwnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
expect
(
0
,
res
);
memset
(
&
item
,
0
,
sizeof
(
item
));
item
.
stateMask
=
LVIS_SELECTED
;
item
.
state
=
LVIS_SELECTED
;
res
=
SendMessageA
(
hwnd
,
LVM_SETITEMSTATE
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
res
);
res
=
SendMessageA
(
hwnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
expect
(
1
,
res
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
listview
)
...
...
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