forked from qt-creator/qt-creator
TextEditor: Introduce some convenience text accessors in the editor
And adjust users. Change-Id: I9329257cfa5f3298731deb07c2881bc37d9a051d Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -442,11 +442,10 @@ bool BaseTextDocument::save(QString *errorString, const QString &saveFileName, b
|
||||
|
||||
// When saving the current editor, make sure to maintain the cursor and scroll bar
|
||||
// positions for undo
|
||||
IEditor *currentEditor = EditorManager::currentEditor();
|
||||
if (BaseTextEditor *editable = qobject_cast<BaseTextEditor*>(currentEditor)) {
|
||||
if (editable->document() == this) {
|
||||
editorWidget = editable->editorWidget();
|
||||
QTextCursor cur = editorWidget->textCursor();
|
||||
if (BaseTextEditor *editor = BaseTextEditor::currentTextEditor()) {
|
||||
if (editor->document() == this) {
|
||||
editorWidget = editor->editorWidget();
|
||||
QTextCursor cur = editor->textCursor();
|
||||
savedPosition = cur.position();
|
||||
savedAnchor = cur.anchor();
|
||||
savedVScrollBarValue = editorWidget->verticalScrollBar()->value();
|
||||
|
||||
Reference in New Issue
Block a user