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
740e7be1
Commit
740e7be1
authored
May 06, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Don't refuse to set subitem data when some extra flag is specified.
parent
7f640316
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
4 deletions
+54
-4
listview.c
dlls/comctl32/listview.c
+2
-2
listview.c
dlls/comctl32/tests/listview.c
+52
-2
No files found.
dlls/comctl32/listview.c
View file @
740e7be1
...
@@ -4272,9 +4272,9 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
...
@@ -4272,9 +4272,9 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
particularly useful. We currently do not actually do anything with
particularly useful. We currently do not actually do anything with
the flag on subitems.
the flag on subitems.
*/
*/
if
(
lpLVItem
->
mask
&
~
(
LVIF_TEXT
|
LVIF_IMAGE
|
LVIF_STATE
))
return
FALSE
;
if
(
lpLVItem
->
mask
&
~
(
LVIF_TEXT
|
LVIF_IMAGE
|
LVIF_STATE
|
LVIF_DI_SETITEM
))
return
FALSE
;
if
(
!
(
lpLVItem
->
mask
&
(
LVIF_TEXT
|
LVIF_IMAGE
|
LVIF_STATE
)))
return
TRUE
;
if
(
!
(
lpLVItem
->
mask
&
(
LVIF_TEXT
|
LVIF_IMAGE
|
LVIF_STATE
)))
return
TRUE
;
/* get the subitem structure, and create it if not there */
/* get the subitem structure, and create it if not there */
hdpaSubItems
=
DPA_GetPtr
(
infoPtr
->
hdpaItems
,
lpLVItem
->
iItem
);
hdpaSubItems
=
DPA_GetPtr
(
infoPtr
->
hdpaItems
,
lpLVItem
->
iItem
);
assert
(
hdpaSubItems
);
assert
(
hdpaSubItems
);
...
...
dlls/comctl32/tests/listview.c
View file @
740e7be1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2006 Mike McCormack for CodeWeavers
* Copyright 2006 Mike McCormack for CodeWeavers
* Copyright 2007 George Gov
* Copyright 2007 George Gov
* Copyright 2009 Nikolay Sivov
* Copyright 2009
-2011
Nikolay Sivov
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -1030,10 +1030,11 @@ static void insert_item(HWND hwnd, int idx)
...
@@ -1030,10 +1030,11 @@ static void insert_item(HWND hwnd, int idx)
static
void
test_items
(
void
)
static
void
test_items
(
void
)
{
{
const
LPARAM
lparamTest
=
0x42
;
const
LPARAM
lparamTest
=
0x42
;
static
CHAR
text
[]
=
"Text"
;
char
buffA
[
5
];
HWND
hwnd
;
HWND
hwnd
;
LVITEMA
item
;
LVITEMA
item
;
DWORD
r
;
DWORD
r
;
static
CHAR
text
[]
=
"Text"
;
hwnd
=
CreateWindowEx
(
0
,
"SysListView32"
,
"foo"
,
LVS_REPORT
,
hwnd
=
CreateWindowEx
(
0
,
"SysListView32"
,
"foo"
,
LVS_REPORT
,
10
,
10
,
100
,
200
,
hwndparent
,
NULL
,
NULL
,
NULL
);
10
,
10
,
100
,
200
,
hwndparent
,
NULL
,
NULL
,
NULL
);
...
@@ -1140,6 +1141,55 @@ static void test_items(void)
...
@@ -1140,6 +1141,55 @@ static void test_items(void)
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
1
,
"ret %d
\n
"
,
r
);
ok
(
r
==
1
,
"ret %d
\n
"
,
r
);
item
.
mask
=
LVIF_TEXT
;
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
pszText
=
buffA
;
item
.
cchTextMax
=
sizeof
(
buffA
);
r
=
SendMessage
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
1
,
"ret %d
\n
"
,
r
);
ok
(
!
memcmp
(
item
.
pszText
,
text
,
sizeof
(
text
)),
"got text %s, expected %s
\n
"
,
item
.
pszText
,
text
);
/* set up with extra flag */
/* 1. reset subitem text */
item
.
mask
=
LVIF_TEXT
;
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
pszText
=
NULL
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
1
,
"ret %d
\n
"
,
r
);
item
.
mask
=
LVIF_TEXT
;
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
pszText
=
buffA
;
buffA
[
0
]
=
'a'
;
item
.
cchTextMax
=
sizeof
(
buffA
);
r
=
SendMessage
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
1
,
"ret %d
\n
"
,
r
);
ok
(
item
.
pszText
[
0
]
==
0
,
"got %p
\n
"
,
item
.
pszText
);
/* 2. set new text with extra flag specified */
item
.
mask
=
LVIF_TEXT
|
LVIF_DI_SETITEM
;
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
pszText
=
text
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
1
||
broken
(
r
==
0
)
/* NT4 */
,
"ret %d
\n
"
,
r
);
if
(
r
==
1
)
{
item
.
mask
=
LVIF_TEXT
;
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
pszText
=
buffA
;
buffA
[
0
]
=
'a'
;
item
.
cchTextMax
=
sizeof
(
buffA
);
r
=
SendMessage
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
1
,
"ret %d
\n
"
,
r
);
ok
(
!
memcmp
(
item
.
pszText
,
text
,
sizeof
(
text
)),
"got %s, expected %s
\n
"
,
item
.
pszText
,
text
);
}
/* Query param from subitem: returns main item param */
/* Query param from subitem: returns main item param */
memset
(
&
item
,
0xcc
,
sizeof
(
item
));
memset
(
&
item
,
0xcc
,
sizeof
(
item
));
item
.
mask
=
LVIF_PARAM
;
item
.
mask
=
LVIF_PARAM
;
...
...
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