diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-11-27 08:40:55 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-11-27 08:41:33 +0100 |
commit | d3814e51bb1c19aa868566aea5d4edd19d2e3944 (patch) | |
tree | 1d7606bd0cb1167cecc733141998a2d0cca918d7 /src/gui/text | |
parent | 719ad1db552319529bb5978fabbae1af9a06c240 (diff) | |
parent | 2260d680c935eae0e989beb2040a01040f66a5fa (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I5bdfe94f7eec1ba328c4a4b54d12dbc0da7fc3ac
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextdocument_p.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextdocument_p.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index a1b1c2e92b..2f02f62a57 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -243,7 +243,7 @@ void QTextDocumentPrivate::clear() curs->adjusted_anchor = 0; } - QList<QTextCursorPrivate *>oldCursors = cursors; + QSet<QTextCursorPrivate *> oldCursors = cursors; QT_TRY{ cursors.clear(); diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index f4e7a25f22..94c67b3264 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -277,8 +277,8 @@ private: public: void documentChange(int from, int length); - inline void addCursor(QTextCursorPrivate *c) { cursors.append(c); } - inline void removeCursor(QTextCursorPrivate *c) { cursors.removeAll(c); } + inline void addCursor(QTextCursorPrivate *c) { cursors.insert(c); } + inline void removeCursor(QTextCursorPrivate *c) { cursors.remove(c); } QTextFrame *frameAt(int pos) const; QTextFrame *rootFrame() const; @@ -330,7 +330,7 @@ private: BlockMap blocks; int initialBlockCharFormatIndex; - QList<QTextCursorPrivate *> cursors; + QSet<QTextCursorPrivate *> cursors; QMap<int, QTextObject *> objects; QMap<QUrl, QVariant> resources; QMap<QUrl, QVariant> cachedResources; |