user32/listbox: Remove duplicated condition.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-12-03 13:32:08 +03:00 committed by Alexandre Julliard
parent 4705843642
commit db869b61a1
1 changed files with 7 additions and 7 deletions

View File

@ -515,8 +515,8 @@ static INT LISTBOX_GetItemFromPoint( const LB_DESCR *descr, INT x, INT y )
static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
INT index, UINT action, BOOL ignoreFocus )
{
BOOL selected = FALSE, focused;
LB_ITEMDATA *item = NULL;
BOOL selected = FALSE;
if (index < descr->nb_items)
{
@ -524,6 +524,8 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
selected = is_item_selected(descr, index);
}
focused = !ignoreFocus && descr->focus_item == index && descr->caret_on && descr->in_focus;
if (IS_OWNERDRAW(descr))
{
DRAWITEMSTRUCT dis;
@ -555,9 +557,8 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
dis.itemState = 0;
if (selected)
dis.itemState |= ODS_SELECTED;
if (!ignoreFocus && (descr->focus_item == index) &&
(descr->caret_on) &&
(descr->in_focus)) dis.itemState |= ODS_FOCUS;
if (focused)
dis.itemState |= ODS_FOCUS;
if (!IsWindowEnabled(descr->self)) dis.itemState |= ODS_DISABLED;
dis.itemData = item->data;
dis.rcItem = *rect;
@ -607,9 +608,8 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
SetBkColor( hdc, oldBk );
SetTextColor( hdc, oldText );
}
if (!ignoreFocus && (descr->focus_item == index) &&
(descr->caret_on) &&
(descr->in_focus)) DrawFocusRect( hdc, rect );
if (focused)
DrawFocusRect( hdc, rect );
}
}