forked from qt-creator/qt-creator
Use document instead of widget in TextEditor::RefactoringChangesData
Change-Id: I938041c9774fbebd1edc6dc29ccfa569bae94f70 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user