comctl32/listview: Directly reset focused item on item count change.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8c68872416
commit
9f019b7c76
|
@ -8834,6 +8834,7 @@ static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFl
|
||||||
if (infoPtr->nFocusedItem >= nItems)
|
if (infoPtr->nFocusedItem >= nItems)
|
||||||
{
|
{
|
||||||
LISTVIEW_SetItemFocus(infoPtr, -1);
|
LISTVIEW_SetItemFocus(infoPtr, -1);
|
||||||
|
infoPtr->nFocusedItem = -1;
|
||||||
SetRectEmpty(&infoPtr->rcFocus);
|
SetRectEmpty(&infoPtr->rcFocus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6107,10 +6107,9 @@ todo_wine
|
||||||
ok(ret, "Failed to set item count.\n");
|
ok(ret, "Failed to set item count.\n");
|
||||||
|
|
||||||
ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
|
ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
|
||||||
todo_wine
|
|
||||||
ok(ret == -1, "Unexpected focused item, ret %d\n", ret);
|
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. */
|
/* 2 items, focus on index 0, reduce to 1 item. */
|
||||||
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
||||||
|
|
Loading…
Reference in New Issue