forked from qt-creator/qt-creator
Editor: Avoid using private text document handle.
Task-number: QTCREATORBUG-15238 Change-Id: I6c7636ac4762c48c53767beaa97b0ce567f87dd1 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -92,8 +92,10 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end,
|
|||||||
selection.m_fg = fg;
|
selection.m_fg = fg;
|
||||||
selection.m_bg = bg;
|
selection.m_bg = bg;
|
||||||
|
|
||||||
selection.m_cursor_begin = QTextCursor(document->docHandle(), begin);
|
selection.m_cursor_begin = QTextCursor(document);
|
||||||
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
|
selection.m_cursor_begin.setPos(begin);
|
||||||
|
selection.m_cursor_end = QTextCursor(document);
|
||||||
|
selection.m_cursor_end.setPos(end);
|
||||||
|
|
||||||
if (overlaySelectionFlags & ExpandBegin)
|
if (overlaySelectionFlags & ExpandBegin)
|
||||||
selection.m_cursor_begin.setKeepPositionOnInsert(true);
|
selection.m_cursor_begin.setKeepPositionOnInsert(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user