Commit ab306fa3 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.rewriter: crash fix

This fixes a bug for UiObjectBindings.
This just did not handle the binding case properly.

Change-Id: I543a1d839d5960044b5a5a39f506af753a70c287
Reviewed-on: http://codereview.qt.nokia.com/723

Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 5762faa6
......@@ -1165,15 +1165,22 @@ ModelNode TextToModelMerger::createModelNode(const QString &typeName,
{
QString nodeSource;
UiQualifiedId *astObjectType = 0;
if (UiObjectDefinition *def = cast<UiObjectDefinition *>(astNode)) {
astObjectType = def->qualifiedTypeNameId;
} else if (UiObjectBinding *bin = cast<UiObjectBinding *>(astNode)) {
astObjectType = bin->qualifiedTypeNameId;
}
if (isCustomParserType(typeName))
nodeSource = textAt(context->doc(),
astNode->firstSourceLocation(),
astObjectType->identifierToken.offset,
astNode->lastSourceLocation());
if (isComponentType(typeName) || isImplicitComponent) {
QString componentSource = extractComponentFromQml(textAt(context->doc(),
astNode->firstSourceLocation(),
astObjectType->identifierToken.offset,
astNode->lastSourceLocation()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment