diff options
author | David Schulz <david.schulz@qt.io> | 2020-01-08 10:43:13 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2020-01-09 08:23:07 +0000 |
commit | c56e58fab43483ee9d43e768aed42d7078409290 (patch) | |
tree | fe536cb2f6c1875448230f94ac03ad651b383551 /src/plugins/clangtools | |
parent | 88edfdb1b2f46ffe0f342c2c3176fc5c125eb0b1 (diff) |
Utils: move text replacement helper to Utils::Text
Change-Id: I82b3304f91d575369e74d5f7404c189e14ba4730
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/clangtools')
-rw-r--r-- | src/plugins/clangtools/clangfixitsrefactoringchanges.cpp | 8 | ||||
-rw-r--r-- | src/plugins/clangtools/clangfixitsrefactoringchanges.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp index e32553f976..345a40d854 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp @@ -150,7 +150,7 @@ void FixitsRefactoringFile::format(TextEditor::Indenter &indenter, const int end = doc->findBlock(op.pos + op.length).blockNumber() + 1; ranges.push_back({start, end}); } - const Replacements replacements = indenter.format(ranges); + const Text::Replacements replacements = indenter.format(ranges); if (replacements.empty()) return; @@ -201,7 +201,7 @@ void FixitsRefactoringFile::shiftAffectedReplacements(const ReplacementOperation } bool FixitsRefactoringFile::hasIntersection(const QString &fileName, - const Replacements &replacements, + const Text::Replacements &replacements, int startIndex) const { for (int i = startIndex; i < m_replacementOperations.size(); ++i) { @@ -212,7 +212,7 @@ bool FixitsRefactoringFile::hasIntersection(const QString &fileName, // Usually the number of replacements is from 1 to 3. if (std::any_of(replacements.begin(), replacements.end(), - [¤t](const Replacement &replacement) { + [¤t](const Text::Replacement &replacement) { return replacement.offset + replacement.length > current.pos && replacement.offset < current.pos + current.length; })) { @@ -224,7 +224,7 @@ bool FixitsRefactoringFile::hasIntersection(const QString &fileName, } void FixitsRefactoringFile::shiftAffectedReplacements(const QString &fileName, - const Replacements &replacements, + const Text::Replacements &replacements, int startIndex) { for (int i = startIndex; i < m_replacementOperations.size(); ++i) { diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.h b/src/plugins/clangtools/clangfixitsrefactoringchanges.h index cf715b3487..e4692b22cc 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.h +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.h @@ -72,10 +72,10 @@ private: const ReplacementOperations &operationsForFile, int firstOperationIndex); void shiftAffectedReplacements(const QString &fileName, - const TextEditor::Replacements &replacements, + const Utils::Text::Replacements &replacements, int startIndex); bool hasIntersection(const QString &fileName, - const TextEditor::Replacements &replacements, + const Utils::Text::Replacements &replacements, int startIndex) const; QString m_filePath; |