From 30cdd592525340fc96b380f8900397873ed11aaa Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 29 Mar 2015 10:28:30 +0300 Subject: [PATCH] comctl32/listview: Always forward HDM_SETORDERARRAY to a header. --- dlls/comctl32/listview.c | 6 +----- dlls/comctl32/tests/listview.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 081f2a0e064..d2cd9401851 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -8307,12 +8307,8 @@ static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, */ static BOOL LISTVIEW_SetColumnOrderArray(LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray) { - TRACE("iCount %d lpiArray %p\n", iCount, lpiArray); - - if (!lpiArray || !IsWindow(infoPtr->hwndHeader)) return FALSE; - + if (!infoPtr->hwndHeader) return FALSE; infoPtr->colRectsDirty = TRUE; - return SendMessageW(infoPtr->hwndHeader, HDM_SETORDERARRAY, iCount, (LPARAM)lpiArray); } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 0947251d8c3..94c19f44cfb 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -181,6 +181,14 @@ static const struct message listview_getorderarray_seq[] = { { 0 } }; +static const struct message listview_setorderarray_seq[] = { + { LVM_SETCOLUMNORDERARRAY, sent|id|wparam, 2, 0, LISTVIEW_ID }, + { HDM_SETORDERARRAY, sent|id|wparam, 2, 0, HEADER_ID }, + { LVM_SETCOLUMNORDERARRAY, sent|id|wparam, 0, 0, LISTVIEW_ID }, + { HDM_SETORDERARRAY, sent|id|wparam, 0, 0, HEADER_ID }, + { 0 } +}; + static const struct message empty_seq[] = { { 0 } }; @@ -1479,6 +1487,19 @@ static void test_columns(void) ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_getorderarray_seq, "get order array", FALSE); + /* LVM_SETCOLUMNORDERARRAY */ + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + order[0] = 0; + order[1] = 1; + rc = SendMessageA(hwnd, LVM_SETCOLUMNORDERARRAY, 2, (LPARAM)&order); + expect(1, rc); + + rc = SendMessageA(hwnd, LVM_SETCOLUMNORDERARRAY, 0, 0); + expect(0, rc); + + ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_setorderarray_seq, "set order array", FALSE); + /* after column added subitem is considered as present */ insert_item(hwnd, 0); -- 2.11.4.GIT