20e8a01
diff -up qt-everywhere-opensource-src-4.8.1/src/gui/text/qtextlayout.cpp.QTBUG-24718 qt-everywhere-opensource-src-4.8.1/src/gui/text/qtextlayout.cpp
20e8a01
--- qt-everywhere-opensource-src-4.8.1/src/gui/text/qtextlayout.cpp.QTBUG-24718	2012-03-14 15:01:14.000000000 +0100
20e8a01
+++ qt-everywhere-opensource-src-4.8.1/src/gui/text/qtextlayout.cpp	2012-04-03 10:53:12.973058622 +0200
20e8a01
@@ -2508,6 +2508,10 @@ qreal QTextLine::cursorToX(int *cursorPo
20e8a01
     int pos = *cursorPos;
20e8a01
     int itm;
20e8a01
     const HB_CharAttributes *attributes = eng->attributes();
20e8a01
+    if (!attributes) {
20e8a01
+        *cursorPos = 0;
20e8a01
+        return x.toReal();
20e8a01
+    }
20e8a01
     while (pos < line.from + line.length && !attributes[pos].charStop)
20e8a01
         pos++;
20e8a01
     if (pos == line.from + (int)line.length) {