Commit 4b6ed4ed authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

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).
parent 7bd78fe5
......@@ -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;
......@@ -6108,7 +6107,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
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 */
......
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