Commit 9f019b7c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Directly reset focused item on item count change.

parent 8c688724
......@@ -8834,6 +8834,7 @@ static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFl
if (infoPtr->nFocusedItem >= nItems)
{
LISTVIEW_SetItemFocus(infoPtr, -1);
infoPtr->nFocusedItem = -1;
SetRectEmpty(&infoPtr->rcFocus);
}
}
......
......@@ -6107,10 +6107,9 @@ todo_wine
ok(ret, "Failed to set item count.\n");
ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
todo_wine
ok(ret == -1, "Unexpected focused item, ret %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 2", TRUE);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 2", FALSE);
/* 2 items, focus on index 0, reduce to 1 item. */
flush_sequences(sequences, NUM_MSG_SEQUENCES);
......
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