Commit 690022c6 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

comctl32: Return TRUE from LVM_REDRAWITEMS with bad indices.

parent 0cf4728d
......@@ -7989,12 +7989,8 @@ static BOOL LISTVIEW_IsItemVisible(const LISTVIEW_INFO *infoPtr, INT nItem)
static BOOL LISTVIEW_RedrawItems(const LISTVIEW_INFO *infoPtr, INT nFirst, INT nLast)
{
INT i;
if (nLast < nFirst || min(nFirst, nLast) < 0 ||
max(nFirst, nLast) >= infoPtr->nItemCount)
return FALSE;
for (i = nFirst; i <= nLast; i++)
for (i = max(nFirst, 0); i <= min(nLast, infoPtr->nItemCount - 1); i++)
LISTVIEW_InvalidateItem(infoPtr, i);
return TRUE;
......
......@@ -5529,6 +5529,43 @@ static void test_LVM_SETITEMTEXT(void)
DestroyWindow(hwnd);
}
static void test_LVM_REDRAWITEMS(void)
{
HWND list;
DWORD ret;
list = create_listview_control(LVS_ICON);
ok(list != NULL, "failed to create listview window\n");
ret = SendMessageA(list, LVM_REDRAWITEMS, 0, 0);
expect(TRUE, ret);
insert_item(list, 0);
ret = SendMessageA(list, LVM_REDRAWITEMS, -1, 0);
expect(TRUE, ret);
ret = SendMessageA(list, LVM_REDRAWITEMS, 0, -1);
expect(TRUE, ret);
ret = SendMessageA(list, LVM_REDRAWITEMS, 0, 0);
expect(TRUE, ret);
ret = SendMessageA(list, LVM_REDRAWITEMS, 0, 1);
expect(TRUE, ret);
ret = SendMessageA(list, LVM_REDRAWITEMS, 0, 2);
expect(TRUE, ret);
ret = SendMessageA(list, LVM_REDRAWITEMS, 1, 0);
expect(TRUE, ret);
ret = SendMessageA(list, LVM_REDRAWITEMS, 2, 3);
expect(TRUE, ret);
DestroyWindow(list);
}
static void test_imagelists(void)
{
HWND hwnd, header;
......@@ -5903,6 +5940,7 @@ START_TEST(listview)
test_createdragimage();
test_dispinfo();
test_LVM_SETITEMTEXT();
test_LVM_REDRAWITEMS();
test_imagelists();
test_deleteitem();
test_insertitem();
......
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