diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-08-16 06:00:17 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-08-16 06:00:17 (GMT) |
commit | 1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1 (patch) | |
tree | 65b658582151aa9b47a6b9843463dddd032a8323 /tests | |
parent | ab90235dfa1874e5c70875ed9b68817e698a55b3 (diff) | |
parent | 35665053a56f7c74e45d65234630a130ba24a27a (diff) | |
download | Qt-1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1.zip Qt-1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1.tar.gz Qt-1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/gui/kernel/qwidget_s60.cpp
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtextcursor/tst_qtextcursor.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qtextcursor/tst_qtextcursor.cpp b/tests/auto/qtextcursor/tst_qtextcursor.cpp index 2b0ba42..cc3b1dc 100644 --- a/tests/auto/qtextcursor/tst_qtextcursor.cpp +++ b/tests/auto/qtextcursor/tst_qtextcursor.cpp @@ -50,6 +50,7 @@ #include <qabstracttextdocumentlayout.h> #include <qtextlayout.h> #include <qtextcursor.h> +#include <qtextobject.h> #include <qdebug.h> //TESTED_FILES=gui/text/qtextcursor.cpp gui/text/qtextcursor_p.h @@ -154,6 +155,8 @@ private slots: void cursorPositionWithBlockUndoAndRedo2(); void cursorPositionWithBlockUndoAndRedo3(); + void joinNonEmptyRemovedBlockUserState(); + private: int blockCount(); @@ -1858,5 +1861,20 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo3() QCOMPARE(cursor.position(), cursorPositionBefore); } +void tst_QTextCursor::joinNonEmptyRemovedBlockUserState() +{ + cursor.insertText("Hello"); + cursor.insertBlock(); + cursor.insertText("World"); + cursor.block().setUserState(10); + + cursor.movePosition(QTextCursor::EndOfBlock); + cursor.movePosition(QTextCursor::PreviousBlock, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); + cursor.removeSelectedText(); + + QCOMPARE(cursor.block().userState(), 10); +} + QTEST_MAIN(tst_QTextCursor) #include "tst_qtextcursor.moc" |