[Gdiplus try2 08/10] Don't create a font if there is no facename

Adam Petaccia adam at tpetaccia.com
Wed Aug 27 16:22:12 CDT 2008


---
 dlls/gdiplus/font.c       |    3 +++
 dlls/gdiplus/tests/font.c |    2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index c59fde9..a5fd5b8 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -169,6 +169,9 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
     if(!logfont || !font)
         return InvalidParameter;
 
+    if (logfont->lfFaceName[0] == 0)
+        return NotTrueTypeFont;
+
     *font = GdipAlloc(sizeof(GpFont));
     if(!*font)  return OutOfMemory;
 
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index b396141..ab6d28c 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -112,9 +112,7 @@ static void test_logfont(void)
     lfw.lfFaceName[0] = 0;
     stat = GdipCreateFontFromLogfontW(hdc, &lfw, &font);
 
-todo_wine {
     expect(NotTrueTypeFont, stat);
-}
 
     memcpy(&lfw.lfFaceName, arial, 6 * sizeof(WCHAR));
 
-- 
1.5.4.3




More information about the wine-patches mailing list