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)
This commit is contained in:
Jiang Jiang 2011-04-27 08:47:46 +02:00
parent 044e7602ae
commit d64460fffb

View 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;