From 0c49838016ab77d596f53774d8432f9f4d6b1188 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 8 Sep 2010 21:01:21 +0200 Subject: Pulled some code from One long function into a short one Preparations for Application font support on Symbian Task-Number: QTBUG-6611 --- src/gui/text/qfontdatabase_s60.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 0b38aab..f9d8d31 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -99,6 +99,7 @@ public: ~QSymbianFontDatabaseExtrasImplementation(); const QSymbianTypeFaceExtras *extras(const QString &typeface, bool bold, bool italic) const; + void addFontFileToFontStore(const QFileInfo &fontFileInfo); #ifndef Q_SYMBIAN_HAS_FONTTABLE_API struct CFontFromFontStoreReleaser { @@ -150,11 +151,8 @@ QSymbianFontDatabaseExtrasImplementation::QSymbianFontDatabaseExtrasImplementati m_store->InstallRasterizerL(m_rasterizer); CleanupStack::Pop(m_rasterizer);); - foreach (const QFileInfo &fontFileInfo, fontFiles) { - const QString fontFile = QDir::toNativeSeparators(fontFileInfo.absoluteFilePath()); - TPtrC fontFilePtr(qt_QString2TPtrC(fontFile)); - QT_TRAP_THROWING(m_store->AddFileL(fontFilePtr)); - } + foreach (const QFileInfo &fontFileInfo, fontFiles) + addFontFileToFontStore(fontFileInfo); #endif // !Q_SYMBIAN_HAS_FONTTABLE_API } @@ -250,6 +248,14 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c } return m_extrasHash.value(searchKey); } + +void QSymbianFontDatabaseExtrasImplementation::addFontFileToFontStore(const QFileInfo &fontFileInfo) +{ + const QString fontFile = QDir::toNativeSeparators(fontFileInfo.absoluteFilePath()); + TPtrC fontFilePtr(qt_QString2TPtrC(fontFile)); + QT_TRAP_THROWING(m_store->AddFileL(fontFilePtr)); +} + #else // QT_NO_FREETYPE class QFontEngineFTS60 : public QFontEngineFT { -- cgit v0.12