forked from qt-creator/qt-creator
TextEditor: Replace PlainTextEditorWidget by Base + a setup function
Change-Id: I91a3bfb66a72e9234ca59f97d5260bbfc3ccb0d3 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -100,20 +100,20 @@ public:
|
||||
QVERIFY(ast);
|
||||
|
||||
// Open file
|
||||
QScopedPointer<TextEditor::BaseTextEditorWidget> editorWidget(
|
||||
new TextEditor::PlainTextEditorWidget(new TextEditor::PlainTextDocument));
|
||||
TextEditor::BaseTextEditorWidget editorWidget(new TextEditor::PlainTextDocument);
|
||||
editorWidget.setupAsPlainEditor();
|
||||
QString error;
|
||||
editorWidget->open(&error, document->fileName(), document->fileName());
|
||||
editorWidget.open(&error, document->fileName(), document->fileName());
|
||||
QVERIFY(error.isEmpty());
|
||||
|
||||
// Set cursor position
|
||||
QTextCursor cursor = editorWidget->textCursor();
|
||||
QTextCursor cursor = editorWidget.textCursor();
|
||||
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, cursorPosition);
|
||||
editorWidget->setTextCursor(cursor);
|
||||
editorWidget.setTextCursor(cursor);
|
||||
|
||||
QTextDocument *textDocument = editorWidget->document();
|
||||
QTextDocument *textDocument = editorWidget.document();
|
||||
CppRefactoringFilePtr cppRefactoringFile
|
||||
= CppRefactoringChanges::file(editorWidget.data(), document);
|
||||
= CppRefactoringChanges::file(&editorWidget, document);
|
||||
|
||||
// Prepare for formatting
|
||||
Overview overview;
|
||||
|
||||
Reference in New Issue
Block a user