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(
|
const int fixItStartPos = Text::positionInText(
|
||||||
cursor.document(),
|
cursor.document(),
|
||||||
static_cast<int>(fixIt.range.start.line),
|
fixIt.range.start.line,
|
||||||
cppEditorColumn(startLine, static_cast<int>(fixIt.range.start.column)));
|
cppEditorColumn(startLine, fixIt.range.start.column));
|
||||||
const int fixItEndPos = Text::positionInText(
|
const int fixItEndPos = Text::positionInText(
|
||||||
cursor.document(),
|
cursor.document(),
|
||||||
static_cast<int>(fixIt.range.end.line),
|
fixIt.range.end.line,
|
||||||
cppEditorColumn(endLine, static_cast<int>(fixIt.range.end.column)));
|
cppEditorColumn(endLine, fixIt.range.end.column));
|
||||||
return std::make_pair(fixItStartPos, fixItEndPos);
|
return std::make_pair(fixItStartPos, fixItEndPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,8 +226,7 @@ Link OverviewModel::linkFromIndex(const QModelIndex &sourceIndex) const
|
|||||||
auto item = static_cast<TokenTreeItem *>(itemForIndex(sourceIndex));
|
auto item = static_cast<TokenTreeItem *>(itemForIndex(sourceIndex));
|
||||||
if (!item)
|
if (!item)
|
||||||
return {};
|
return {};
|
||||||
return Link(m_filePath, static_cast<int>(item->token.line),
|
return Link(m_filePath, item->token.line, item->token.column - 1);
|
||||||
static_cast<int>(item->token.column) - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LineColumn OverviewModel::lineColumnFromIndex(const QModelIndex &sourceIndex) const
|
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));
|
auto item = static_cast<TokenTreeItem *>(itemForIndex(sourceIndex));
|
||||||
if (!item)
|
if (!item)
|
||||||
return {};
|
return {};
|
||||||
return {static_cast<int>(item->token.line),
|
return {item->token.line, item->token.column};
|
||||||
static_cast<int>(item->token.column)};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OverviewModel::Range OverviewModel::rangeFromIndex(const QModelIndex &sourceIndex) const
|
OverviewModel::Range OverviewModel::rangeFromIndex(const QModelIndex &sourceIndex) const
|
||||||
@@ -245,10 +243,8 @@ OverviewModel::Range OverviewModel::rangeFromIndex(const QModelIndex &sourceInde
|
|||||||
if (!item)
|
if (!item)
|
||||||
return {};
|
return {};
|
||||||
const ClangBackEnd::SourceRangeContainer &range = item->token.extraInfo.cursorRange;
|
const ClangBackEnd::SourceRangeContainer &range = item->token.extraInfo.cursorRange;
|
||||||
return std::make_pair(LineColumn(static_cast<int>(range.start.line),
|
return std::make_pair(LineColumn(range.start.line, range.start.column),
|
||||||
static_cast<int>(range.start.column)),
|
LineColumn(range.end.line, range.end.column));
|
||||||
LineColumn(static_cast<int>(range.end.line),
|
|
||||||
static_cast<int>(range.end.column)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user