Nikolay Sivov : comctl32/listview: Enable column reordering.
Alexandre Julliard
julliard at winehq.org
Tue Aug 4 12:24:58 CDT 2009
Module: wine
Branch: master
Commit: c96900b9041d3b76abe3802da18f917b0b1055d6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c96900b9041d3b76abe3802da18f917b0b1055d6
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Tue Aug 4 00:42:51 2009 +0400
comctl32/listview: Enable column reordering.
---
dlls/comctl32/listview.c | 18 +++++++++---------
dlls/comctl32/tests/listview.c | 4 ++--
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 6dea474..3a0c411 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -52,7 +52,6 @@
* -- Support CustomDraw options for _WIN32_IE >= 0x560 (see NMLVCUSTOMDRAW docs).
* -- LVA_SNAPTOGRID not implemented
* -- LISTVIEW_ApproximateViewRect partially implemented
- * -- LISTVIEW_[GS]etColumnOrderArray stubs
* -- LISTVIEW_SetColumnWidth ignores header images & bitmap
* -- LISTVIEW_SetIconSpacing is incomplete
* -- LISTVIEW_StyleChanged doesn't handle some changes too well
@@ -7556,16 +7555,16 @@ static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn,
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_SetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray)
+static BOOL LISTVIEW_SetColumnOrderArray(LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray)
{
- FIXME("iCount %d lpiArray %p\n", iCount, lpiArray);
+ TRACE("iCount %d lpiArray %p\n", iCount, lpiArray);
- if (!lpiArray)
- return FALSE;
+ if (!lpiArray || !IsWindow(infoPtr->hwndHeader)) return FALSE;
- return TRUE;
-}
+ infoPtr->colRectsDirty = TRUE;
+ return SendMessageW(infoPtr->hwndHeader, HDM_SETORDERARRAY, iCount, (LPARAM)lpiArray);
+}
/***
* DESCRIPTION:
@@ -9541,9 +9540,10 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE
return (infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP) == 0;
case HDN_ENDDRAG:
- FIXME("Changing column order not implemented\n");
+ infoPtr->colRectsDirty = TRUE;
+ LISTVIEW_InvalidateList(infoPtr);
notify_forward_header(infoPtr, lpnmh);
- return TRUE;
+ return FALSE;
case HDN_ITEMCHANGINGW:
case HDN_ITEMCHANGINGA:
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 4ac14d5..72abdff 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -3159,7 +3159,7 @@ static void test_getitemrect(void)
r = SendMessage(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pt);
expect(TRUE, r);
/* 1 indexed column width + padding */
- todo_wine expect(102, pt.x);
+ expect(102, pt.x);
/* rect is at zero too */
rect.left = LVIR_BOUNDS;
rect.right = rect.top = rect.bottom = -1;
@@ -3174,7 +3174,7 @@ static void test_getitemrect(void)
r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect);
expect(TRUE, r);
/* column width + padding */
- todo_wine expect(102, rect.left);
+ expect(102, rect.left);
/* back to initial order */
order[0] = 0; order[1] = 1;
More information about the wine-cvs
mailing list