Clear the state image bits only if LVS_EX_CHECKBOXES is set.
Fix obvious logical error in focus handling. Indentation and formatting fixes. (based on a patch by Krishna Murthy).
This commit is contained in:
parent
7bd78fe59a
commit
4b6ed4ed84
|
@ -3317,7 +3317,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
|
|||
ranges_delitem(infoPtr->selectionRanges, lpLVItem->iItem);
|
||||
|
||||
/* if we are asked to change focus, and we manage it, do it */
|
||||
if (lpLVItem->state & lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED)
|
||||
if (lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED)
|
||||
{
|
||||
if (lpLVItem->state & LVIS_FOCUSED)
|
||||
{
|
||||
|
@ -6041,7 +6041,7 @@ static INT WINAPI LISTVIEW_InsertCompare( LPVOID first, LPVOID second, LPARAM
|
|||
}
|
||||
|
||||
/***
|
||||
* nESCRIPTION:
|
||||
* DESCRIPTION:
|
||||
* Inserts a new item in the listview control.
|
||||
*
|
||||
* PARAMETER(S):
|
||||
|
@ -6072,8 +6072,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
|
|||
|
||||
if (!is_assignable_item(lpLVItem, infoPtr->dwStyle)) return -1;
|
||||
|
||||
if ( !(lpItem = (ITEM_INFO *)Alloc(sizeof(ITEM_INFO))) )
|
||||
return -1;
|
||||
if (!(lpItem = (ITEM_INFO *)Alloc(sizeof(ITEM_INFO)))) return -1;
|
||||
|
||||
/* insert item in listview control data structure */
|
||||
if ( !(hdpaSubItems = DPA_Create(8)) ) goto fail;
|
||||
|
@ -6094,21 +6093,21 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
|
|||
/* set the item attributes */
|
||||
if (lpLVItem->mask & (LVIF_GROUPID|LVIF_COLUMNS))
|
||||
{
|
||||
/* full size structure expected - _WIN32IE >= 0x560 */
|
||||
item = *lpLVItem;
|
||||
/* full size structure expected - _WIN32IE >= 0x560 */
|
||||
item = *lpLVItem;
|
||||
}
|
||||
else if (lpLVItem->mask & LVIF_INDENT)
|
||||
{
|
||||
/* indent member expected - _WIN32IE >= 0x300 */
|
||||
memcpy(&item, lpLVItem, offsetof( LVITEMW, iGroupId ));
|
||||
/* indent member expected - _WIN32IE >= 0x300 */
|
||||
memcpy(&item, lpLVItem, offsetof( LVITEMW, iGroupId ));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* minimal structure expected */
|
||||
memcpy(&item, lpLVItem, offsetof( LVITEMW, iIndent ));
|
||||
/* minimal structure expected */
|
||||
memcpy(&item, lpLVItem, offsetof( LVITEMW, iIndent ));
|
||||
}
|
||||
item.iItem = nItem;
|
||||
item.state &= ~LVIS_STATEIMAGEMASK;
|
||||
if (infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) item.state &= ~LVIS_STATEIMAGEMASK;
|
||||
if (!set_main_item(infoPtr, &item, TRUE, isW, &has_changed)) goto undo;
|
||||
|
||||
/* if we're sorted, sort the list, and update the index */
|
||||
|
|
Loading…
Reference in New Issue