summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-04-29 14:46:33 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-04-29 14:54:34 (GMT)
commit78821cd51c69757a7b4e711c495e702adf97d682 (patch)
tree4cab76ba9f2a522af156280de7e01c27018478c4 /src/gui
parent1de8a46d1e11a5fe0eec80ada7592b0f16c17d06 (diff)
downloadQt-78821cd51c69757a7b4e711c495e702adf97d682.zip
Qt-78821cd51c69757a7b4e711c495e702adf97d682.tar.gz
Qt-78821cd51c69757a7b4e711c495e702adf97d682.tar.bz2
Revert symbol addition in b033bb9
Because it breaks forward compatibility. We will use the original fix in 4.8. In 4.7 we just make sure it doesn't crash in QTextBlock::next(). Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextobject.cpp7
-rw-r--r--src/gui/text/qtextobject.h2
2 files changed, 2 insertions, 7 deletions
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index a403cc5..2a93f67 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -891,11 +891,6 @@ QTextBlockUserData::~QTextBlockUserData()
Returns true if this text block is valid; otherwise returns false.
*/
-bool QTextBlock::isValid() const
-{
- return p != 0 && p->blockMap().isValid(n);
-}
-
/*!
\fn QTextBlock &QTextBlock::operator=(const QTextBlock &other)
@@ -1493,7 +1488,7 @@ QTextBlock::iterator QTextBlock::end() const
*/
QTextBlock QTextBlock::next() const
{
- if (!isValid())
+ if (!isValid() || !p->blockMap().isValid(n))
return QTextBlock();
return QTextBlock(p, p->blockMap().next(n));
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index 73aed79..d5c1e8d 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -204,7 +204,7 @@ public:
inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {}
inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; }
- bool isValid() const;
+ inline bool isValid() const { return p != 0 && n != 0; }
inline bool operator==(const QTextBlock &o) const { return p == o.p && n == o.n; }
inline bool operator!=(const QTextBlock &o) const { return p != o.p || n != o.n; }