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:
@@ -104,19 +104,18 @@ public:
|
||||
|
||||
// Open file
|
||||
TextEditor::BaseTextEditor *editor = TextEditor::PlainTextEditorFactory::createPlainTextEditor();
|
||||
TextEditor::BaseTextEditorWidget *editorWidget = editor->editorWidget();
|
||||
QString error;
|
||||
editor->open(&error, document->fileName(), document->fileName());
|
||||
QVERIFY(error.isEmpty());
|
||||
|
||||
// Set cursor position
|
||||
QTextCursor cursor = editorWidget->textCursor();
|
||||
QTextCursor cursor = editor->textCursor();
|
||||
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, cursorPosition);
|
||||
editorWidget->setTextCursor(cursor);
|
||||
editor->setTextCursor(cursor);
|
||||
|
||||
QTextDocument *qtextDocument = editorWidget->document();
|
||||
QTextDocument *qtextDocument = editor->qdocument();
|
||||
CppRefactoringFilePtr cppRefactoringFile
|
||||
= CppRefactoringChanges::file(editorWidget, document);
|
||||
= CppRefactoringChanges::file(editor->editorWidget(), document);
|
||||
|
||||
// Prepare for formatting
|
||||
Overview overview;
|
||||
|
||||
Reference in New Issue
Block a user