Commit 97eb3e13 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

qmljsrewriter: fixes removing of properties

parent c79bf94c
......@@ -406,7 +406,7 @@ void Rewriter::removeMember(UiObjectMember *member)
includeSurroundingWhitespace(start, end);
m_changeSet->replace(start, end, QLatin1String(""));
m_changeSet->remove(start, end);
}
bool Rewriter::includeSurroundingWhitespace(int &start, int &end) const
......@@ -416,10 +416,12 @@ bool Rewriter::includeSurroundingWhitespace(int &start, int &end) const
if (end >= 0) {
QChar c = m_originalText.at(end);
while (c.isSpace()) {
++end;
if (c == QChar::ParagraphSeparator) {
if (c.unicode() == 10) {
paragraphFound = true;
break;
} else if (end == m_originalText.length()) {
......@@ -438,7 +440,7 @@ bool Rewriter::includeSurroundingWhitespace(int &start, int &end) const
if (!c.isSpace())
break;
else if (c == QChar::ParagraphSeparator)
else if (c.unicode() == 10)
break;
--start;
......@@ -590,7 +592,7 @@ void Rewriter::removeObjectMember(UiObjectMember *member, UiObjectMember *parent
}
includeLeadingEmptyLine(start);
m_changeSet->replace(start, end, QLatin1String(""));
m_changeSet->remove(start, end);
}
void Rewriter::extendToLeadingOrTrailingComma(UiArrayBinding *parentArray,
......
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