diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2011-03-08 15:37:18 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2011-03-09 07:55:06 (GMT) |
commit | f386c778d17347fb81d152eb61a7c40abe4eb0ae (patch) | |
tree | 6c5204f01e240923a252db8bd3aad6f81bbd580e /src/declarative | |
parent | 4a0ce0775350cf2b10f44502dc86110684fc9fb5 (diff) | |
download | Qt-f386c778d17347fb81d152eb61a7c40abe4eb0ae.zip Qt-f386c778d17347fb81d152eb61a7c40abe4eb0ae.tar.gz Qt-f386c778d17347fb81d152eb61a7c40abe4eb0ae.tar.bz2 |
Fix line information for dynamic slots in .qml files
Take whitespace before the opening bracket into account, e.g. save the newlines
in function f()\n{}
Task-number: QTBUG-18006
Done by Roberto Raggi
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativescriptparser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index 996920a..b604706 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -776,7 +776,10 @@ bool ProcessAST::visit(AST::UiSourceElement *node) f = f->finish(); } - QString body = textAt(funDecl->lbraceToken, funDecl->rbraceToken); + AST::SourceLocation loc = funDecl->rparenToken; + loc.offset = loc.end(); + loc.startColumn += 1; + QString body = textAt(loc, funDecl->rbraceToken); slot.name = funDecl->name->asString().toUtf8(); slot.body = body; obj->dynamicSlots << slot; |