diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-04-27 08:47:46 +0200 |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-04-29 11:02:24 +0200 |
commit | d64460fffb488eb2e7b90df58d3891338bad7948 (patch) | |
tree | d6860acbef0a09fabae2f8c7b98615578a32b044 /src | |
parent | 044e7602ae72889f363d688dbe0d73cec5f0636a (diff) |
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index ce012a818f..cc150c5965 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; |