diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-01-16 09:37:54 +0100 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-01-22 09:52:15 +0000 |
commit | d7058e1afedfe609ff6e81222bd2137922bf7de3 (patch) | |
tree | 62d16136c8336646b8ef0ad4d220b7e0e8331203 /src/plugins/cpptools/cpprefactoringchanges.cpp | |
parent | 8b5beeb952448540a3834333b694919563d81ee2 (diff) | |
download | qt-creator-d7058e1afedfe609ff6e81222bd2137922bf7de3.tar.gz |
ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.
First simple unit-test proofs it builds and runs.
Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cpprefactoringchanges.cpp')
-rw-r--r-- | src/plugins/cpptools/cpprefactoringchanges.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/cpptools/cpprefactoringchanges.cpp b/src/plugins/cpptools/cpprefactoringchanges.cpp index 929a6ec020..138a5a3693 100644 --- a/src/plugins/cpptools/cpprefactoringchanges.cpp +++ b/src/plugins/cpptools/cpprefactoringchanges.cpp @@ -56,8 +56,8 @@ public: const TextEditor::TabSettings &tabSettings = ProjectExplorer::actualTabSettings(fileName, textDocument); - CppQtStyleIndenter indenter; - indenter.indent(selection.document(), selection, QChar::Null, tabSettings); + CppQtStyleIndenter indenter(selection.document()); + indenter.indent(selection, QChar::Null, tabSettings); } void reindentSelection(const QTextCursor &selection, @@ -67,8 +67,9 @@ public: const TextEditor::TabSettings &tabSettings = ProjectExplorer::actualTabSettings(fileName, textDocument); - CppQtStyleIndenter indenter; - indenter.reindent(selection.document(), selection, tabSettings); + CppQtStyleIndenter indenter(selection.document()); + indenter.reindent(selection, + tabSettings); } void fileChanged(const QString &fileName) override |