summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-11 22:20:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-11 22:20:56 (GMT)
commitc633ce4346fa04584e5168b77924ca6a42601435 (patch)
tree8018d801c34a4c5fe763fbea7556aa694ebdc5f8
parent163b383404f25f5e951959a8d5056124567ef183 (diff)
parent29d4342b2f87183e4bd4c2611aea157834c0f492 (diff)
downloadQt-c633ce4346fa04584e5168b77924ca6a42601435.zip
Qt-c633ce4346fa04584e5168b77924ca6a42601435.tar.gz
Qt-c633ce4346fa04584e5168b77924ca6a42601435.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1: Fixed cleaning of both undo- and redo-stacks.
-rw-r--r--src/gui/text/qtextdocument_p.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index e2fdf0e..969d5b4 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -259,8 +259,7 @@ void QTextDocumentPrivate::clear()
objects.clear();
title.clear();
- undoState = 0;
- clearUndoRedoStacks(QTextDocument::RedoStack);
+ clearUndoRedoStacks(QTextDocument::UndoAndRedoStacks);
text = QString();
unreachableCharacterCount = 0;
modifiedState = 0;
@@ -1077,7 +1076,7 @@ void QTextDocumentPrivate::clearUndoRedoStacks(QTextDocument::Stacks stacksToCle
if (emitSignals)
emitRedoAvailable(false);
} else if (stacksToClear == QTextDocument::UndoAndRedoStacks
- && (undoCommandsAvailable || redoCommandsAvailable)) {
+ && !undoStack.isEmpty()) {
for (int i = 0; i < undoStack.size(); ++i) {
QTextUndoCommand c = undoStack[i];
if (c.command & QTextUndoCommand::Custom)