Commit 9c87c7e7 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

comctl32: Don't use uninitialized LVITEM fields in LISTVIEW_InsertItemT when…

comctl32: Don't use uninitialized LVITEM fields in LISTVIEW_InsertItemT when LVS_EX_CHECKBOXES was specified. Signed-off-by: 's avatarPiotr Caban <piotr@codeweavers.com>
parent c565145b
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment