From f386c778d17347fb81d152eb61a7c40abe4eb0ae Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 8 Mar 2011 16:37:18 +0100 Subject: 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 --- src/declarative/qml/qdeclarativescriptparser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v0.12