From 0532c947587f246fda285253788e1fcbf5da1ef6 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 1 Feb 2016 15:28:38 +0100 Subject: Editor: Avoid using private text document handle. Task-number: QTCREATORBUG-15238 Change-Id: I6c7636ac4762c48c53767beaa97b0ce567f87dd1 Reviewed-by: hjk --- src/plugins/texteditor/texteditoroverlay.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins') 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); -- cgit v1.2.1