CppTools: Modernize

Change-Id: I78af9cd4ccddfa4ed744dce96b772ae5644c89d2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Nikolai Kosjar
2019-02-07 10:09:21 +01:00
parent 69281bcdcf
commit 12f4b1ee86
15 changed files with 61 additions and 96 deletions

View File

@@ -198,12 +198,12 @@ Utils::ChangeSet::Range CppRefactoringFile::range(unsigned tokenIndex) const
unsigned line, column;
cppDocument()->translationUnit()->getPosition(token.utf16charsBegin(), &line, &column);
const int start = document()->findBlockByNumber(line - 1).position() + column - 1;
return Utils::ChangeSet::Range(start, start + token.utf16chars());
return {start, static_cast<int>(start + token.utf16chars())};
}
Utils::ChangeSet::Range CppRefactoringFile::range(AST *ast) const
{
return Utils::ChangeSet::Range(startOf(ast), endOf(ast));
return {startOf(ast), endOf(ast)};
}
int CppRefactoringFile::startOf(unsigned index) const