forked from qt-creator/qt-creator
ClangSupport: Use simpler structures in some cases
The patch is mostly mechanical, but contains also a few spurious changes from values references for some local variables, foreach -> ranged for etc that I coulnd't resist. Change-Id: I58f0bd972546895eb318607cbfbd7ac35caf3f23 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -208,17 +208,17 @@ namespace {
|
||||
int positionInText(QTextDocument *textDocument,
|
||||
const ClangBackEnd::SourceLocationContainer &sourceLocationContainer)
|
||||
{
|
||||
auto textBlock = textDocument->findBlockByNumber(int(sourceLocationContainer.line()) - 1);
|
||||
auto textBlock = textDocument->findBlockByNumber(int(sourceLocationContainer.line) - 1);
|
||||
|
||||
return textBlock.position() + int(sourceLocationContainer.column()) - 1;
|
||||
return textBlock.position() + int(sourceLocationContainer.column) - 1;
|
||||
}
|
||||
|
||||
TextEditor::BlockRange
|
||||
toTextEditorBlock(QTextDocument *textDocument,
|
||||
const ClangBackEnd::SourceRangeContainer &sourceRangeContainer)
|
||||
{
|
||||
return TextEditor::BlockRange(positionInText(textDocument, sourceRangeContainer.start()),
|
||||
positionInText(textDocument, sourceRangeContainer.end()));
|
||||
return TextEditor::BlockRange(positionInText(textDocument, sourceRangeContainer.start),
|
||||
positionInText(textDocument, sourceRangeContainer.end));
|
||||
}
|
||||
|
||||
QList<TextEditor::BlockRange>
|
||||
@@ -631,7 +631,7 @@ CppTools::BaseEditorDocumentProcessor::HeaderErrorDiagnosticWidgetCreator
|
||||
ClangEditorDocumentProcessor::creatorForHeaderErrorDiagnosticWidget(
|
||||
const ClangBackEnd::DiagnosticContainer &firstHeaderErrorDiagnostic)
|
||||
{
|
||||
if (firstHeaderErrorDiagnostic.text().isEmpty())
|
||||
if (firstHeaderErrorDiagnostic.text.isEmpty())
|
||||
return CppTools::BaseEditorDocumentProcessor::HeaderErrorDiagnosticWidgetCreator();
|
||||
|
||||
return [firstHeaderErrorDiagnostic]() {
|
||||
|
||||
Reference in New Issue
Block a user