refactor rename selections

the new approach makes it possible to use more edit features
inside the rename selection like cut/copy/paste. Furthermore
it compresses rename operations better on the undo stack.
This commit is contained in:
mae
2009-12-03 18:35:36 +01:00
parent 48a555d789
commit 480c9a5bf4
5 changed files with 129 additions and 55 deletions

View File

@@ -83,11 +83,8 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end,
selection.m_fg = fg;
selection.m_bg = bg;
selection.m_cursor_begin = QTextCursor(document);
selection.m_cursor_begin.setPosition(begin);
selection.m_cursor_end = QTextCursor(document);
selection.m_cursor_end.setPosition(end);
selection.m_cursor_begin = QTextCursor(document->docHandle(), begin);
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
if (lockSize)
selection.m_fixedLength = (end - begin);