Fix possible assert in QFontEngineFT
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Mon, 26 Sep 2011 12:34:15 +0000 (14:34 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 26 Sep 2011 14:05:36 +0000 (16:05 +0200)
This is a regression caused by 070d9c00. If the defaultFormat
is set to Format_None, we should default to Format_A8 like before
the change.

Change-Id: I8ad07abff96fc1dfa03c0c5b49d13beb36b9de70
Reviewed-on: http://codereview.qt-project.org/5540
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
src/gui/text/qfontengine_ft.cpp

index 6c351c0..1ce7302 100644 (file)
@@ -1810,8 +1810,10 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe
 
     if (isBitmapFont())
         neededFormat = Format_Mono;
-    else if (neededFormat == Format_None)
+    else if (neededFormat == Format_None && defaultFormat != Format_None)
         neededFormat = defaultFormat;
+    else if (neededFormat == Format_None)
+        neededFormat = Format_A8;
 
     QFontEngineFT::QGlyphSet *gset = defaultGlyphs();
     if (t.type() >= QTransform::TxScale) {