summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextobject.cpp
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-03-10 16:17:14 +0100
committerJiang Jiang <jiang.jiang@nokia.com>2011-03-10 16:42:15 +0100
commit1b326932d48c0e584f9d5173fa5f892c5086fee8 (patch)
tree6963f0261f22684ad7c793f8c6cd8cc7401513cd /src/gui/text/qtextobject.cpp
parent09ff8924d5d05b285d9ed6a03817bdf271b6b108 (diff)
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/gui/text/qtextobject.cpp')
-rw-r--r--src/gui/text/qtextobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index e323fd0f64..94f2fc7184 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));