From cf94bf88c2b13b1fcb394c1bd4cd5b4ab6179159 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Thu, 2 Nov 2000 20:09:43 +0000 Subject: [PATCH] Treeview item sorting could mess up the visibleOrder of the items. --- dlls/comctl32/treeview.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index b04678fdf33..a2b4d3fabb6 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -2791,7 +2791,10 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent, { int visOrder = infoPtr->firstVisible->visibleOrder; - TREEVIEW_RecalculateVisibleOrder(infoPtr, parent); + if (parent == infoPtr->root) + TREEVIEW_RecalculateVisibleOrder(infoPtr, NULL); + else + TREEVIEW_RecalculateVisibleOrder(infoPtr, parent); if (TREEVIEW_IsChildOf(parent, infoPtr->firstVisible)) {