diff options
author | Nils Jeisecke <jeisecke@saltation.de> | 2009-05-12 12:47:49 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-13 15:19:49 (GMT) |
commit | e15d415acbd426e58fb1e967eb331fe41488dfff (patch) | |
tree | 848a5a3fcdaee0a0fa1f1a1ccf1a3dc4a9a1afe0 /tests | |
parent | f629c9caddb7ca921ad5af1c8607e059c30e39b0 (diff) | |
download | Qt-e15d415acbd426e58fb1e967eb331fe41488dfff.zip Qt-e15d415acbd426e58fb1e967eb331fe41488dfff.tar.gz Qt-e15d415acbd426e58fb1e967eb331fe41488dfff.tar.bz2 |
Added QTextListFormat::ListUpperRoman and QTextListFormat::ListLowerRoman for roman numbering of lists as supported by HTML/ODF
Reviewed-by: Olivier Goffart
Merge-request: 681
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtextlist/tst_qtextlist.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/qtextlist/tst_qtextlist.cpp b/tests/auto/qtextlist/tst_qtextlist.cpp index 658b8bb..e41d3be 100644 --- a/tests/auto/qtextlist/tst_qtextlist.cpp +++ b/tests/auto/qtextlist/tst_qtextlist.cpp @@ -67,6 +67,8 @@ private slots: void item(); void autoNumbering(); void autoNumberingRTL(); + void romanNumbering(); + void romanNumberingLimit(); void formatChange(); void cursorNavigation(); void partialRemoval(); @@ -142,6 +144,40 @@ void tst_QTextList::autoNumberingRTL() QVERIFY(cursor.currentList()->itemText(cursor.block()) == ".B"); } +void tst_QTextList::romanNumbering() +{ + QTextListFormat fmt; + fmt.setStyle(QTextListFormat::ListUpperRoman); + QTextList *list = cursor.createList(fmt); + QVERIFY(list); + + for (int i = 0; i < 4998; ++i) + cursor.insertBlock(); + + QVERIFY(list->count() == 4999); + + QVERIFY(cursor.currentList()); + QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 4998); + QVERIFY(cursor.currentList()->itemText(cursor.block()) == "MMMMCMXCIX."); +} + +void tst_QTextList::romanNumberingLimit() +{ + QTextListFormat fmt; + fmt.setStyle(QTextListFormat::ListLowerRoman); + QTextList *list = cursor.createList(fmt); + QVERIFY(list); + + for (int i = 0; i < 4999; ++i) + cursor.insertBlock(); + + QVERIFY(list->count() == 5000); + + QVERIFY(cursor.currentList()); + QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 4999); + QVERIFY(cursor.currentList()->itemText(cursor.block()) == "?."); +} + void tst_QTextList::formatChange() { // testing the formatChanged slot in QTextListManager |