dwrite: Fix GetClusterMetrics() return value.
This commit is contained in:
parent
8a46a01008
commit
e6ce0e9f26
|
@ -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));
|
memcpy(metrics, This->clusters, sizeof(DWRITE_CLUSTER_METRICS)*min(max_count, This->clusters_count));
|
||||||
|
|
||||||
*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)
|
static HRESULT WINAPI dwritetextlayout_DetermineMinWidth(IDWriteTextLayout2 *iface, FLOAT* min_width)
|
||||||
|
|
|
@ -947,7 +947,6 @@ static void test_GetClusterMetrics(void)
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
|
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
|
||||||
todo_wine
|
|
||||||
ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
|
ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
|
||||||
ok(count == 4, "got %u\n", count);
|
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 */
|
/* inline object takes a separate cluster, replaced codepoints number doesn't matter */
|
||||||
count = 0;
|
count = 0;
|
||||||
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
|
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
|
||||||
todo_wine {
|
|
||||||
ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
|
ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
|
||||||
|
todo_wine
|
||||||
ok(count == 3, "got %u\n", count);
|
ok(count == 3, "got %u\n", count);
|
||||||
}
|
|
||||||
IDWriteInlineObject_Release(trimm);
|
IDWriteInlineObject_Release(trimm);
|
||||||
IDWriteTextLayout_Release(layout);
|
IDWriteTextLayout_Release(layout);
|
||||||
IDWriteTextFormat_Release(format);
|
IDWriteTextFormat_Release(format);
|
||||||
|
|
Loading…
Reference in New Issue