forked from qt-creator/qt-creator
QmlDesigner: Normalize expressions
We have to remove whitespaces and ';' to normalize expressions. Otherwise expressions can change when rewriting. Change-Id: I0085a5a46c4caa2815a4e7f4f76658a4df49de75 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -1087,6 +1087,12 @@ void TextToModelMerger::syncNode(ModelNode &modelNode,
|
||||
astValue = textAt(context->doc(),
|
||||
property->statement->firstSourceLocation(),
|
||||
property->statement->lastSourceLocation());
|
||||
|
||||
astValue = astValue.trimmed();
|
||||
if (astValue.endsWith(QLatin1Char(';')))
|
||||
astValue = astValue.left(astValue.length() - 1);
|
||||
astValue = astValue.trimmed();
|
||||
|
||||
const TypeName &astType = property->memberType.toUtf8();
|
||||
AbstractProperty modelProperty = modelNode.property(astName.toUtf8());
|
||||
if (!property->statement || isLiteralValue(property->statement)) {
|
||||
|
||||
Reference in New Issue
Block a user