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
d24095a7
Commit
d24095a7
authored
Apr 09, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Fix LVN_DELETEALLITEMS notification for LVS_OWNERDATA case.
parent
a3cd93ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
7 deletions
+45
-7
listview.c
dlls/comctl32/listview.c
+10
-7
listview.c
dlls/comctl32/tests/listview.c
+35
-0
No files found.
dlls/comctl32/listview.c
View file @
d24095a7
...
...
@@ -5383,9 +5383,8 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP
*/
static
BOOL
LISTVIEW_DeleteAllItems
(
LISTVIEW_INFO
*
infoPtr
,
BOOL
destroy
)
{
NMLISTVIEW
nmlv
;
HDPA
hdpaSubItems
=
NULL
;
BOOL
bSuppress
;
BOOL
suppress
=
FALSE
;
ITEMHDR
*
hdrItem
;
ITEM_INFO
*
lpItem
;
ITEM_ID
*
lpID
;
...
...
@@ -5400,11 +5399,15 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy)
SetRectEmpty
(
&
infoPtr
->
rcFocus
);
/* But we are supposed to leave nHotItem as is! */
/* send LVN_DELETEALLITEMS notification */
ZeroMemory
(
&
nmlv
,
sizeof
(
NMLISTVIEW
));
nmlv
.
iItem
=
-
1
;
bSuppress
=
notify_listview
(
infoPtr
,
LVN_DELETEALLITEMS
,
&
nmlv
);
if
(
!
(
infoPtr
->
dwStyle
&
LVS_OWNERDATA
)
||
!
destroy
)
{
NMLISTVIEW
nmlv
;
memset
(
&
nmlv
,
0
,
sizeof
(
NMLISTVIEW
));
nmlv
.
iItem
=
-
1
;
suppress
=
notify_listview
(
infoPtr
,
LVN_DELETEALLITEMS
,
&
nmlv
);
}
for
(
i
=
infoPtr
->
nItemCount
-
1
;
i
>=
0
;
i
--
)
{
...
...
@@ -5412,7 +5415,7 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy)
{
/* send LVN_DELETEITEM notification, if not suppressed
and if it is not a virtual listview */
if
(
!
bS
uppress
)
notify_deleteitem
(
infoPtr
,
i
);
if
(
!
s
uppress
)
notify_deleteitem
(
infoPtr
,
i
);
hdpaSubItems
=
DPA_GetPtr
(
infoPtr
->
hdpaItems
,
i
);
lpItem
=
DPA_GetPtr
(
hdpaSubItems
,
0
);
/* free id struct */
...
...
dlls/comctl32/tests/listview.c
View file @
d24095a7
...
...
@@ -330,6 +330,23 @@ static const struct message listview_destroy[] = {
{
0
}
};
static
const
struct
message
listview_ownerdata_destroy
[]
=
{
{
0x0090
,
sent
|
optional
},
/* Vista */
{
WM_PARENTNOTIFY
,
sent
},
{
WM_SHOWWINDOW
,
sent
},
{
WM_WINDOWPOSCHANGING
,
sent
},
{
WM_WINDOWPOSCHANGED
,
sent
|
optional
},
{
WM_DESTROY
,
sent
},
{
WM_NCDESTROY
,
sent
},
{
0
}
};
static
const
struct
message
listview_ownerdata_deleteall
[]
=
{
{
LVM_DELETEALLITEMS
,
sent
},
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
LVN_DELETEALLITEMS
},
{
0
}
};
static
const
struct
message
listview_header_changed_seq
[]
=
{
{
LVM_SETCOLUMNA
,
sent
},
{
WM_NOTIFY
,
sent
|
id
|
defwinproc
,
0
,
0
,
LISTVIEW_ID
},
...
...
@@ -5059,6 +5076,7 @@ static void test_hover(void)
static
void
test_destroynotify
(
void
)
{
HWND
hwnd
;
BOOL
ret
;
hwnd
=
create_listview_control
(
LVS_REPORT
);
ok
(
hwnd
!=
NULL
,
"failed to create listview window
\n
"
);
...
...
@@ -5066,6 +5084,23 @@ static void test_destroynotify(void)
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
DestroyWindow
(
hwnd
);
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
listview_destroy
,
"check destroy order"
,
FALSE
);
/* same for ownerdata list */
hwnd
=
create_listview_control
(
LVS_REPORT
|
LVS_OWNERDATA
);
ok
(
hwnd
!=
NULL
,
"failed to create listview window
\n
"
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
DestroyWindow
(
hwnd
);
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
listview_ownerdata_destroy
,
"check destroy order, ownerdata"
,
FALSE
);
hwnd
=
create_listview_control
(
LVS_REPORT
|
LVS_OWNERDATA
);
ok
(
hwnd
!=
NULL
,
"failed to create listview window
\n
"
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
ret
=
SendMessageA
(
hwnd
,
LVM_DELETEALLITEMS
,
0
,
0
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
listview_ownerdata_deleteall
,
"deleteall ownerdata"
,
FALSE
);
DestroyWindow
(
hwnd
);
}
static
void
test_header_notification
(
void
)
...
...
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