Commit e6ce0e9f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Fix GetClusterMetrics() return value.

parent 8a46a010
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment