Nikolay Sivov : comctl32/listview: Don't forward HDN_ITEMCHANGING/ HDN_ITEMCHANGED to listview parent.
Alexandre Julliard
julliard at winehq.org
Wed May 11 13:02:56 CDT 2011
Module: wine
Branch: master
Commit: 69bcdb7aad96c6ad21d8a28dd712a7159a974d68
URL: http://source.winehq.org/git/wine.git/?a=commit;h=69bcdb7aad96c6ad21d8a28dd712a7159a974d68
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed May 11 11:10:24 2011 +0400
comctl32/listview: Don't forward HDN_ITEMCHANGING/HDN_ITEMCHANGED to listview parent.
---
dlls/comctl32/listview.c | 9 ---------
dlls/comctl32/tests/listview.c | 24 ++++++++++++++++++++++++
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 6f7d7f3..8f7745f 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10141,7 +10141,6 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
*/
static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
{
- HWND hwndSelf = infoPtr->hwndSelf;
const NMHEADERW *lpnmh;
TRACE("(lpnmhdr=%p)\n", lpnmhdr);
@@ -10194,10 +10193,6 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
LISTVIEW_InvalidateList(infoPtr);
notify_forward_header(infoPtr, lpnmh);
return FALSE;
-
- case HDN_ITEMCHANGINGW:
- case HDN_ITEMCHANGINGA:
- return notify_forward_header(infoPtr, lpnmh);
case HDN_ITEMCHANGEDW:
case HDN_ITEMCHANGEDA:
@@ -10205,10 +10200,6 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
COLUMN_INFO *lpColumnInfo;
HDITEMW hdi;
INT dx, cxy;
-
- notify_forward_header(infoPtr, lpnmh);
- if (!IsWindow(hwndSelf))
- break;
if (!lpnmh->pitem || !(lpnmh->pitem->mask & HDI_WIDTH))
{
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 3bf3dcb..20f231e 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -305,6 +305,13 @@ static const struct message listview_destroy[] = {
{ 0 }
};
+static const struct message listview_header_changed_seq[] = {
+ { LVM_SETCOLUMNA, sent },
+ { WM_NOTIFY, sent|id|defwinproc, 0, 0, LISTVIEW_ID },
+ { WM_NOTIFY, sent|id|defwinproc, 0, 0, LISTVIEW_ID },
+ { 0 }
+};
+
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static LONG defwndproc_counter = 0;
@@ -4593,11 +4600,13 @@ static void test_destroynotify(void)
static void test_header_notification(void)
{
+ static char textA[] = "newtext";
HWND list, header;
HDITEMA item;
NMHEADER nmh;
LVCOLUMNA col;
LRESULT ret;
+ BOOL r;
list = create_listview_control(LVS_REPORT);
ok(list != NULL, "failed to create listview window\n");
@@ -4608,6 +4617,21 @@ static void test_header_notification(void)
ret = SendMessage(list, LVM_INSERTCOLUMNA, 0, (LPARAM)&col);
ok(!ret, "expected 0, got %ld\n", ret);
+ /* check list parent notification after header item changed,
+ this test should be placed before header subclassing to avoid
+ Listview -> Header messages to be logged */
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+
+ col.mask = LVCF_TEXT;
+ col.pszText = textA;
+ r = SendMessage(list, LVM_SETCOLUMNA, 0, (LPARAM)&col);
+ ok(r == TRUE, "got %d\n", r);
+
+ ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_header_changed_seq,
+ "header notify, listview", FALSE);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
+ "header notify, parent", FALSE);
+
header = subclass_header(list);
ret = SendMessage(header, HDM_GETITEMCOUNT, 0, 0);
More information about the wine-cvs
mailing list