Module: wine Branch: master Commit: 77874d7863dc92907452615823e8b038690ced5b URL: http://source.winehq.org/git/wine.git/?a=commit;h=77874d7863dc92907452615823...
Author: Daniel Jelinski djelinski1@gmail.com Date: Mon Feb 4 20:57:58 2013 +0100
comctl32/listview: Fix LVM_SETICONSPACING on 64bit machines.
---
dlls/comctl32/listview.c | 4 +++- dlls/comctl32/tests/listview.c | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 1274d15..a22b2da 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -11468,7 +11468,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_SetHoverTime(infoPtr, (DWORD)lParam);
case LVM_SETICONSPACING: - return LISTVIEW_SetIconSpacing(infoPtr, (short)LOWORD(lParam), (short)HIWORD(lParam)); + if(lParam == -1) + return LISTVIEW_SetIconSpacing(infoPtr, -1, -1); + return LISTVIEW_SetIconSpacing(infoPtr, LOWORD(lParam), HIWORD(lParam));
case LVM_SETIMAGELIST: return (LRESULT)LISTVIEW_SetImageList(infoPtr, (INT)wParam, (HIMAGELIST)lParam); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 98ca495..fef3f60 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -4654,11 +4654,26 @@ static void test_getitemspacing(void)
ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); expect(100, LOWORD(ret)); - expect(0xFFFF, HIWORD(ret));
- ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); - expect(100, LOWORD(ret)); expect(0xFFFF, HIWORD(ret)); + + if (sizeof(void*) == 8) + { + /* NOTE: -1 is not treated the same as (DWORD)-1 by 64bit listview */ + ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, (DWORD)-1); + expect(100, LOWORD(ret)); + expect(0xFFFF, HIWORD(ret)); + + ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); + expect(0xFFFF, LOWORD(ret)); + expect(0xFFFF, HIWORD(ret)); + } + else + { + ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); + expect(100, LOWORD(ret)); + expect(0xFFFF, HIWORD(ret)); + } ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* spacing + icon size returned */ expect(cx + 40, LOWORD(ret));