comctl32/listview: Don't forward HDN_ITEMCHANGING/HDN_ITEMCHANGED to listview parent.

This commit is contained in:
Nikolay Sivov 2011-05-11 11:10:24 +04:00 committed by Alexandre Julliard
parent 84a39b4f63
commit 69bcdb7aad
2 changed files with 24 additions and 9 deletions

View file

@ -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))
{

View file

@ -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);