Commit 2b5d9c6e authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

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

has been selected before, in order to let other items get erased.
parent 618ce03e
......@@ -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)
{
......
......@@ -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);
}
}
}
}
......
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