From 9ff0da09ff7b02a1c85ad44b16b87dea59004e60 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Wed, 23 Oct 2002 20:55:05 +0000 Subject: [PATCH] Do not autoarrange if we insert/delete from the end of the list. --- dlls/comctl32/listview.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index a37997eedf2..6778cb2af5c 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -4045,7 +4045,12 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir) /* arrange icons if autoarrange is on */ if (infoPtr->dwStyle & LVS_AUTOARRANGE) - LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); + { + BOOL arrange = TRUE; + if (dir < 0 && nItem >= infoPtr->nItemCount) arrange = FALSE; + if (dir > 0 && nItem == infoPtr->nItemCount - 1) arrange = FALSE; + if (arrange) LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); + } /* scrollbars need updating */ LISTVIEW_UpdateScroll(infoPtr);