Commit 77874d78 authored by Daniel Jelinski's avatar Daniel Jelinski Committed by Alexandre Julliard

comctl32/listview: Fix LVM_SETICONSPACING on 64bit machines.

parent 80f70b5d
...@@ -11468,7 +11468,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -11468,7 +11468,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return LISTVIEW_SetHoverTime(infoPtr, (DWORD)lParam); return LISTVIEW_SetHoverTime(infoPtr, (DWORD)lParam);
case LVM_SETICONSPACING: 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: case LVM_SETIMAGELIST:
return (LRESULT)LISTVIEW_SetImageList(infoPtr, (INT)wParam, (HIMAGELIST)lParam); return (LRESULT)LISTVIEW_SetImageList(infoPtr, (INT)wParam, (HIMAGELIST)lParam);
......
...@@ -4654,11 +4654,26 @@ static void test_getitemspacing(void) ...@@ -4654,11 +4654,26 @@ static void test_getitemspacing(void)
ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0);
expect(100, LOWORD(ret)); expect(100, LOWORD(ret));
expect(0xFFFF, HIWORD(ret));
ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1);
expect(100, LOWORD(ret));
expect(0xFFFF, HIWORD(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); ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0);
/* spacing + icon size returned */ /* spacing + icon size returned */
expect(cx + 40, LOWORD(ret)); expect(cx + 40, LOWORD(ret));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment