Set supporting writingSystem correctly

Change-Id: I963aa7b69a48441619c5885c443ae2620fcc4e57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
This commit is contained in:
Jiang Jiang 2011-11-30 16:41:11 +01:00 committed by Qt by Nokia
parent 8f2da7cd63
commit f8725f2c8d

View File

@ -213,11 +213,12 @@ void QCoreTextFontDatabase::populateFontDatabase()
QSupportedWritingSystems writingSystems;
if (QCFType<CFArrayRef> languages = (CFArrayRef) CTFontDescriptorCopyAttribute(font, kCTFontLanguagesAttribute)) {
CFIndex length = CFArrayGetCount(languages);
for (int i = 1; i < LanguageCount; ++i) {
if (!languageForWritingSystem[i])
continue;
QCFString lang = CFStringCreateWithCString(NULL, languageForWritingSystem[i], kCFStringEncodingASCII);
if (CFArrayContainsValue(languages, CFRangeMake(0, 0), lang))
if (CFArrayContainsValue(languages, CFRangeMake(0, length), lang))
writingSystems.setSupported(QFontDatabase::WritingSystem(i));
}
}