Use document instead of widget in TextEditor::RefactoringChangesData

Change-Id: I938041c9774fbebd1edc6dc29ccfa569bae94f70
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Eike Ziller
2014-01-17 14:59:20 +01:00
parent 7be1f1064e
commit dcba4a2715
6 changed files with 22 additions and 19 deletions

View File

@@ -33,6 +33,7 @@
#include "qmljsindenter.h"
#include <qmljs/parser/qmljsast_p.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/tabsettings.h>
#include <projectexplorer/editorconfiguration.h>
@@ -50,7 +51,7 @@ public:
virtual void indentSelection(const QTextCursor &selection,
const QString &fileName,
const TextEditor::BaseTextEditorWidget *textEditor) const
const TextEditor::BaseTextDocument *textDocument) const
{
// ### shares code with QmlJSTextEditor::indent
QTextDocument *doc = selection.document();
@@ -59,7 +60,7 @@ public:
const QTextBlock end = doc->findBlock(selection.selectionEnd()).next();
const TextEditor::TabSettings &tabSettings =
ProjectExplorer::actualTabSettings(fileName, textEditor);
ProjectExplorer::actualTabSettings(fileName, textDocument);
CreatorCodeFormatter codeFormatter(tabSettings);
codeFormatter.updateStateUntil(block);
@@ -74,10 +75,10 @@ public:
virtual void reindentSelection(const QTextCursor &selection,
const QString &fileName,
const TextEditor::BaseTextEditorWidget *textEditor) const
const TextEditor::BaseTextDocument *textDocument) const
{
const TextEditor::TabSettings &tabSettings =
ProjectExplorer::actualTabSettings(fileName, textEditor);
ProjectExplorer::actualTabSettings(fileName, textDocument);
QmlJSEditor::Internal::Indenter indenter;
indenter.reindent(selection.document(), selection, tabSettings);