Commit 138266e3 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fixed compiler errors from previous commit.

parent 972ef2b2
...@@ -194,7 +194,7 @@ RewriterView *ModelToTextMerger::view() ...@@ -194,7 +194,7 @@ RewriterView *ModelToTextMerger::view()
bool ModelToTextMerger::applyChanges() bool ModelToTextMerger::applyChanges()
{ {
if (m_rewriteActions.isEmpty()) if (m_rewriteActions.isEmpty())
return; return true;
dumpRewriteActions(QLatin1String("Before compression")); dumpRewriteActions(QLatin1String("Before compression"));
RewriteActionCompressor compress(getPropertyOrder()); RewriteActionCompressor compress(getPropertyOrder());
...@@ -202,18 +202,20 @@ bool ModelToTextMerger::applyChanges() ...@@ -202,18 +202,20 @@ bool ModelToTextMerger::applyChanges()
dumpRewriteActions(QLatin1String("After compression")); dumpRewriteActions(QLatin1String("After compression"));
if (m_rewriteActions.isEmpty()) if (m_rewriteActions.isEmpty())
return; return true;
Document::Ptr tmpDocument(Document::create(QLatin1String("<ModelToTextMerger>"))); Document::Ptr tmpDocument(Document::create(QLatin1String("<ModelToTextMerger>")));
tmpDocument->setSource(m_rewriterView->textModifier()->text()); tmpDocument->setSource(m_rewriterView->textModifier()->text());
if (!tmpDocument->parseQml()) { if (!tmpDocument->parseQml()) {
qDebug() << "*** Possible problem: QML file wasn't parsed correctly."; qDebug() << "*** Possible problem: QML file wasn't parsed correctly.";
qDebug() << "*** QML text:" << m_rewriterView->textModifier()->text(); qDebug() << "*** QML text:" << m_rewriterView->textModifier()->text();
return; return false;
} }
TextModifier *textModifier = m_rewriterView->textModifier(); TextModifier *textModifier = m_rewriterView->textModifier();
bool success = true;
try { try {
ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes()); ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes());
positionRecalculator.connectTo(textModifier); positionRecalculator.connectTo(textModifier);
...@@ -223,8 +225,6 @@ bool ModelToTextMerger::applyChanges() ...@@ -223,8 +225,6 @@ bool ModelToTextMerger::applyChanges()
textModifier->deactivateChangeSignals(); textModifier->deactivateChangeSignals();
textModifier->startGroup(); textModifier->startGroup();
bool success = true;
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();
......
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