summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-10-04 10:28:16 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-07 14:00:57 +0200
commitb1bd4021f361b404a9c087622f71006f897d7e52 (patch)
treeefb0b78678a84b8f4939f7f96d0258893a2e9be3 /src
parent2cfca47d568502a5d10c07caf60b38cc505d3f5e (diff)
Fallback to the original application font handling
When Qt is built for 10.8 but then used on a machine before 10.8 then it was not falling back correctly when an application font was added. Change-Id: I0f05226cdbcfa36621bb1b3aa2f2cd60e714dfdf Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm15
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h3
2 files changed, 8 insertions, 10 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 0032dc2aff..72486c097d 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -517,8 +517,9 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData
CFRelease(font);
return families;
}
- } else {
-#else
+ } else
+#endif
+ {
ATSFontContainerRef fontContainer;
OSStatus e;
@@ -557,10 +558,7 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData
m_applicationFonts.append(fontContainer);
return families;
}
-#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
}
-#endif
return QStringList();
}
@@ -600,13 +598,14 @@ void QCoreTextFontDatabase::removeApplicationFonts()
for (int i = 0; i < m_applicationURLFonts.count(); ++i)
CTFontManagerUnregisterFontsForURL(m_applicationURLFonts[i], kCTFontManagerScopeProcess, &error);
m_applicationURLFonts.clear();
- }
-#else
+ } else
+#endif
+ {
for (int i = 0; i < m_applicationFonts.count(); ++i)
ATSFontDeactivate(m_applicationFonts[i], 0, kATSOptionFlagsDoNotNotify);
m_applicationFonts.clear();
ATSFontNotify(kATSFontNotifyActionFontsChanged, 0);
-#endif
+ }
#endif
}
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index c3bb4d428a..ee1016509b 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -82,9 +82,8 @@ private:
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
QVector<QCFType<CGFontRef> > m_applicationGraphicsFonts;
QVector<QCFType<CFURLRef> > m_applicationURLFonts;
-#else
- QVector<ATSFontContainerRef> m_applicationFonts;
#endif
+ QVector<ATSFontContainerRef> m_applicationFonts;
#endif
};