From 3520c8327546e377eb2b07bc2a1bb8376429024e Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Fri, 25 Oct 2002 03:15:51 +0000 Subject: [PATCH] Keep autoarranging items until one is moved. --- dlls/comctl32/listview.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 7787b8c9c26..0c3558cfa4f 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -251,6 +251,7 @@ typedef struct tagLISTVIEW_INFO INT ntmHeight; /* From GetTextMetrics from above font */ BOOL bRedraw; /* Turns on/off repaints & invalidations */ BOOL bFirstPaint; /* Flags if the control has never painted before */ + BOOL bAutoarrange; /* Autoarrange flag when NOT in LVS_AUTOARRANGE */ BOOL bFocus; INT nFocusedItem; RECT rcFocus; @@ -1173,7 +1174,8 @@ static inline BOOL is_autoarrange(LISTVIEW_INFO *infoPtr) { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; - return (infoPtr->dwStyle & LVS_AUTOARRANGE) && (uView == LVS_ICON || uView == LVS_SMALLICON); + return ((infoPtr->dwStyle & LVS_AUTOARRANGE) || infoPtr->bAutoarrange) && + (uView == LVS_ICON || uView == LVS_SMALLICON); } /******** Internal API functions ************************************/ @@ -2056,7 +2058,8 @@ static BOOL LISTVIEW_Arrange(LISTVIEW_INFO *infoPtr, INT nAlignCode) case LVA_SNAPTOGRID: next_pos = LISTVIEW_NextIconPosTop; break; /* FIXME */ default: return FALSE; } - + + infoPtr->bAutoarrange = TRUE; infoPtr->currIconPos.x = infoPtr->currIconPos.y = 0; for (i = 0; i < infoPtr->nItemCount; i++) { @@ -6562,6 +6565,8 @@ static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, POINT pt pt.x -= Origin.x; pt.y -= Origin.y; + infoPtr->bAutoarrange = FALSE; + return LISTVIEW_MoveIconTo(infoPtr, nItem, &pt, FALSE); }