bug 486624 - AppendFacesFromFontFile is called twice for the same font file r=blassey, vlad

This commit is contained in:
Hiroyuki Ikezoe 2009-04-13 22:49:06 -04:00
parent d92725cd1e
commit 36a0869dc8

View File

@ -280,10 +280,8 @@ void
gfxWindowsPlatform::FindFonts()
{
nsTArray<nsString> searchPaths(2);
nsTArray<nsString> fontPatterns(4);
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.TTF"));
nsTArray<nsString> fontPatterns(2);
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.ttf"));
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.OTF"));
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.otf"));
wchar_t pathBuf[256];
SHGetSpecialFolderPathW(0, pathBuf, CSIDL_WINDOWS, 0);
@ -296,7 +294,12 @@ gfxWindowsPlatform::FindFonts()
for (PRUint32 j = 0; j < fontPatterns.Length(); j++) {
nsAutoString pattern(path);
pattern.Append(fontPatterns[j]);
HANDLE handle = FindFirstFileW(pattern.get(), &results);
HANDLE handle = FindFirstFileExW(pattern.get(),
FindExInfoStandard,
&results,
FindExSearchNameMatch,
NULL,
0);
PRBool moreFiles = handle != INVALID_HANDLE_VALUE;
while (moreFiles) {
nsAutoString filePath(path);