From fcae48a08cffec0c7af37f8fe519b0b8c5821208 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 26 Oct 2012 12:10:47 -0400 Subject: [PATCH] dwrite: Layout can't be created without text format. --- dlls/dwrite/layout.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 153716bfd6a..76c5adbcd1f 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -681,14 +681,11 @@ HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *forma memset(&This->format, 0, sizeof(This->format)); /* reference is not kept here, instead copy all underlying data */ - if (format) - { - IDWriteTextFormat_GetFontCollection(format, &This->format.collection); - This->format.weight = IDWriteTextFormat_GetFontWeight(format); - This->format.style = IDWriteTextFormat_GetFontStyle(format); - This->format.stretch = IDWriteTextFormat_GetFontStretch(format); - This->format.size = IDWriteTextFormat_GetFontSize(format); - } + IDWriteTextFormat_GetFontCollection(format, &This->format.collection); + This->format.weight = IDWriteTextFormat_GetFontWeight(format); + This->format.style = IDWriteTextFormat_GetFontStyle(format); + This->format.stretch = IDWriteTextFormat_GetFontStretch(format); + This->format.size = IDWriteTextFormat_GetFontSize(format); *layout = &This->IDWriteTextLayout_iface;