forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user