summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/qmljs/qmljsfindexportedcpptypes.cpp')
-rw-r--r--src/libs/qmljs/qmljsfindexportedcpptypes.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
index 7034ea64b9..ea7d9cf051 100644
--- a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
+++ b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
@@ -225,8 +225,10 @@ protected:
// go through comments backwards to find the annotation closest to the call
for (unsigned i = _doc->translationUnit()->commentCount(); i-- > 0; ) {
const Token commentToken = _doc->translationUnit()->commentAt(i);
- if (commentToken.begin() >= end.begin() || commentToken.end() <= begin.begin())
+ if (commentToken.bytesBegin() >= end.bytesBegin()
+ || commentToken.bytesEnd() <= begin.bytesBegin()) {
continue;
+ }
const QString comment = stringOf(commentToken);
if (uriAnnotation.indexIn(comment) != -1) {
packageName = uriAnnotation.cap(1);
@@ -274,7 +276,8 @@ protected:
// and the expression
const Token begin = translationUnit()->tokenAt(typeId->firstToken());
const Token last = translationUnit()->tokenAt(typeId->lastToken() - 1);
- exportedType.typeExpression = QString::fromUtf8(_doc->utf8Source().mid(begin.begin(), last.end() - begin.begin()));
+ exportedType.typeExpression = QString::fromUtf8(
+ _doc->utf8Source().mid(begin.bytesBegin(), last.bytesEnd() - begin.bytesBegin()));
_exportedTypes += exportedType;
@@ -401,12 +404,14 @@ private:
{
const Token firstToken = translationUnit()->tokenAt(first);
const Token lastToken = translationUnit()->tokenAt(last);
- return QString::fromUtf8(_doc->utf8Source().mid(firstToken.begin(), lastToken.end() - firstToken.begin()));
+ return QString::fromUtf8(
+ _doc->utf8Source().mid(firstToken.bytesBegin(),
+ lastToken.bytesEnd() - firstToken.bytesBegin()));
}
QString stringOf(const Token &token)
{
- return QString::fromUtf8(_doc->utf8Source().mid(token.begin(), token.length()));
+ return QString::fromUtf8(_doc->utf8Source().mid(token.bytesBegin(), token.bytes()));
}
ExpressionAST *skipStringCall(ExpressionAST *exp)