gdiplus: Don't create a font if there is no facename.

This commit is contained in:
Adam Petaccia 2008-08-27 17:22:12 -04:00 committed by Alexandre Julliard
parent 5361f074a3
commit 74c8117a4b
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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));