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 /src | |
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 'src')
-rw-r--r-- | src/gui/text/qtextobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index e323fd0..94f2fc7 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -1504,7 +1504,7 @@ QTextBlock QTextBlock::next() const */ QTextBlock QTextBlock::previous() const { - if (!isValid()) + if (!p) return QTextBlock(); return QTextBlock(p, p->blockMap().previous(n)); |