summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--src/gui/text/qtextobject.cpp7
-rw-r--r--src/gui/text/qtextobject.h2
-rw-r--r--src/s60installs/eabi/QtGuiu.def1
-rw-r--r--tests/auto/qtextblock/tst_qtextblock.cpp12
4 files changed, 2 insertions, 20 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; }
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 799ac43..fafa07b 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12183,5 +12183,4 @@ EXPORTS
_ZN15QGraphicsSystem22releaseCachedResourcesEv @ 12182 NONAME
_Z32qt_s60_setPartialScreenInputModeb @ 12183 NONAME
_Z29qt_draw_decoration_for_glyphsP8QPainterPKjPK11QFixedPointiP11QFontEngineRK5QFontRK15QTextCharFormat @ 12184 NONAME
- _ZNK10QTextBlock7isValidEv @ 12185 NONAME
diff --git a/tests/auto/qtextblock/tst_qtextblock.cpp b/tests/auto/qtextblock/tst_qtextblock.cpp
index 748d921..cec3a6a 100644
--- a/tests/auto/qtextblock/tst_qtextblock.cpp
+++ b/tests/auto/qtextblock/tst_qtextblock.cpp
@@ -76,7 +76,6 @@ private slots:
void excludeParagraphSeparatorFragment();
void backwardsBlockIterator();
void previousBlock_qtbug18026();
- void removedBlock_qtbug18500();
private:
QTextDocument *doc;
@@ -182,16 +181,5 @@ void tst_QTextBlock::previousBlock_qtbug18026()
QVERIFY(last.isValid());
}
-void tst_QTextBlock::removedBlock_qtbug18500()
-{
- cursor.insertText("line 1\nline 2\nline 3 \nline 4\n");
- cursor.setPosition(7);
- QTextBlock block = cursor.block();
- cursor.setPosition(21, QTextCursor::KeepAnchor);
-
- cursor.removeSelectedText();
- QVERIFY(!block.isValid());
-}
-
QTEST_MAIN(tst_QTextBlock)
#include "tst_qtextblock.moc"