Commit c033748c authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

comctl32/listbox: Use is_item_selected in more places.

parent d1b0626c
......@@ -1434,7 +1434,7 @@ static LRESULT LISTBOX_SelectItemRange( LB_DESCR *descr, INT first,
{
for (i = first; i <= last; i++)
{
if (descr->items[i].selected) continue;
if (is_item_selected(descr, i)) continue;
descr->items[i].selected = TRUE;
LISTBOX_InvalidateItemRect(descr, i);
}
......@@ -1443,7 +1443,7 @@ static LRESULT LISTBOX_SelectItemRange( LB_DESCR *descr, INT first,
{
for (i = first; i <= last; i++)
{
if (!descr->items[i].selected) continue;
if (!is_item_selected(descr, i)) continue;
descr->items[i].selected = FALSE;
LISTBOX_InvalidateItemRect(descr, i);
}
......@@ -2079,7 +2079,7 @@ static LRESULT LISTBOX_HandleLButtonDown( LB_DESCR *descr, DWORD keys, INT x, IN
{
LISTBOX_SetCaretIndex( descr, index, FALSE );
LISTBOX_SetSelection( descr, index,
!descr->items[index].selected,
!is_item_selected(descr, index),
(descr->style & LBS_NOTIFY) != 0);
}
else
......@@ -2089,13 +2089,13 @@ static LRESULT LISTBOX_HandleLButtonDown( LB_DESCR *descr, DWORD keys, INT x, IN
if (descr->style & LBS_EXTENDEDSEL)
{
LISTBOX_SetSelection( descr, index,
descr->items[index].selected,
is_item_selected(descr, index),
(descr->style & LBS_NOTIFY) != 0 );
}
else
{
LISTBOX_SetSelection( descr, index,
!descr->items[index].selected,
!is_item_selected(descr, index),
(descr->style & LBS_NOTIFY) != 0 );
}
}
......@@ -2415,7 +2415,7 @@ static LRESULT LISTBOX_HandleKeyDown( LB_DESCR *descr, DWORD key )
else if (descr->style & LBS_MULTIPLESEL)
{
LISTBOX_SetSelection( descr, descr->focus_item,
!descr->items[descr->focus_item].selected,
!is_item_selected(descr, descr->focus_item),
(descr->style & LBS_NOTIFY) != 0 );
}
break;
......
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