Commit 84515448 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.rewriter: crash fix for Flipable

Removing a property from a Flipabke back or front property
resulted in a crash, because the offset of UiObjectBinding
was not handled correctly.
The left hand side of the binding is not part of the node anymore.

Reviewed-by: Kai Koehne
parent 7e48a3a3
......@@ -48,6 +48,13 @@ RemovePropertyVisitor::RemovePropertyVisitor(QmlDesigner::TextModifier &modifier
bool RemovePropertyVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
{
if (ast->firstSourceLocation().offset == parentLocation) {
//this condition is wrong for the UiObjectBinding case, but we keep it
//since we are paranoid until the release is done.
// FIXME: change this to use the QmlJS::Rewriter class
removeFrom(ast->initializer);
}
if (ast->qualifiedTypeNameId && ast->qualifiedTypeNameId->identifierToken.offset == parentLocation) {
// FIXME: change this to use the QmlJS::Rewriter class
removeFrom(ast->initializer);
}
......
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