comctl32/listview: Don't alter selection mark in LVM_SETITEMSTATE.

This commit is contained in:
Nikolay Sivov 2009-07-23 23:50:12 +04:00 committed by Alexandre Julliard
parent 092263f051
commit 59e59c6bf9
2 changed files with 0 additions and 35 deletions

View File

@ -8118,39 +8118,6 @@ static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE
else
bResult = LISTVIEW_SetItemT(infoPtr, &lvItem, TRUE);
/*
* Update selection mark
*
* Investigation on windows 2k showed that selection mark was updated
* whenever a new selection was made, but if the selected item was
* unselected it was not updated.
*
* we are probably still not 100% accurate, but this at least sets the
* proper selection mark when it is needed
*/
if (bResult && (lvItem.state & lvItem.stateMask & LVIS_SELECTED) &&
(infoPtr->nSelectionMark == -1))
{
int i;
for (i = 0; i < infoPtr->nItemCount; i++)
{
if (infoPtr->uCallbackMask & LVIS_SELECTED)
{
if (LISTVIEW_GetItemState(infoPtr, i, LVIS_SELECTED))
{
infoPtr->nSelectionMark = i;
break;
}
}
else if (ranges_contain(infoPtr->selectionRanges, i))
{
infoPtr->nSelectionMark = i;
break;
}
}
}
return bResult;
}

View File

@ -1990,7 +1990,6 @@ static void test_multiselect(void)
r = SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
expect(3, r);
r = SendMessage(hwnd, LVM_GETSELECTIONMARK, 0, 0);
todo_wine
expect(-1, r);
style = GetWindowLongPtrA(hwnd, GWL_STYLE);
@ -2022,7 +2021,6 @@ todo_wine
r = SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
expect(1, r);
r = SendMessage(hwnd, LVM_GETSELECTIONMARK, 0, 0);
todo_wine
expect(-1, r);
/* try to select all on LVS_SINGLESEL */