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).
oldstable
Dimitrie O. Paun 2004-06-04 17:58:29 +00:00 committed by Alexandre Julliard
parent 7bd78fe59a
commit 4b6ed4ed84
1 changed files with 10 additions and 11 deletions

View File

@ -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 */