qt6-bb10/tests/auto/gui/text
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
..
qabstracttextdocumentlayout
qcssparser Remove references to obsolete platforms 2017-11-05 06:33:53 +00:00
qfont Android: tst_QFont: QEXPECT_FAIL a couple failing checks 2018-06-30 19:32:53 +00:00
qfontcache
qfontdatabase Merge remote-tracking branch 'origin/5.11' into dev 2018-07-17 10:19:22 +02:00
qfontmetrics Update usage of QFontMetrics::width() to new API 2017-12-08 15:06:32 +00:00
qglyphrun winrt: Fix/blacklist failing text related auto tests 2018-06-22 05:02:42 +00:00
qinputcontrol
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
qtextblock
qtextcursor Fix crash when detaching dangling QTextCursor 2018-09-27 06:51:37 +00:00
qtextdocument Android: QEXPECT_FAIL tst_QTextDocument::task240325 2018-07-04 14:32:23 +00:00
qtextdocumentfragment winrt: Fix/blacklist failing text related auto tests 2018-06-22 05:02:42 +00:00
qtextdocumentlayout winrt: Fix/blacklist failing text related auto tests 2018-06-22 05:02:42 +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
qzip
text.pro