gdi32: Go through all hfontlist entries not just the first one when checking whether font is in the child font list.

This commit is contained in:
Dmitry Timoshkov 2011-02-21 18:20:59 +08:00 committed by Alexandre Julliard
parent 00c8250ff8
commit 20bdd203aa
1 changed files with 10 additions and 8 deletions

View File

@ -3908,14 +3908,16 @@ BOOL WineEngDestroyFontInstance(HFONT handle)
LIST_FOR_EACH_ENTRY(gdiFont, &child_font_list, struct tagGdiFont, entry)
{
struct list *first_hfont = list_head(&gdiFont->hfontlist);
hflist = LIST_ENTRY(first_hfont, HFONTLIST, entry);
if(hflist->hfont == handle)
{
TRACE("removing child font %p from child list\n", gdiFont);
list_remove(&gdiFont->entry);
LeaveCriticalSection( &freetype_cs );
return TRUE;
hfontlist_elem_ptr = list_head(&gdiFont->hfontlist);
while(hfontlist_elem_ptr) {
hflist = LIST_ENTRY(hfontlist_elem_ptr, struct tagHFONTLIST, entry);
hfontlist_elem_ptr = list_next(&gdiFont->hfontlist, hfontlist_elem_ptr);
if(hflist->hfont == handle) {
TRACE("removing child font %p from child list\n", gdiFont);
list_remove(&gdiFont->entry);
LeaveCriticalSection( &freetype_cs );
return TRUE;
}
}
}