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
6b2675dc
Commit
6b2675dc
authored
Jan 21, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Always return zero state mask for subitems.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ce5fb75f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
14 deletions
+40
-14
listview.c
dlls/comctl32/listview.c
+7
-4
listview.c
dlls/comctl32/tests/listview.c
+33
-10
No files found.
dlls/comctl32/listview.c
View file @
6b2675dc
...
...
@@ -6679,16 +6679,19 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem,
/* make a local copy */
isubitem
=
lpLVItem
->
iSubItem
;
if
(
isubitem
&&
(
lpLVItem
->
mask
&
LVIF_STATE
))
lpLVItem
->
state
=
0
;
/* a quick optimization if all we're asked is the focus state
* these queries are worth optimising since they are common,
* and can be answered in constant time, without the heavy accesses */
if
(
(
lpLVItem
->
mask
==
LVIF_STATE
)
&&
(
lpLVItem
->
stateMask
==
LVIS_FOCUSED
)
&&
!
(
infoPtr
->
uCallbackMask
&
LVIS_FOCUSED
)
)
{
lpLVItem
->
state
=
0
;
if
(
infoPtr
->
nFocusedItem
==
lpLVItem
->
iItem
)
lpLVItem
->
state
|=
LVIS_FOCUSED
;
return
TRUE
;
lpLVItem
->
state
=
0
;
if
(
infoPtr
->
nFocusedItem
==
lpLVItem
->
iItem
&&
isubitem
==
0
)
lpLVItem
->
state
|=
LVIS_FOCUSED
;
return
TRUE
;
}
ZeroMemory
(
&
dispInfo
,
sizeof
(
dispInfo
));
...
...
dlls/comctl32/tests/listview.c
View file @
6b2675dc
...
...
@@ -6152,16 +6152,17 @@ static void test_state_image(void)
insert_column
(
hwnd
,
0
);
insert_column
(
hwnd
,
1
);
item
.
mask
=
LVIF_TEXT
;
item
.
mask
=
LVIF_TEXT
|
LVIF_PARAM
;
item
.
iItem
=
0
;
item
.
iSubItem
=
0
;
item
.
pszText
=
text
;
item
.
lParam
=
123456
;
r
=
SendMessageA
(
hwnd
,
LVM_INSERTITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
0
,
"Failed to insert an item.
\n
"
);
item
.
mask
=
LVIF_STATE
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
1
)
|
LVIS_SELECTED
;
item
.
stateMask
=
LVIS_STATEIMAGEMASK
|
LVIS_SELECTED
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
1
)
|
LVIS_SELECTED
|
LVIS_FOCUSED
;
item
.
stateMask
=
LVIS_STATEIMAGEMASK
|
LVIS_SELECTED
|
LVIS_FOCUSED
;
item
.
iItem
=
0
;
item
.
iSubItem
=
0
;
r
=
SendMessageA
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
...
...
@@ -6174,27 +6175,49 @@ static void test_state_image(void)
r
=
SendMessageA
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
,
"Failed to set subitem text.
\n
"
);
item
.
mask
=
LVIF_STATE
;
item
.
stateMask
=
LVIS_STATEIMAGEMASK
|
LVIS_SELECTED
;
item
.
mask
=
LVIF_STATE
|
LVIF_PARAM
;
item
.
stateMask
=
~
0u
;
item
.
state
=
0
;
item
.
iItem
=
0
;
item
.
iSubItem
=
0
;
item
.
lParam
=
0
;
r
=
SendMessageA
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
,
"Failed to get item state.
\n
"
);
ok
(
item
.
state
==
(
INDEXTOSTATEIMAGEMASK
(
1
)
|
LVIS_SELECTED
),
"Unexpected item state %#x.
\n
"
,
item
.
state
);
ok
(
item
.
state
==
(
INDEXTOSTATEIMAGEMASK
(
1
)
|
LVIS_SELECTED
|
LVIS_FOCUSED
),
"Unexpected item state %#x.
\n
"
,
item
.
state
);
ok
(
item
.
lParam
==
123456
,
"Unexpected lParam %ld.
\n
"
,
item
.
lParam
);
item
.
mask
=
LVIF_STATE
;
item
.
stateMask
=
LVIS_STATEIMAGEMASK
|
LVIS_SELECTED
;
item
.
mask
=
0
;
item
.
stateMask
=
~
0u
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
2
);
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
r
=
SendMessageA
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
,
"Failed to get subitem state.
\n
"
);
todo_wine
ok
(
item
.
state
==
INDEXTOSTATEIMAGEMASK
(
2
),
"Unexpected state %#x.
\n
"
,
item
.
state
);
item
.
mask
=
LVIF_STATE
|
LVIF_PARAM
;
item
.
stateMask
=
~
0u
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
2
);
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
lParam
=
0
;
r
=
SendMessageA
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
,
"Failed to get subitem state.
\n
"
);
ok
(
item
.
state
==
0
,
"Unexpected state %#x.
\n
"
,
item
.
state
);
ok
(
item
.
lParam
==
123456
,
"Unexpected lParam %ld.
\n
"
,
item
.
lParam
);
item
.
mask
=
LVIF_STATE
;
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
0
;
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
r
=
SendMessageA
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
,
"Failed to get subitem state.
\n
"
);
ok
(
item
.
state
==
0
,
"Unexpected state %#x.
\n
"
,
item
.
state
);
item
.
mask
=
LVIF_STATE
;
item
.
stateMask
=
LVIS_STATEIMAGEMASK
|
LVIS_SELECTED
;
item
.
stateMask
=
~
0u
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
2
);
item
.
iItem
=
0
;
item
.
iSubItem
=
2
;
...
...
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