dwrite: Call GetCount() once when looking for family name.

This commit is contained in:
Nikolay Sivov 2015-06-15 01:14:25 +03:00 committed by Alexandre Julliard
parent 6fd4f963f6
commit 6655b0c93a
1 changed files with 2 additions and 2 deletions

View File

@ -1435,10 +1435,10 @@ static UINT32 collection_find_family(struct dwrite_fontcollection *collection, c
for (i = 0; i < collection->family_count; i++) {
IDWriteLocalizedStrings *family_name = collection->family_data[i]->familyname;
UINT32 j, count = IDWriteLocalizedStrings_GetCount(family_name);
HRESULT hr;
int j;
for (j = 0; j < IDWriteLocalizedStrings_GetCount(family_name); j++) {
for (j = 0; j < count; j++) {
WCHAR buffer[255];
hr = IDWriteLocalizedStrings_GetString(family_name, j, buffer, 255);
if (SUCCEEDED(hr) && !strcmpiW(buffer, name))