From 9ad9017edd7b8389155d486ed52840a76409e34d Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 20 Jan 1999 14:08:00 +0000 Subject: [PATCH] Do not call ownerdraw for invalid items (empty focusrects). Fixes Eudora 16bit empty Inbox problem. --- controls/listbox.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controls/listbox.c b/controls/listbox.c index 74b16eb1c6e..7b7fd710934 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -453,6 +453,14 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc, DRAWITEMSTRUCT32 dis; UINT32 id = (descr->lphc) ? ID_CB_LISTBOX : wnd->wIDmenu; + if (!item) + { + if (action == ODA_FOCUS) + DrawFocusRect32( hdc, rect ); + else + FIXME(listbox,"called with an out of bounds index %d(%d) in owner draw, Not good.\n",index,descr->nb_items); + return; + } dis.CtlType = ODT_LISTBOX; dis.CtlID = id; dis.hwndItem = wnd->hwndSelf;