diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-05-19 10:40:03 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-05-20 08:22:13 (GMT) |
commit | d80949eee06ff464d58bd97a6c89bae7e961f3c8 (patch) | |
tree | 760e1ba774d2cfcd9da4e7d2bee6c776cd1f86ed /tests/auto/qtextlayout/tst_qtextlayout.cpp | |
parent | 29a6523dd8d3fac9be198c73153691c6dcdb3b21 (diff) | |
download | Qt-d80949eee06ff464d58bd97a6c89bae7e961f3c8.zip Qt-d80949eee06ff464d58bd97a6c89bae7e961f3c8.tar.gz Qt-d80949eee06ff464d58bd97a6c89bae7e961f3c8.tar.bz2 |
Fix ligature offset in multi-line text
Reviewed-by: Eskil
Diffstat (limited to 'tests/auto/qtextlayout/tst_qtextlayout.cpp')
-rw-r--r-- | tests/auto/qtextlayout/tst_qtextlayout.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index ad33b70..964679a 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -126,6 +126,7 @@ private slots: void textWidthWithStackedTextEngine(); void textWidthWithLineSeparator(); void textWithSurrogates_qtbug15679(); + void cursorInLigatureWithMultipleLines(); private: QFont testFont; @@ -1436,5 +1437,21 @@ void tst_QTextLayout::textWithSurrogates_qtbug15679() QCOMPARE(x[2] - x[0], x[5] - x[3]); } +void tst_QTextLayout::cursorInLigatureWithMultipleLines() +{ +#if !defined(Q_WS_MAC) + QSKIP("This test can only 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" |