diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-03-10 15:17:14 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-03-10 15:42:15 (GMT) |
commit | 1b326932d48c0e584f9d5173fa5f892c5086fee8 (patch) | |
tree | 6963f0261f22684ad7c793f8c6cd8cc7401513cd /tests | |
parent | 09ff8924d5d05b285d9ed6a03817bdf271b6b108 (diff) | |
download | Qt-1b326932d48c0e584f9d5173fa5f892c5086fee8.zip Qt-1b326932d48c0e584f9d5173fa5f892c5086fee8.tar.gz Qt-1b326932d48c0e584f9d5173fa5f892c5086fee8.tar.bz2 |
Not requiring valid QTextBlock in previous()
Commit 64852122ba7 introduced a regression in QTextBlock::previous(),
programs that do doc.end().previous() will not be able to retrieve
the last valid block. Revert this change so that we can keep the
behavior consistent with previous versions.
Task-number: QTBUG-18026
Reviewed-by: Eskil
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtextblock/tst_qtextblock.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qtextblock/tst_qtextblock.cpp b/tests/auto/qtextblock/tst_qtextblock.cpp index 7b41874..cec3a6a 100644 --- a/tests/auto/qtextblock/tst_qtextblock.cpp +++ b/tests/auto/qtextblock/tst_qtextblock.cpp @@ -75,6 +75,7 @@ private slots: void fragmentOverBlockBoundaries(); void excludeParagraphSeparatorFragment(); void backwardsBlockIterator(); + void previousBlock_qtbug18026(); private: QTextDocument *doc; @@ -174,5 +175,11 @@ void tst_QTextBlock::backwardsBlockIterator() QCOMPARE(it.fragment().position(), 0); } +void tst_QTextBlock::previousBlock_qtbug18026() +{ + QTextBlock last = doc->end().previous(); + QVERIFY(last.isValid()); +} + QTEST_MAIN(tst_QTextBlock) #include "tst_qtextblock.moc" |