Always call LISTVIEW_SetSelection() for an item, even if that item

has been selected before, in order to let other items get erased.
This commit is contained in:
Andreas Mohr 2000-08-29 03:52:16 +00:00 committed by Alexandre Julliard
parent 618ce03ed3
commit 2b5d9c6e50
2 changed files with 13 additions and 7 deletions

View file

@ -1887,6 +1887,12 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
{
if (descr->style & LBS_EXTENDEDSEL)
{
/* we should perhaps make sure that all items are deselected
FIXME: needed for !LBS_EXTENDEDSEL, too ?
if (!(wParam & (MK_SHIFT|MK_CONTROL)))
LISTBOX_SetSelection( wnd, descr, -1, FALSE, FALSE);
*/
if (!(wParam & MK_SHIFT)) descr->anchor_item = index;
if (wParam & MK_CONTROL)
{

View file

@ -7887,16 +7887,16 @@ static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX,
}
else
{
if (ListView_GetItemState(hwnd, nItem, LVIS_SELECTED) & LVIS_SELECTED
&& infoPtr->nEditLabelItem == -1)
BOOL was_selected =
(ListView_GetItemState(hwnd, nItem, LVIS_SELECTED) & LVIS_SELECTED);
/* set selection (clears other pre-existing selections) */
LISTVIEW_SetSelection(hwnd, nItem);
if (was_selected && infoPtr->nEditLabelItem == -1)
{
infoPtr->nEditLabelItem = nItem;
}
else
{
LISTVIEW_SetSelection(hwnd, nItem);
}
}
}
}