comctl32: Explicitly initialize visible order of a newly added item, force visible order recalculation on redraw.

This commit is contained in:
Dmitry Timoshkov 2009-07-16 17:34:54 +09:00 committed by Alexandre Julliard
parent 2bf4acb56c
commit 1d265bcac2
1 changed files with 2 additions and 2 deletions

View File

@ -1255,6 +1255,7 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
newItem->parent = parentItem;
newItem->iIntegral = 1;
newItem->visibleOrder = -1;
if (!TREEVIEW_DoSetItemT(infoPtr, newItem, tvItem, isW))
return 0;
@ -1394,8 +1395,6 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
}
else
{
newItem->visibleOrder = -1;
/* refresh treeview if newItem is the first item inserted under parentItem */
if (ISVISIBLE(parentItem) && newItem->prevSibling == newItem->nextSibling)
{
@ -1594,6 +1593,7 @@ TREEVIEW_SetRedraw(TREEVIEW_INFO* infoPtr, WPARAM wParam)
if (infoPtr->bRedraw)
{
TREEVIEW_UpdateSubTree(infoPtr, infoPtr->root);
TREEVIEW_RecalculateVisibleOrder(infoPtr, NULL);
TREEVIEW_UpdateScrollBars(infoPtr);
TREEVIEW_Invalidate(infoPtr, NULL);
}