Lei Zhang : comctl32: Fix listview redraw when deleting items.
Alexandre Julliard
julliard at winehq.org
Thu Mar 20 09:48:32 CDT 2008
Module: wine
Branch: master
Commit: 03f18eb425b16ad5388018e8ed1d59061591c77f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=03f18eb425b16ad5388018e8ed1d59061591c77f
Author: Lei Zhang <thestig at google.com>
Date: Wed Mar 19 17:49:50 2008 -0700
comctl32: Fix listview redraw when deleting items.
---
dlls/comctl32/listview.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 706e92b..abe1470 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -4642,8 +4642,9 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
*/
static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
{
- UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
LVITEMW item;
+ const UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
+ const BOOL is_icon = (uView == LVS_SMALLICON || uView == LVS_ICON);
TRACE("(nItem=%d)\n", nItem);
@@ -4658,7 +4659,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
if (!notify_deleteitem(infoPtr, nItem)) return FALSE;
/* we need to do this here, because we'll be deleting stuff */
- if (uView == LVS_SMALLICON || uView == LVS_ICON)
+ if (is_icon)
LISTVIEW_InvalidateItem(infoPtr, nItem);
if (!(infoPtr->dwStyle & LVS_OWNERDATA))
@@ -4677,7 +4678,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
DPA_Destroy(hdpaSubItems);
}
- if (uView == LVS_SMALLICON || uView == LVS_ICON)
+ if (is_icon)
{
DPA_DeletePtr(infoPtr->hdpaPosX, nItem);
DPA_DeletePtr(infoPtr->hdpaPosY, nItem);
@@ -4687,7 +4688,8 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
LISTVIEW_ShiftIndices(infoPtr, nItem, -1);
/* now is the invalidation fun */
- LISTVIEW_ScrollOnInsert(infoPtr, nItem, -1);
+ if (!is_icon)
+ LISTVIEW_ScrollOnInsert(infoPtr, nItem, -1);
return TRUE;
}
More information about the wine-cvs
mailing list