qt6-bb10/tests/auto/gui/text
Eskil Abrahamsen Blomfeldt 79e0effead Fix crash in QTextDocument::clearUndoRedoStacks()
When calling QTextDocument::clearUndoRedoStacks() with UndoStack,
there were two bugs: The first was that we were retrieving
the item at "undoState" and deleting this. This is actually the
upper limit of the for loop. If the stack does not contain any
redos, then it would be == undoStack.size() and we would assert.

If there were redos, then we would delete the item at undoState
multiple times (actually undoState times).

In addition, when the loop exited, we first removed the dangling
pointers using remove() and then there was a weird resize() to
the new size minus the old undoState.

This would either assert because we tried to resize to a negative
number, or it would arbitrarily remove items from the stack.

[ChangeLog][QtGui][Text] Fixed a crash bug in
QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack).

Task-number: QTBUG-69546
Change-Id: I8a93e828ec27970763a2756071fa0b01678d2dcd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-08-08 07:07:20 +02:00
..
qabstracttextdocumentlayout
qcssparser QCss: properly parse functions which contains additional spaces 2018-10-12 22:01:14 +00:00
qfont Android: tst_QFont: QEXPECT_FAIL a couple failing checks 2018-06-30 19:32:53 +00:00
qfontcache
qfontdatabase winrt: Return monospace font for QFontDatabase::systemFont(QFontDatabase::FixedFont) 2019-05-15 18:08:01 +00:00
qfontmetrics Fix text shifting vertically when elided 2018-12-21 10:27:12 +00:00
qglyphrun winrt: Fix/blacklist failing text related auto tests 2018-06-22 05:02:42 +00:00
qinputcontrol Accept all formatting characters as valid input 2017-01-26 10:59:49 +00:00
qrawfont Android: QEXPECT_FAIL in tst_QRawFont::fallbackFontsOrder 2018-06-30 19:32:56 +00:00
qstatictext Merge remote-tracking branch 'origin/5.11' into dev 2018-07-17 10:19:22 +02:00
qsyntaxhighlighter tst_qsyntaxhighlighter: fix no-op QTRY_VERIFY check 2019-01-16 14:23:42 +00:00
qtextblock
qtextcursor Fix crash when detaching dangling QTextCursor 2018-09-27 06:51:37 +00:00
qtextdocument Fix crash in QTextDocument::clearUndoRedoStacks() 2019-08-08 07:07:20 +02:00
qtextdocumentfragment QTextDocument: Do respect white-space:nowrap 2019-02-13 08:14:47 +00:00
qtextdocumentlayout Fix page breaking with large images 2019-04-26 18:21:18 +00:00
qtextformat Update font when text format's letter spacing type is changed 2017-12-22 05:37:55 +00:00
qtextlayout Fix potential crash when showing line/paragraph separators 2018-08-09 12:46:22 +00:00
qtextlist
qtextobject
qtextodfwriter Add more formatting to QTextDocumentWriter when writing ODF files 2018-04-11 18:44:31 +00:00
qtextpiecetable Change almost all other uses of qrand() to QRandomGenerator 2017-11-08 09:14:03 +00:00
qtextscriptengine qtbase: Remove BLACKLIST files which are no longer active 2018-02-12 17:40:12 +00:00
qtexttable Fix QTextTable:insertRows() for tables with spanning cells 2019-02-09 08:01:08 +00:00
qzip
text.pro Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00