comctl32: Don't use uninitialized LVITEM fields in LISTVIEW_InsertItemT when LVS_EX_CHECKBOXES was specified.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
This commit is contained in:
Piotr Caban 2015-10-07 10:17:14 +02:00 committed by Alexandre Julliard
parent c565145b0e
commit 9c87c7e76d
1 changed files with 12 additions and 4 deletions

View File

@ -7851,10 +7851,18 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
item.iItem = nItem;
if (infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES)
{
item.mask |= LVIF_STATE;
item.stateMask |= LVIS_STATEIMAGEMASK;
item.state &= ~LVIS_STATEIMAGEMASK;
item.state |= INDEXTOSTATEIMAGEMASK(1);
if (item.mask & LVIF_STATE)
{
item.stateMask |= LVIS_STATEIMAGEMASK;
item.state &= ~LVIS_STATEIMAGEMASK;
item.state |= INDEXTOSTATEIMAGEMASK(1);
}
else
{
item.mask |= LVIF_STATE;
item.stateMask = LVIS_STATEIMAGEMASK;
item.state = INDEXTOSTATEIMAGEMASK(1);
}
}
if (!set_main_item(infoPtr, &item, TRUE, isW, &has_changed)) goto undo;