Avoid divide by zero when listbox set to zero height.

This commit is contained in:
Mike McCormack 2000-09-09 19:39:24 +00:00 committed by Alexandre Julliard
parent 73968f0bd3
commit 5ae1c396cc
1 changed files with 6 additions and 1 deletions

View File

@ -348,7 +348,12 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
descr->height = rect.bottom - rect.top;
if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !(descr->style & LBS_OWNERDRAWVARIABLE))
{
UINT remaining = descr->height % descr->item_height;
UINT remaining;
if(descr->item_height != 0)
remaining = descr->height % descr->item_height;
else
remaining = 0;
if ((descr->height > descr->item_height) && remaining)
{
if (!(wnd->flags & WIN_ISWIN32))