qt5base-lts/tests/auto/gui
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
..
image Generalize image file name @2x suffix handling to higher scale factors 2019-06-14 13:08:56 +02:00
itemmodels Fix QSIM::itemData returning role 255 2018-09-06 11:51:28 +00:00
kernel QHighDPI: Fix broken scaling of QPoint(F) 2019-08-01 13:20:23 +02:00
math3d Use qRadiansToDegrees() and qDegreesToRadians() more widely 2017-07-05 10:15:34 +00:00
painting Fix assert/crash when creating QBrush with null QGradient 2019-04-01 11:56:42 +00:00
qopengl Fix OpenGL ES2 build on Linux 2019-02-15 12:58:12 +00:00
qopenglconfig Fix tst_QOpenGlConfig for platforms with builtin test data 2017-06-19 07:05:59 +00:00
qvulkan Merge remote-tracking branch 'origin/5.10' into dev 2017-10-17 10:34:24 +02:00
text Fix crash in QTextDocument::clearUndoRedoStacks() 2019-08-08 07:07:20 +02:00
util Only generate temporaries when it makes sense 2019-05-02 12:47:05 +00:00
gui.pro winrt: Skip/blacklist failing opengl tests 2018-05-28 08:36:55 +00:00