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

Dmitry Timoshkov dmitry at codeweavers.com
Mon Feb 21 04:20:59 CST 2011


It's just a copy of the code which is slightly below in WineEngDestroyFontInstance,
so that it looks consistently.

---
 dlls/gdi32/freetype.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index e0a93f8..edddde1 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -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;
+            }
         }
     }
 
-- 
1.7.3.5




More information about the wine-patches mailing list