dwrite: Implement IDWriteFontList1::GetFontFaceReference().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-05-06 00:34:02 +03:00 committed by Alexandre Julliard
parent 51154acb6a
commit e82cf8aa70
2 changed files with 28 additions and 3 deletions

View File

@ -1695,10 +1695,21 @@ static HRESULT WINAPI dwritefontlist1_GetFontFaceReference(IDWriteFontList1 *ifa
IDWriteFontFaceReference **reference)
{
struct dwrite_fontlist *This = impl_from_IDWriteFontList1(iface);
IDWriteFont3 *font;
HRESULT hr;
FIXME("(%p)->(%u %p): stub\n", This, index, reference);
TRACE("(%p)->(%u %p)\n", This, index, reference);
return E_NOTIMPL;
*reference = NULL;
hr = IDWriteFontList1_GetFont(iface, index, &font);
if (FAILED(hr))
return hr;
hr = IDWriteFont3_GetFontFaceReference(font, reference);
IDWriteFont3_Release(font);
return hr;
}
static const IDWriteFontList1Vtbl dwritefontlistvtbl = {

View File

@ -2941,7 +2941,12 @@ static void test_GetMatchingFonts(void)
hr = IDWriteFontList_QueryInterface(fontlist, &IID_IDWriteFontList1, (void**)&fontlist1);
if (hr == S_OK) {
IDWriteFontFaceReference *ref, *ref1;
IDWriteFont3 *font;
UINT32 count;
count = IDWriteFontList1_GetFontCount(fontlist1);
ok(count > 0, "got %u\n", count);
font = (void*)0xdeadbeef;
hr = IDWriteFontList1_GetFont(fontlist1, ~0u, &font);
@ -2949,7 +2954,7 @@ static void test_GetMatchingFonts(void)
ok(font == NULL, "got %p\n", font);
font = (void*)0xdeadbeef;
hr = IDWriteFontList1_GetFont(fontlist1, IDWriteFontList1_GetFontCount(fontlist1), &font);
hr = IDWriteFontList1_GetFont(fontlist1, count, &font);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
ok(font == NULL, "got %p\n", font);
@ -2957,6 +2962,15 @@ static void test_GetMatchingFonts(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
IDWriteFont3_Release(font);
hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &ref);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &ref1);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(ref != ref1, "got %p, %p\n", ref, ref1);
IDWriteFontFaceReference_Release(ref1);
IDWriteFontFaceReference_Release(ref);
IDWriteFontList1_Release(fontlist1);
}
else