Fix assertion introduced in 8e3fdf1354

It is clear from the commit itself that `m_engines[1]` isn't accessible
after `m_engines.resize(1)`.

Change-Id: I7b3977cca3f3aeaabadb5ff4f3e52a418022123c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
This commit is contained in:
Konstantin Ritt 2014-11-28 15:47:05 +04:00
parent 155f664ac2
commit 62bf16d992

View File

@ -1567,7 +1567,7 @@ QFontEngineMulti::QFontEngineMulti(QFontEngine *engine, int script, const QStrin
m_fallbackFamilies << QString();
}
m_engines.fill(0, m_fallbackFamilies.size() + 1);
m_engines.resize(m_fallbackFamilies.size() + 1);
engine->ref.ref();
m_engines[0] = engine;
@ -1601,15 +1601,15 @@ void QFontEngineMulti::setFallbackFamiliesList(const QStringList &fallbackFamili
Q_ASSERT(!m_fallbackFamiliesQueried);
m_fallbackFamilies = fallbackFamilies;
m_engines.resize(m_fallbackFamilies.size() + 1);
if (m_fallbackFamilies.isEmpty()) {
// turns out we lied about having any fallback at all
Q_ASSERT(m_engines.size() == 2); // see c-tor for details
QFontEngine *engine = m_engines.at(0);
engine->ref.ref();
m_engines[1] = engine;
m_fallbackFamilies << fontDef.family;
} else {
m_engines.resize(m_fallbackFamilies.size() + 1);
}
m_fallbackFamiliesQueried = true;