Make sure layoutData exist before checking for string direction
authorJiang Jiang <jiang.jiang@nokia.com>
Wed, 27 Apr 2011 06:47:46 +0000 (08:47 +0200)
committerJiang Jiang <jiang.jiang@nokia.com>
Fri, 29 Apr 2011 09:02:24 +0000 (11:02 +0200)
Otherwise accessing that through QTextEngine::alignLine may cause crash.

Reviewed-by: Samuel Rødal
(cherry picked from commit dcdb62c3d1a76d951c4b65bc1b1bd930e2ad14ec)

src/gui/text/qtextengine.cpp

index ce012a8..cc150c5 100644 (file)
@@ -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;