From ebaae9e6a8694d6be4ec5c353a98d532e133245a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Mon, 27 Jul 2009 12:27:09 +0200 Subject: 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 --- src/gui/text/qfontengine_mac.mm | 7 +++++-- 1 file 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; } -- cgit v0.12