comctl32/listview: redraw items after insert/delete
Daniel Jelinski
djelinski1 at gmail.com
Sat Jan 5 09:36:53 CST 2013
-------------- next part --------------
From 7e1c0f8796c934fa2f3e70bb97d2446faf9df20b Mon Sep 17 00:00:00 2001
From: Daniel Jelinski <djelinski1 at gmail.com>
Date: Sat, 5 Jan 2013 16:09:48 +0100
Subject: comctl32/listview: redraw items after insert/delete
Found during examination of application attached to bug 9491.
The application paints all odd rows blue and all even rows green.
When inserting a new row on the first position, native listview
redraws all items using correct colors, while wine's keeps original
colors. This patch fixes that issue.
---
dlls/comctl32/listview.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 977bb18..659178e 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -5624,9 +5624,8 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
TRACE("rcScroll=%s, dx=%d\n", wine_dbgstr_rect(&rcScroll), dir * infoPtr->nItemHeight);
if (IntersectRect(&rcScroll, &rcScroll, &infoPtr->rcList))
{
- TRACE("Scrolling rcScroll=%s, rcList=%s\n", wine_dbgstr_rect(&rcScroll), wine_dbgstr_rect(&infoPtr->rcList));
- ScrollWindowEx(infoPtr->hwndSelf, 0, dir * infoPtr->nItemHeight,
- &rcScroll, &rcScroll, 0, 0, SW_ERASE | SW_INVALIDATE);
+ TRACE("Invalidating rcScroll=%s, rcList=%s\n", wine_dbgstr_rect(&rcScroll), wine_dbgstr_rect(&infoPtr->rcList));
+ InvalidateRect(infoPtr->hwndSelf, &rcScroll, TRUE);
}
/* report has only that column, so we're done */
@@ -5639,8 +5638,7 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
rcScroll.bottom = nPerCol * infoPtr->nItemHeight;
OffsetRect(&rcScroll, Origin.x, Origin.y);
if (IntersectRect(&rcScroll, &rcScroll, &infoPtr->rcList))
- ScrollWindowEx(infoPtr->hwndSelf, 0, dir * infoPtr->nItemHeight,
- &rcScroll, &rcScroll, 0, 0, SW_ERASE | SW_INVALIDATE);
+ InvalidateRect(infoPtr->hwndSelf, &rcScroll, TRUE);
}
/***
--
1.7.5.4
More information about the wine-patches
mailing list