From: Jiang Jiang Date: Wed, 27 Apr 2011 06:47:46 +0000 (+0200) Subject: Make sure layoutData exist before checking for string direction X-Git-Tag: qt-v5.0.0-alpha1~4352^2~9^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d64460fffb488eb2e7b90df58d3891338bad7948;p=profile%2Fivi%2Fqtbase.git Make sure layoutData exist before checking for string direction Otherwise accessing that through QTextEngine::alignLine may cause crash. Reviewed-by: Samuel Rødal (cherry picked from commit dcdb62c3d1a76d951c4b65bc1b1bd930e2ad14ec) --- diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index ce012a8..cc150c5 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1598,6 +1598,8 @@ bool QTextEngine::isRightToLeft() const default: break; } + if (!layoutData) + itemize(); // this places the cursor in the right position depending on the keyboard layout if (layoutData->string.isEmpty()) return QApplication::keyboardInputDirection() == Qt::RightToLeft;