On InsertItem with TVI_FIRST, the check for resetting firstVisible

must be done *before* the parent's firstChild changes.
This commit is contained in:
Susan Farley 2000-10-12 23:11:06 +00:00 committed by Alexandre Julliard
parent 85f4a49c2d
commit 3bd7f58706

View file

@ -1052,9 +1052,9 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
switch ((DWORD)insertAfter)
{
case (DWORD)TVI_FIRST:
TREEVIEW_InsertBefore(newItem, parentItem->firstChild, parentItem);
if (infoPtr->firstVisible == parentItem->firstChild)
TREEVIEW_SetFirstVisible(infoPtr, newItem, TRUE);
TREEVIEW_InsertBefore(newItem, parentItem->firstChild, parentItem);
break;
case (DWORD)TVI_LAST: