QFontEngine: Avoid nesting multi-fontengines.

In case the platform plugin returns an instance of QFontEngineMulti
(which happens on Windows).

Change-Id: I87470e47cfe113557313b7f6b3b09d1455af1c17
Reviewed-on: http://codereview.qt.nokia.com/3319
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-08-22 14:53:59 +02:00 committed by Samuel Rødal
parent 1bf7fc2f1a
commit 889190cfc3
2 changed files with 3 additions and 1 deletions

View File

@ -156,7 +156,7 @@ QFontEngine *loadEngine(int script, const QFontDef &request,
QFontEngine *engine = loadSingleEngine(script, request, foundry, style, size); QFontEngine *engine = loadSingleEngine(script, request, foundry, style, size);
//make sure that the db has all fallback families //make sure that the db has all fallback families
if (engine if (engine && engine->type() != QFontEngine::Multi
&& !(request.styleStrategy & QFont::NoFontMerging) && !engine->symbol ) { && !(request.styleStrategy & QFont::NoFontMerging) && !engine->symbol ) {
if (family && !family->askedForFallback) { if (family && !family->askedForFallback) {

View File

@ -666,9 +666,11 @@ QFontEngineMultiQPA::QFontEngineMultiQPA(QFontEngine *fe, int _script, const QSt
: QFontEngineMulti(fallbacks.size() + 1), : QFontEngineMulti(fallbacks.size() + 1),
fallbackFamilies(fallbacks), script(_script) fallbackFamilies(fallbacks), script(_script)
{ {
Q_ASSERT(fe && fe->type() != QFontEngine::Multi);
engines[0] = fe; engines[0] = fe;
fe->ref.ref(); fe->ref.ref();
fontDef = engines[0]->fontDef; fontDef = engines[0]->fontDef;
setObjectName(QStringLiteral("QFontEngineMultiQPA"));
} }
void QFontEngineMultiQPA::loadEngine(int at) void QFontEngineMultiQPA::loadEngine(int at)