diff --git a/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp b/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp index a2d924e5712b04e469fc996b05c99ef34d8b5feb..405f7ad44a1f9517d0a44befd36ae3071cf3d129 100644 --- a/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp +++ b/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp @@ -194,7 +194,7 @@ RewriterView *ModelToTextMerger::view() bool ModelToTextMerger::applyChanges() { if (m_rewriteActions.isEmpty()) - return; + return true; dumpRewriteActions(QLatin1String("Before compression")); RewriteActionCompressor compress(getPropertyOrder()); @@ -202,18 +202,20 @@ bool ModelToTextMerger::applyChanges() dumpRewriteActions(QLatin1String("After compression")); if (m_rewriteActions.isEmpty()) - return; + return true; Document::Ptr tmpDocument(Document::create(QLatin1String("<ModelToTextMerger>"))); tmpDocument->setSource(m_rewriterView->textModifier()->text()); if (!tmpDocument->parseQml()) { qDebug() << "*** Possible problem: QML file wasn't parsed correctly."; qDebug() << "*** QML text:" << m_rewriterView->textModifier()->text(); - return; + return false; } TextModifier *textModifier = m_rewriterView->textModifier(); + bool success = true; + try { ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes()); positionRecalculator.connectTo(textModifier); @@ -223,8 +225,6 @@ bool ModelToTextMerger::applyChanges() textModifier->deactivateChangeSignals(); textModifier->startGroup(); - bool success = true; - for (int i = 0; i < m_rewriteActions.size(); ++i) { if (i != 0) { textModifier->flushGroup();