Commit c16b65cd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Add partial implementation of LVM_GETNEXTITEMINDEX.

parent b74b6343
......@@ -7452,6 +7452,17 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF
return -1;
}
static BOOL LISTVIEW_GetNextItemIndex(const LISTVIEW_INFO *infoPtr, LVITEMINDEX *index, UINT flags)
{
/* FIXME: specified item group is ignored */
if (!index)
return FALSE;
index->iItem = LISTVIEW_GetNextItem(infoPtr, index->iItem, flags);
return index->iItem != -1;
}
/* LISTVIEW_GetNumberOfWorkAreas */
/***
......@@ -11426,6 +11437,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case LVM_GETNEXTITEM:
return LISTVIEW_GetNextItem(infoPtr, (INT)wParam, LOWORD(lParam));
case LVM_GETNEXTITEMINDEX:
return LISTVIEW_GetNextItemIndex(infoPtr, (LVITEMINDEX *)wParam, lParam);
case LVM_GETNUMBEROFWORKAREAS:
FIXME("LVM_GETNUMBEROFWORKAREAS: unimplemented\n");
return 1;
......
......@@ -6624,6 +6624,37 @@ static void test_selected_column(void)
}
}
static void test_LVM_GETNEXTITEMINDEX(void)
{
LVITEMINDEX index;
HWND hwnd;
BOOL ret;
hwnd = create_listview_control(LVS_REPORT);
insert_item(hwnd, 0);
insert_item(hwnd, 1);
ret = SendMessageA(hwnd, LVM_GETNEXTITEMINDEX, 0, LVNI_ALL);
ok(!ret, "Unexpected return value %d.\n", ret);
index.iItem = -1;
index.iGroup = 0;
ret = SendMessageA(hwnd, LVM_GETNEXTITEMINDEX, (WPARAM)&index, LVNI_ALL);
ok(ret, "Unexpected return value %d.\n", ret);
ok(index.iItem == 0, "Unexpected item index %d.\n", index.iItem);
ret = SendMessageA(hwnd, LVM_GETNEXTITEMINDEX, (WPARAM)&index, LVNI_ALL);
ok(ret, "Unexpected return value %d.\n", ret);
ok(index.iItem == 1, "Unexpected item index %d.\n", index.iItem);
ret = SendMessageA(hwnd, LVM_GETNEXTITEMINDEX, (WPARAM)&index, LVNI_ALL);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(index.iItem == -1, "Unexpected item index %d.\n", index.iItem);
DestroyWindow(hwnd);
}
START_TEST(listview)
{
ULONG_PTR ctx_cookie;
......@@ -6730,6 +6761,7 @@ START_TEST(listview)
test_LVM_GETCOUNTPERPAGE();
test_item_state_change();
test_selected_column();
test_LVM_GETNEXTITEMINDEX();
unload_v6_module(ctx_cookie, hCtx);
......
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