comctl32: Don't rearrange icons / update scroll bar when destroying a listview.

This commit is contained in:
Lei Zhang 2008-06-17 18:07:38 -07:00 committed by Alexandre Julliard
parent 57c49cbb0d
commit 59e3490cad
1 changed files with 8 additions and 5 deletions

View File

@ -4457,7 +4457,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP
* SUCCESS : TRUE * SUCCESS : TRUE
* FAILURE : FALSE * FAILURE : FALSE
*/ */
static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr) static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy)
{ {
NMLISTVIEW nmlv; NMLISTVIEW nmlv;
HDPA hdpaSubItems = NULL; HDPA hdpaSubItems = NULL;
@ -4501,8 +4501,11 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr)
infoPtr->nItemCount --; infoPtr->nItemCount --;
} }
LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); if (!destroy)
LISTVIEW_UpdateScroll(infoPtr); {
LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
LISTVIEW_UpdateScroll(infoPtr);
}
LISTVIEW_InvalidateList(infoPtr); LISTVIEW_InvalidateList(infoPtr);
return TRUE; return TRUE;
@ -8729,7 +8732,7 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
TRACE("()\n"); TRACE("()\n");
/* delete all items */ /* delete all items */
LISTVIEW_DeleteAllItems(infoPtr); LISTVIEW_DeleteAllItems(infoPtr, TRUE);
/* destroy data structure */ /* destroy data structure */
DPA_Destroy(infoPtr->hdpaItems); DPA_Destroy(infoPtr->hdpaItems);
@ -9510,7 +9513,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return (LRESULT)LISTVIEW_CreateDragImage(infoPtr, (INT)wParam, (LPPOINT)lParam); return (LRESULT)LISTVIEW_CreateDragImage(infoPtr, (INT)wParam, (LPPOINT)lParam);
case LVM_DELETEALLITEMS: case LVM_DELETEALLITEMS:
return LISTVIEW_DeleteAllItems(infoPtr); return LISTVIEW_DeleteAllItems(infoPtr, FALSE);
case LVM_DELETECOLUMN: case LVM_DELETECOLUMN:
return LISTVIEW_DeleteColumn(infoPtr, (INT)wParam); return LISTVIEW_DeleteColumn(infoPtr, (INT)wParam);