Improve code readability

Since we were requesting a multi font engine, the returned font engine
must be a multi one or nothing at all.

Change-Id: I1ee4e1b7c68f54c83a8c7292082d015ebfa0a8cb
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
This commit is contained in:
Konstantin Ritt 2014-03-07 01:51:21 +02:00 committed by The Qt Project
parent 8fdd11465c
commit 7ef5a8528e

View File

@ -731,10 +731,9 @@ QFontEngine* QFontEngineMultiQPA::createMultiFontEngine(QFontEngine *fe, int scr
QFontCache::EngineCache::Iterator it = fc->engineCache.find(key),
end = fc->engineCache.end();
while (it != end && it.key() == key) {
QFontEngineMulti *cachedEngine = 0;
if (it.value().data->type() == QFontEngine::Multi)
cachedEngine = static_cast<QFontEngineMulti *>(it.value().data);
if (faceIsLocal || (cachedEngine && fe == cachedEngine->engine(0))) {
Q_ASSERT(it.value().data->type() == QFontEngine::Multi);
QFontEngineMulti *cachedEngine = static_cast<QFontEngineMulti *>(it.value().data);
if (faceIsLocal || fe == cachedEngine->engine(0)) {
engine = cachedEngine;
fc->updateHitCountAndTimeStamp(it.value());
break;