Commit a5d25eab authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.Rewriter: fixing return value of applyChanges()

sucess should be false if refactoring.reparseDocument() fails

Reviewed-by: Erik Verbruggen
parent b08882a7
...@@ -228,7 +228,7 @@ bool ModelToTextMerger::applyChanges() ...@@ -228,7 +228,7 @@ bool ModelToTextMerger::applyChanges()
for (int i = 0; i < m_rewriteActions.size(); ++i) { for (int i = 0; i < m_rewriteActions.size(); ++i) {
if (i != 0) { if (i != 0) {
textModifier->flushGroup(); textModifier->flushGroup();
refactoring.reparseDocument(); success = refactoring.reparseDocument();
} }
RewriteAction* action = m_rewriteActions.at(i); RewriteAction* action = m_rewriteActions.at(i);
...@@ -237,7 +237,8 @@ bool ModelToTextMerger::applyChanges() ...@@ -237,7 +237,8 @@ bool ModelToTextMerger::applyChanges()
} }
ModelNodePositionStorage *positionStore = m_rewriterView->positionStorage(); ModelNodePositionStorage *positionStore = m_rewriterView->positionStorage();
success = action->execute(refactoring, *positionStore); if (success)
success = action->execute(refactoring, *positionStore);
if (!success /*&& DebugRewriteActions*/) { if (!success /*&& DebugRewriteActions*/) {
qDebug() << "*** QML source code: ***"; qDebug() << "*** QML source code: ***";
......
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