QmlDesigner: Remove annotations if auxiliary data is empty

Change-Id: I1692fbafbac747936e1dbb303f306bef311ca5f8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2018-04-12 17:04:19 +02:00
parent cedd104009
commit e0ce44cc27

View File

@@ -932,12 +932,12 @@ void RewriterView::writeAuxiliaryData()
auxData.prepend(annotationsStart()); auxData.prepend(annotationsStart());
auxData.append(annotationsEnd()); auxData.append(annotationsEnd());
newText.append(auxData); newText.append(auxData);
}
QTextCursor tc(m_textModifier->textDocument()); QTextCursor tc(m_textModifier->textDocument());
Utils::ChangeSet changeSet; Utils::ChangeSet changeSet;
changeSet.replace(0, oldText.length(), newText); changeSet.replace(0, oldText.length(), newText);
changeSet.apply(&tc); changeSet.apply(&tc);
}
} }
static void checkNode(QmlJS::SimpleReaderNode::Ptr node, RewriterView *view); static void checkNode(QmlJS::SimpleReaderNode::Ptr node, RewriterView *view);