diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-10-16 10:39:20 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-10-16 09:58:20 +0000 |
commit | 3e93f66c5d1cdf4a641f456df1b2ff3c0d37fc01 (patch) | |
tree | 224a33d2a112eb3c4a87350793f56935d1a464cb /src/tools/clangbackend/source/sourcelocation.cpp | |
parent | fac917b4776597a5166766d62cc7d8f8deb01ec6 (diff) | |
download | qt-creator-3e93f66c5d1cdf4a641f456df1b2ff3c0d37fc01.tar.gz |
Clang: Fix SourceLocation column recalculation
Fix column conversion according to the fact that
columns are 1-based.
Change-Id: I75e9b966d96b9bb7648822b564e57f8838ebb3f8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/tools/clangbackend/source/sourcelocation.cpp')
-rw-r--r-- | src/tools/clangbackend/source/sourcelocation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<uint>(QString::fromUtf8(&contents[lineStart], - static_cast<int>(column_)).size()); + static_cast<int>(column_) - 1).size()) + 1; } } |