From a16388c1f4ff3d6cb9863a9b16914f6ddb305c05 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 7 Jul 2010 10:33:40 +1000 Subject: Revert "Fix exponential behavior of QTextCursor::removeSelectedText" This reverts commit 62db6c18c7f1f60819783ed5e1340e9fc09e072e, which introduced a regression in tst_qtextpiecetable::checkDocumentChanged --- src/gui/text/qtextdocument_p.cpp | 7 ------- src/gui/text/qtextdocument_p.h | 1 - 2 files changed, 8 deletions(-) diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 9849317..9bcf8b4 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -205,7 +205,6 @@ QTextDocumentPrivate::QTextDocumentPrivate() undoEnabled = true; inContentsChange = false; - inRemove = false; defaultTextOption.setTabStop(80); // same as in qtextengine.cpp defaultTextOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); @@ -670,10 +669,7 @@ void QTextDocumentPrivate::remove(int pos, int length, QTextUndoCommand::Operati { if (length == 0) return; - inRemove = true; move(pos, -1, length, op); - inRemove = false; - adjustDocumentChangesAndCursors(pos, -length, op); } void QTextDocumentPrivate::setCharFormat(int pos, int length, const QTextCharFormat &newFormat, FormatChangeMode mode) @@ -1269,9 +1265,6 @@ void QTextDocumentPrivate::documentChange(int from, int length) */ void QTextDocumentPrivate::adjustDocumentChangesAndCursors(int from, int addedOrRemoved, QTextUndoCommand::Operation op) { - if (inRemove) // postpone, will be called again from QTextDocumentPrivate::remove() - return; - if (!editBlock) ++revision; diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index dcac99d..b9d5f5a 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -345,7 +345,6 @@ public: int maximumBlockCount; uint needsEnsureMaximumBlockCount : 1; uint inContentsChange : 1; - uint inRemove : 1; QSizeF pageSize; QString title; QString url; -- cgit v0.12