forked from qt-creator/qt-creator
ClangCodeModel: Remove some unneeded static_cast<int> of ints
Continues 7ab6783e24.
Change-Id: I1f80ae5d20163d1d5da79dc26ea3129bd3599066
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -377,12 +377,12 @@ std::pair<int, int> fixItPositionsRange(const FixItContainer &fixIt, const QText
|
||||
|
||||
const int fixItStartPos = Text::positionInText(
|
||||
cursor.document(),
|
||||
static_cast<int>(fixIt.range.start.line),
|
||||
cppEditorColumn(startLine, static_cast<int>(fixIt.range.start.column)));
|
||||
fixIt.range.start.line,
|
||||
cppEditorColumn(startLine, fixIt.range.start.column));
|
||||
const int fixItEndPos = Text::positionInText(
|
||||
cursor.document(),
|
||||
static_cast<int>(fixIt.range.end.line),
|
||||
cppEditorColumn(endLine, static_cast<int>(fixIt.range.end.column)));
|
||||
fixIt.range.end.line,
|
||||
cppEditorColumn(endLine, fixIt.range.end.column));
|
||||
return std::make_pair(fixItStartPos, fixItEndPos);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,8 +226,7 @@ Link OverviewModel::linkFromIndex(const QModelIndex &sourceIndex) const
|
||||
auto item = static_cast<TokenTreeItem *>(itemForIndex(sourceIndex));
|
||||
if (!item)
|
||||
return {};
|
||||
return Link(m_filePath, static_cast<int>(item->token.line),
|
||||
static_cast<int>(item->token.column) - 1);
|
||||
return Link(m_filePath, item->token.line, item->token.column - 1);
|
||||
}
|
||||
|
||||
LineColumn OverviewModel::lineColumnFromIndex(const QModelIndex &sourceIndex) const
|
||||
@@ -235,8 +234,7 @@ LineColumn OverviewModel::lineColumnFromIndex(const QModelIndex &sourceIndex) co
|
||||
auto item = static_cast<TokenTreeItem *>(itemForIndex(sourceIndex));
|
||||
if (!item)
|
||||
return {};
|
||||
return {static_cast<int>(item->token.line),
|
||||
static_cast<int>(item->token.column)};
|
||||
return {item->token.line, item->token.column};
|
||||
}
|
||||
|
||||
OverviewModel::Range OverviewModel::rangeFromIndex(const QModelIndex &sourceIndex) const
|
||||
@@ -245,10 +243,8 @@ OverviewModel::Range OverviewModel::rangeFromIndex(const QModelIndex &sourceInde
|
||||
if (!item)
|
||||
return {};
|
||||
const ClangBackEnd::SourceRangeContainer &range = item->token.extraInfo.cursorRange;
|
||||
return std::make_pair(LineColumn(static_cast<int>(range.start.line),
|
||||
static_cast<int>(range.start.column)),
|
||||
LineColumn(static_cast<int>(range.end.line),
|
||||
static_cast<int>(range.end.column)));
|
||||
return std::make_pair(LineColumn(range.start.line, range.start.column),
|
||||
LineColumn(range.end.line, range.end.column));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user