qt5base-lts/tests/auto/gui
Eskil Abrahamsen Blomfeldt 720e243d88 Fix crash when detaching dangling QTextCursor
When a QTextCursor survives its QTextDocument, the internal
QTextDocumentPrivate pointer is set to null. There are checks for
this in all the QTextCursor functions to skip out early if such
a QTextCursor is used.

However, when executing the "if (d->priv)" condition in setters,
this will access the non-const operator->() of QSharedDataPointer
and detach the QTextCursorPrivate, and in the copy constructor of
this class, there was an unprotected call into priv->addCursor().

In theory, we could cast all the checks for d->priv to avoid
detaching, but in practice this doesn't matter, since the setters
will typically detach anyway later on.

[ChangeLog][QtGui][Text] Fixed a crash that can happen when calling
a setter on a QTextCursor after its QTextDocument has been deleted.

Task-number: QTBUG-70293
Change-Id: I8f6dc5bb344d1d824f673c0c220b68b7fee237a8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-27 06:51:37 +00:00
..
image Fix reading 16bpc grayscale PNGs 2018-09-03 08:24:10 +00:00
itemmodels Fix QSIM::itemData returning role 255 2018-09-06 11:51:28 +00:00
kernel Remove insignificant flag from qtouchevent.pro 2018-09-25 12:50:17 +00:00
math3d Use qRadiansToDegrees() and qDegreesToRadians() more widely 2017-07-05 10:15:34 +00:00
painting QPainter cosmetic stroker: Fix painting error for FlatCap lines 2018-09-25 12:32:24 +00:00
qopengl Implement support for 16bpc image formats 2018-08-11 14:12:48 +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 when detaching dangling QTextCursor 2018-09-27 06:51:37 +00:00
util Texture file support: add mipmap reading to ktx handler 2018-09-12 08:41:38 +00:00
gui.pro winrt: Skip/blacklist failing opengl tests 2018-05-28 08:36:55 +00:00