Avoid crash when getting bearings from fallback font engine

When accessing a fallback engine, we always need to call
ensureEngineAt() to make sure it's loaded.

Change-Id: Ib27e34137cfe8a3dd2b358aef3b3296a4ca52478
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2012-07-13 14:17:26 +02:00 committed by Qt by Nokia
parent 6f540691c4
commit 28826fe463

View File

@ -1489,6 +1489,7 @@ glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs)
void QFontEngineMulti::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
{
int which = highByte(glyph);
ensureEngineAt(which);
engine(which)->getGlyphBearings(stripped(glyph), leftBearing, rightBearing);
}