summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Sørvig <msorvig@trolltech.com>2009-07-27 10:27:09 (GMT)
committerMorten Sørvig <msorvig@trolltech.com>2009-07-27 10:27:09 (GMT)
commitebaae9e6a8694d6be4ec5c353a98d532e133245a (patch)
treececaf0ebb97b9d4f4328ca5677dd301e026fd410 /src
parent5a7d29039917d9f0faf373045e8dbb274837c11d (diff)
downloadQt-ebaae9e6a8694d6be4ec5c353a98d532e133245a.zip
Qt-ebaae9e6a8694d6be4ec5c353a98d532e133245a.tar.gz
Qt-ebaae9e6a8694d6be4ec5c353a98d532e133245a.tar.bz2
Fix crash when printing to PDF on Qt/Mac
Priting to PDF would crash for applications built on Leopard when running on Tiger. Add the standard runtime version check to QFontEngineMac::faceId(). Task-number: 251791 Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qfontengine_mac.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 327df45..72e5175 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -1560,6 +1560,7 @@ QFontEngine::FaceId QFontEngineMac::faceId() const
{
FaceId ret;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
+if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
// CTFontGetPlatformFont
FSRef ref;
if (ATSFontGetFileReference(FMGetATSFontRefFromFont(fontID), &ref) != noErr)
@@ -1567,7 +1568,9 @@ QFontEngine::FaceId QFontEngineMac::faceId() const
ret.filename = QByteArray(128, 0);
ret.index = fontID;
FSRefMakePath(&ref, (UInt8 *)ret.filename.data(), ret.filename.size());
-#else
+}else
+#endif
+{
FSSpec spec;
if (ATSFontGetFileSpecification(FMGetATSFontRefFromFont(fontID), &spec) != noErr)
return ret;
@@ -1577,7 +1580,7 @@ QFontEngine::FaceId QFontEngineMac::faceId() const
ret.filename = QByteArray(128, 0);
ret.index = fontID;
FSRefMakePath(&ref, (UInt8 *)ret.filename.data(), ret.filename.size());
-#endif
+}
return ret;
}