comctl32/listview: Fix LVM_SETICONSPACING on 64bit machines.

This commit is contained in:
Daniel Jelinski 2013-02-04 20:57:58 +01:00 committed by Alexandre Julliard
parent 80f70b5d85
commit 77874d7863
2 changed files with 21 additions and 4 deletions

View File

@ -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);

View File

@ -4654,11 +4654,26 @@ static void test_getitemspacing(void)
ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0);
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));