Nikolay Sivov : comctl32/listview: Always forward LVM_GETCOLUMNORDERARRAY to header.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Mar 30 10:12:58 CDT 2015
Module: wine
Branch: master
Commit: 5c2e7075df45370c6d74b230a8531fcea2fd473f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5c2e7075df45370c6d74b230a8531fcea2fd473f
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sat Mar 28 22:06:26 2015 +0300
comctl32/listview: Always forward LVM_GETCOLUMNORDERARRAY to header.
---
dlls/comctl32/listview.c | 9 ++-------
dlls/comctl32/tests/listview.c | 22 +++++++++++++++++++++-
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 0b3439b..44aaba0 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -6502,14 +6502,9 @@ static BOOL LISTVIEW_GetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVC
return TRUE;
}
-
-static BOOL LISTVIEW_GetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCount, LPINT lpiArray)
+static inline BOOL LISTVIEW_GetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCount, LPINT lpiArray)
{
- TRACE("iCount=%d, lpiArray=%p\n", iCount, lpiArray);
-
- if (!lpiArray)
- return FALSE;
-
+ if (!infoPtr->hwndHeader) return FALSE;
return SendMessageW(infoPtr->hwndHeader, HDM_GETORDERARRAY, iCount, (LPARAM)lpiArray);
}
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 8ce1cfe..0947251 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -176,6 +176,8 @@ static const struct message listview_ownerdata_switchto_seq[] = {
static const struct message listview_getorderarray_seq[] = {
{ LVM_GETCOLUMNORDERARRAY, sent|id|wparam, 2, 0, LISTVIEW_ID },
{ HDM_GETORDERARRAY, sent|id|wparam, 2, 0, HEADER_ID },
+ { LVM_GETCOLUMNORDERARRAY, sent|id|wparam, 0, 0, LISTVIEW_ID },
+ { HDM_GETORDERARRAY, sent|id|wparam, 0, 0, HEADER_ID },
{ 0 }
};
@@ -1413,13 +1415,28 @@ static void test_items(void)
static void test_columns(void)
{
- HWND hwnd;
+ HWND hwnd, header;
LVCOLUMNA column;
LVITEMA item;
INT order[2];
CHAR buff[5];
DWORD rc;
+ hwnd = CreateWindowExA(0, "SysListView32", "foo", LVS_LIST,
+ 10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
+ ok(hwnd != NULL, "failed to create listview window\n");
+
+ header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0);
+ ok(header == NULL, "got %p\n", header);
+
+ rc = SendMessageA(hwnd, LVM_GETCOLUMNORDERARRAY, 2, (LPARAM)&order);
+ ok(rc == 0, "got %d\n", rc);
+
+ header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0);
+ ok(header == NULL, "got %p\n", header);
+
+ DestroyWindow(hwnd);
+
hwnd = CreateWindowExA(0, "SysListView32", "foo", LVS_REPORT,
10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
ok(hwnd != NULL, "failed to create listview window\n");
@@ -1457,6 +1474,9 @@ static void test_columns(void)
ok(order[0] == 0, "Expected order 0, got %d\n", order[0]);
ok(order[1] == 1, "Expected order 1, got %d\n", order[1]);
+ rc = SendMessageA(hwnd, LVM_GETCOLUMNORDERARRAY, 0, 0);
+ expect(0, rc);
+
ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_getorderarray_seq, "get order array", FALSE);
/* after column added subitem is considered as present */
More information about the wine-cvs
mailing list