Fix crash when app font is added
authorJiang Jiang <jiang.jiang@nokia.com>
Fri, 8 Jul 2011 15:40:43 +0000 (17:40 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 14 Jul 2011 09:21:55 +0000 (11:21 +0200)
commit1080586abcce9ed0e3acb9e193dfcd568b01bc5c
tree4a53ebc6d40327c0cbae792358be4d133d43be58
parent042cffd601fd5b7e9ef176531893337a917cf455
Fix crash when app font is added

Loading app fonts will clear the application font cache, but
QFontPrivate::engineWithScript will try to load the font again,
in Mac the font engine used here must be the one used for shaping,
because subsequent sub font engines may be added to it during the
shaping process (QCoreTextFontEngineMulti::stringToCMap). That is
why we need to fetch the font engine directly from QTextEngine's
fontEngine cache instead of QFontCache.

Task-number: QTBUG-20250
Reviewed-by: Eskil
(cherry picked from commit 1f90ae36cff8acf581d1624bf011fe3a55c623c0)

Change-Id: Ibc0054cd7df65b65a67af4a7b15027731ba417fe
Reviewed-on: http://codereview.qt.nokia.com/1630
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
src/gui/text/qtextengine.cpp
src/gui/text/qtextengine_p.h
src/gui/text/qtextlayout.cpp