Commit 28bffafd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Simplify key selection handler a bit.

parent 4527d02a
......@@ -3269,18 +3269,14 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem, BOOL space)
TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl);
if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
{
if (infoPtr->dwStyle & LVS_SINGLESEL)
{
bResult = TRUE;
bResult = TRUE;
if (infoPtr->dwStyle & LVS_SINGLESEL || (wShift == 0 && wCtrl == 0))
LISTVIEW_SetSelection(infoPtr, nItem);
}
else
{
if (wShift)
{
bResult = TRUE;
LISTVIEW_SetGroupSelection(infoPtr, nItem);
}
else if (wCtrl)
{
LVITEMW lvItem;
......@@ -3294,11 +3290,6 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem, BOOL space)
}
bResult = LISTVIEW_SetItemFocus(infoPtr, nItem);
}
else
{
bResult = TRUE;
LISTVIEW_SetSelection(infoPtr, nItem);
}
}
LISTVIEW_EnsureVisible(infoPtr, nItem, FALSE);
}
......
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