dwrite: Do not create intermediate object to return face reference from family.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e091903999
commit
82df524e7e
@ -2429,21 +2429,19 @@ static HRESULT WINAPI dwritefontfamily1_GetFont(IDWriteFontFamily2 *iface, UINT3
|
|||||||
static HRESULT WINAPI dwritefontfamily1_GetFontFaceReference(IDWriteFontFamily2 *iface, UINT32 index,
|
static HRESULT WINAPI dwritefontfamily1_GetFontFaceReference(IDWriteFontFamily2 *iface, UINT32 index,
|
||||||
IDWriteFontFaceReference **reference)
|
IDWriteFontFaceReference **reference)
|
||||||
{
|
{
|
||||||
IDWriteFont3 *font;
|
struct dwrite_fontfamily *family = impl_from_IDWriteFontFamily2(iface);
|
||||||
HRESULT hr;
|
const struct dwrite_font_data *font;
|
||||||
|
|
||||||
TRACE("%p, %u, %p.\n", iface, index, reference);
|
TRACE("%p, %u, %p.\n", iface, index, reference);
|
||||||
|
|
||||||
*reference = NULL;
|
*reference = NULL;
|
||||||
|
|
||||||
hr = IDWriteFontFamily2_GetFont(iface, index, &font);
|
if (index >= family->data->count)
|
||||||
if (FAILED(hr))
|
return E_FAIL;
|
||||||
return hr;
|
|
||||||
|
|
||||||
hr = IDWriteFont3_GetFontFaceReference(font, reference);
|
font = family->data->fonts[index];
|
||||||
IDWriteFont3_Release(font);
|
return IDWriteFactory5_CreateFontFaceReference_((IDWriteFactory5 *)family->collection->factory,
|
||||||
|
font->file, font->face_index, font->simulations, reference);
|
||||||
return hr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI dwritefontfamily2_GetMatchingFonts(IDWriteFontFamily2 *iface,
|
static HRESULT WINAPI dwritefontfamily2_GetMatchingFonts(IDWriteFontFamily2 *iface,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user