diff options
author | David Schulz <david.schulz@theqtcompany.com> | 2016-02-01 15:28:38 +0100 |
---|---|---|
committer | David Schulz <david.schulz@theqtcompany.com> | 2016-02-02 07:10:00 +0000 |
commit | 0532c947587f246fda285253788e1fcbf5da1ef6 (patch) | |
tree | 20619b056fb9b878827ace319c54b918383bf448 /src/plugins | |
parent | e432c715dd6b17787eb8c1a24078c3ed751441a1 (diff) | |
download | qt-creator-0532c947587f246fda285253788e1fcbf5da1ef6.tar.gz |
Editor: Avoid using private text document handle.
Task-number: QTCREATORBUG-15238
Change-Id: I6c7636ac4762c48c53767beaa97b0ce567f87dd1
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/texteditor/texteditoroverlay.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 025b320638..e7f41f0d12 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -92,8 +92,10 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end, selection.m_fg = fg; selection.m_bg = bg; - selection.m_cursor_begin = QTextCursor(document->docHandle(), begin); - selection.m_cursor_end = QTextCursor(document->docHandle(), end); + selection.m_cursor_begin = QTextCursor(document); + selection.m_cursor_begin.setPos(begin); + selection.m_cursor_end = QTextCursor(document); + selection.m_cursor_end.setPos(end); if (overlaySelectionFlags & ExpandBegin) selection.m_cursor_begin.setKeepPositionOnInsert(true); |