From dcdb62c3d1a76d951c4b65bc1b1bd930e2ad14ec Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 27 Apr 2011 08:47:46 +0200 Subject: Make sure layoutData exist before checking for string direction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise accessing that through QTextEngine::alignLine may cause crash. Reviewed-by: Samuel Rødal --- src/gui/text/qtextengine.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v0.12