comctl32: Check subitem is valid before calling LISTVIEW_InvalidateSubItem().

This commit is contained in:
Mike McCormack 2007-01-04 19:37:59 +09:00 committed by Alexandre Julliard
parent 2d097f7024
commit d6ea1bf120
1 changed files with 5 additions and 4 deletions

View File

@ -3601,7 +3601,8 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, B
{
/* this little optimization eliminates some nasty flicker */
if ( uView == LVS_REPORT && !(infoPtr->dwStyle & LVS_OWNERDRAWFIXED) &&
(!(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) || lpLVItem->iSubItem) )
!(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) &&
lpLVItem->iSubItem > 0 && lpLVItem->iSubItem <= DPA_GetPtrCount(infoPtr->hdpaColumns) )
LISTVIEW_InvalidateSubItem(infoPtr, lpLVItem->iItem, lpLVItem->iSubItem);
else
LISTVIEW_InvalidateItem(infoPtr, lpLVItem->iItem);