dwrite: Call GetCount() once when looking for family name.
This commit is contained in:
parent
6fd4f963f6
commit
6655b0c93a
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue