comctl32: Don't invalidate item in LISTVIEW_SetItemT when its state has not changed.

This commit is contained in:
Piotr Caban 2011-07-21 13:49:59 +02:00 committed by Alexandre Julliard
parent 315599c650
commit c47c62a802
1 changed files with 6 additions and 2 deletions

View File

@ -4401,14 +4401,15 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem, BOOL is
HWND hwndSelf = infoPtr->hwndSelf; HWND hwndSelf = infoPtr->hwndSelf;
LPWSTR pszText = NULL; LPWSTR pszText = NULL;
BOOL bResult, bChanged = FALSE; BOOL bResult, bChanged = FALSE;
RECT oldItemArea;
TRACE("(lpLVItem=%s, isW=%d)\n", debuglvitem_t(lpLVItem, isW), isW); TRACE("(lpLVItem=%s, isW=%d)\n", debuglvitem_t(lpLVItem, isW), isW);
if (!lpLVItem || lpLVItem->iItem < 0 || lpLVItem->iItem >= infoPtr->nItemCount) if (!lpLVItem || lpLVItem->iItem < 0 || lpLVItem->iItem >= infoPtr->nItemCount)
return FALSE; return FALSE;
/* Invalidate old item area */ /* Store old item area */
LISTVIEW_InvalidateItem(infoPtr, lpLVItem->iItem); LISTVIEW_GetItemBox(infoPtr, lpLVItem->iItem, &oldItemArea);
/* For efficiency, we transform the lpLVItem->pszText to Unicode here */ /* For efficiency, we transform the lpLVItem->pszText to Unicode here */
if ((lpLVItem->mask & LVIF_TEXT) && is_text(lpLVItem->pszText)) if ((lpLVItem->mask & LVIF_TEXT) && is_text(lpLVItem->pszText))
@ -4436,7 +4437,10 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem, BOOL is
lpLVItem->iSubItem > 0 && lpLVItem->iSubItem <= DPA_GetPtrCount(infoPtr->hdpaColumns) ) lpLVItem->iSubItem > 0 && lpLVItem->iSubItem <= DPA_GetPtrCount(infoPtr->hdpaColumns) )
LISTVIEW_InvalidateSubItem(infoPtr, lpLVItem->iItem, lpLVItem->iSubItem); LISTVIEW_InvalidateSubItem(infoPtr, lpLVItem->iItem, lpLVItem->iSubItem);
else else
{
LISTVIEW_InvalidateRect(infoPtr, &oldItemArea);
LISTVIEW_InvalidateItem(infoPtr, lpLVItem->iItem); LISTVIEW_InvalidateItem(infoPtr, lpLVItem->iItem);
}
} }
/* restore text */ /* restore text */
if (pszText) if (pszText)