[Gdiplus 1/9] Don't create a font if there is no facename
Adam Petaccia
adam at tpetaccia.com
Sat Aug 16 22:28:48 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 70f7bb0..a61307c 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 3d30a86..46c0f20 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -101,9 +101,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