diff options
author | Liang Qi <liang.qi@qt.io> | 2019-08-12 13:23:11 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-08-12 13:23:11 +0200 |
commit | 44c393f9b61797a240bfcbff1364ecdf7af41787 (patch) | |
tree | 94cca729399f5df23cf904f7bd866397d84aac7c /src/gui/text/qtextdocument_p.cpp | |
parent | ffc2d5722317fcab86865b11491d7bf7fef3e16d (diff) | |
parent | e66f247ccf345f1d303a92e53c21bb53d96c5af2 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
config.tests/arch/write_info.pri
Repair architecture config test for the WASM_OBJECT_FILES=1 build mode
configure.pri
tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
Diffstat (limited to 'src/gui/text/qtextdocument_p.cpp')
-rw-r--r-- | src/gui/text/qtextdocument_p.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index c0a0c1a177..6e535c12b3 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -1103,12 +1103,11 @@ void QTextDocumentPrivate::clearUndoRedoStacks(QTextDocument::Stacks stacksToCle bool redoCommandsAvailable = undoState != undoStack.size(); if (stacksToClear == QTextDocument::UndoStack && undoCommandsAvailable) { for (int i = 0; i < undoState; ++i) { - QTextUndoCommand c = undoStack.at(undoState); + QTextUndoCommand c = undoStack.at(i); if (c.command & QTextUndoCommand::Custom) delete c.custom; } undoStack.remove(0, undoState); - undoStack.resize(undoStack.size() - undoState); undoState = 0; if (emitSignals) emitUndoAvailable(false); |