Fixed superfluous (and erroneous) semi-colon insertion.

Bug: BAUHAUS-674
This commit is contained in:
Erik Verbruggen
2010-05-25 17:32:39 +02:00
parent e997f6de13
commit 79cbc07b29
4 changed files with 4 additions and 6 deletions

View File

@@ -112,12 +112,12 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ
if (isOneLiner) {
if (insertAfter == 0) { // we're inserting after an lbrace
if (initializer->members) { // we're inserting before a member (and not the rbrace)
needsTrailingSemicolon = true;
needsTrailingSemicolon = m_propertyType == QmlRefactoring::ScriptBinding;
}
} else { // we're inserting after a member, not after the lbrace
if (endOfPreviousMember.isValid()) { // there already is a semicolon after the previous member
if (insertAfter->next && insertAfter->next->member) { // and the after us there is a member, not an rbrace, so:
needsTrailingSemicolon = true;
needsTrailingSemicolon = m_propertyType == QmlRefactoring::ScriptBinding;
}
} else { // there is no semicolon after the previous member (probably because there is an rbrace after us/it, so:
needsPreceedingSemicolon = true;

View File

@@ -58,7 +58,7 @@ private:
quint32 m_parentLocation;
QString m_name;
QString m_value;
QmlDesigner::QmlRefactoring::PropertyType m_propertyType;
QmlRefactoring::PropertyType m_propertyType;
QStringList m_propertyOrder;
};

View File

@@ -108,7 +108,7 @@ void RewriteActionCompressor::compressImports(QList<RewriteAction *> &actions) c
void RewriteActionCompressor::compressRereparentActions(QList<RewriteAction *> &actions) const
{
QMap<ModelNode, ReparentNodeRewriteAction *> reparentedNodes;
QHash<ModelNode, ReparentNodeRewriteAction *> reparentedNodes;
QMutableListIterator<RewriteAction*> iter(actions);
iter.toBack();

View File

@@ -804,8 +804,6 @@ void TestCore::testRewriterForGradientMagic()
" }\n"
"}");
QSKIP("See BAUHAUS-674", SkipAll);
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
NotIndentingTextEditModifier modifier(&textEdit);