From a5d25eab7deae69c5571510ec7a11744870a83f2 Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Wed, 20 Jan 2010 11:35:49 +0100
Subject: [PATCH] QmlDesigner.Rewriter: fixing return value of applyChanges()
 sucess should be false if refactoring.reparseDocument() fails

Reviewed-by: Erik Verbruggen
---
 src/plugins/qmldesigner/core/model/modeltotextmerger.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp b/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp
index 405f7ad44a1..41f8c1d6f10 100644
--- a/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp
+++ b/src/plugins/qmldesigner/core/model/modeltotextmerger.cpp
@@ -228,7 +228,7 @@ bool ModelToTextMerger::applyChanges()
         for (int i = 0; i < m_rewriteActions.size(); ++i) {
             if (i != 0) {
                 textModifier->flushGroup();
-                refactoring.reparseDocument();
+                success = refactoring.reparseDocument();
             }
 
             RewriteAction* action = m_rewriteActions.at(i);
@@ -237,7 +237,8 @@ bool ModelToTextMerger::applyChanges()
             }
 
             ModelNodePositionStorage *positionStore = m_rewriterView->positionStorage();
-            success = action->execute(refactoring, *positionStore);
+            if (success)
+                success = action->execute(refactoring, *positionStore);
 
             if (!success /*&& DebugRewriteActions*/) {
                 qDebug() << "*** QML source code: ***";
-- 
GitLab