summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextlayout
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-05-20 10:26:54 +0200
committerQt Continuous Integration System <qt-info@nokia.com>2011-05-27 17:17:08 +0200
commit37f20ea8e64afa2d29d9fb56ac34ff405367a2b8 (patch)
treefcc136234369c34153bddd6961ddd4be4148b0b7 /tests/auto/qtextlayout
parent93339428c040a2576e4e0da315b1a6a4e4c1916f (diff)
Fix ligature offset in multi-line text
Reviewed-by: Eskil (cherry picked from commit 278cf1f37945050c4a46d5acab0659f3a7546a43) Change-Id: Ice20aa38a49ea16cf56bd3705c7d400ee165a9c2 Reviewed-on: http://codereview.qt.nokia.com/195 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'tests/auto/qtextlayout')
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index b6adc2b8a0..be0a83fe38 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -127,6 +127,7 @@ private slots:
void textWithSurrogates_qtbug15679();
void textWidthWithStackedTextEngine();
void textWidthWithLineSeparator();
+ void cursorInLigatureWithMultipleLines();
private:
QFont testFont;
@@ -1460,5 +1461,21 @@ void tst_QTextLayout::textWidthWithLineSeparator()
QCOMPARE(line1.naturalTextWidth(), line2.naturalTextWidth());
}
+void tst_QTextLayout::cursorInLigatureWithMultipleLines()
+{
+#if !defined(Q_WS_MAC)
+ QSKIP("This test can not be run on Mac", SkipAll);
+#endif
+ QTextLayout layout("first line finish", QFont("Times", 20));
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ line.setLineWidth(70);
+ line = layout.createLine();
+ layout.endLayout();
+
+ // The second line will be "finish", with "fi" as a ligature
+ QVERIFY(line.cursorToX(0) != line.cursorToX(1));
+}
+
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"