From 3e93f66c5d1cdf4a641f456df1b2ff3c0d37fc01 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Tue, 16 Oct 2018 10:39:20 +0200 Subject: Clang: Fix SourceLocation column recalculation Fix column conversion according to the fact that columns are 1-based. Change-Id: I75e9b966d96b9bb7648822b564e57f8838ebb3f8 Reviewed-by: Nikolai Kosjar --- src/tools/clangbackend/source/sourcelocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/clangbackend/source/sourcelocation.cpp') diff --git a/src/tools/clangbackend/source/sourcelocation.cpp b/src/tools/clangbackend/source/sourcelocation.cpp index 7fbe8c03eb..965bd25129 100644 --- a/src/tools/clangbackend/source/sourcelocation.cpp +++ b/src/tools/clangbackend/source/sourcelocation.cpp @@ -102,7 +102,7 @@ SourceLocation::SourceLocation(CXTranslationUnit cxTranslationUnit, // (2) column in Clang is the utf8 byte offset from the beginning of the line. // Here we convert column from (2) to (1). column_ = static_cast(QString::fromUtf8(&contents[lineStart], - static_cast(column_)).size()); + static_cast(column_) - 1).size()) + 1; } } -- cgit v1.2.1