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
This commit is contained in:
Thomas Hartmann
2010-11-23 12:14:48 +01:00
parent 7e48a3a314
commit 84515448e8

View File

@@ -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);
}