dwrite: Fix GetClusterMetrics() return value.

This commit is contained in:
Nikolay Sivov 2015-03-13 11:59:26 +03:00 committed by Alexandre Julliard
parent 8a46a01008
commit e6ce0e9f26
2 changed files with 3 additions and 4 deletions

View File

@ -1730,7 +1730,7 @@ static HRESULT WINAPI dwritetextlayout_GetClusterMetrics(IDWriteTextLayout2 *ifa
memcpy(metrics, This->clusters, sizeof(DWRITE_CLUSTER_METRICS)*min(max_count, This->clusters_count));
*count = This->clusters_count;
return max_count < This->clusters_count ? S_OK : E_NOT_SUFFICIENT_BUFFER;
return max_count >= This->clusters_count ? S_OK : E_NOT_SUFFICIENT_BUFFER;
}
static HRESULT WINAPI dwritetextlayout_DetermineMinWidth(IDWriteTextLayout2 *iface, FLOAT* min_width)

View File

@ -947,7 +947,6 @@ static void test_GetClusterMetrics(void)
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
todo_wine
ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
ok(count == 4, "got %u\n", count);
@ -962,10 +961,10 @@ todo_wine
/* inline object takes a separate cluster, replaced codepoints number doesn't matter */
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
todo_wine {
ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
todo_wine
ok(count == 3, "got %u\n", count);
}
IDWriteInlineObject_Release(trimm);
IDWriteTextLayout_Release(layout);
IDWriteTextFormat_Release(format);