Clean up whitespace
Change-Id: I3413e0f55df07a35ad2e93da9bae2ca7f9b8d4c1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
05ce12849b
commit
ba2a0d652c
@ -207,18 +207,18 @@ public:
|
|||||||
|
|
||||||
inline QStringRef addToStringStorage(const QStringRef &s) {
|
inline QStringRef addToStringStorage(const QStringRef &s) {
|
||||||
int pos = tagStackStringStorageSize;
|
int pos = tagStackStringStorageSize;
|
||||||
int sz = s.size();
|
int sz = s.size();
|
||||||
if (pos != tagStackStringStorage.size())
|
if (pos != tagStackStringStorage.size())
|
||||||
tagStackStringStorage.resize(pos);
|
tagStackStringStorage.resize(pos);
|
||||||
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
||||||
tagStackStringStorageSize += sz;
|
tagStackStringStorageSize += sz;
|
||||||
return QStringRef(&tagStackStringStorage, pos, sz);
|
return QStringRef(&tagStackStringStorage, pos, sz);
|
||||||
}
|
}
|
||||||
inline QStringRef addToStringStorage(const QString &s) {
|
inline QStringRef addToStringStorage(const QString &s) {
|
||||||
int pos = tagStackStringStorageSize;
|
int pos = tagStackStringStorageSize;
|
||||||
int sz = s.size();
|
int sz = s.size();
|
||||||
if (pos != tagStackStringStorage.size())
|
if (pos != tagStackStringStorage.size())
|
||||||
tagStackStringStorage.resize(pos);
|
tagStackStringStorage.resize(pos);
|
||||||
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
||||||
tagStackStringStorageSize += sz;
|
tagStackStringStorageSize += sz;
|
||||||
return QStringRef(&tagStackStringStorage, pos, sz);
|
return QStringRef(&tagStackStringStorage, pos, sz);
|
||||||
@ -525,7 +525,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
name.clear();
|
name.clear();
|
||||||
prefix.clear();
|
prefix.clear();
|
||||||
qualifiedName.clear();
|
qualifiedName.clear();
|
||||||
namespaceUri.clear();
|
namespaceUri.clear();
|
||||||
if (publicNamespaceDeclarations.size())
|
if (publicNamespaceDeclarations.size())
|
||||||
publicNamespaceDeclarations.clear();
|
publicNamespaceDeclarations.clear();
|
||||||
@ -536,7 +536,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
Tag &tag = tagStack_pop();
|
Tag &tag = tagStack_pop();
|
||||||
namespaceUri = tag.namespaceDeclaration.namespaceUri;
|
namespaceUri = tag.namespaceDeclaration.namespaceUri;
|
||||||
name = tag.name;
|
name = tag.name;
|
||||||
qualifiedName = tag.qualifiedName;
|
qualifiedName = tag.qualifiedName;
|
||||||
isEmptyElement = false;
|
isEmptyElement = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::EndElement:
|
case QXmlStreamReader::EndElement:
|
||||||
name.clear();
|
name.clear();
|
||||||
prefix.clear();
|
prefix.clear();
|
||||||
qualifiedName.clear();
|
qualifiedName.clear();
|
||||||
namespaceUri.clear();
|
namespaceUri.clear();
|
||||||
clearTextBuffer();
|
clearTextBuffer();
|
||||||
break;
|
break;
|
||||||
@ -559,7 +559,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::Comment:
|
case QXmlStreamReader::Comment:
|
||||||
case QXmlStreamReader::Characters:
|
case QXmlStreamReader::Characters:
|
||||||
isCDATA = false;
|
isCDATA = false;
|
||||||
isWhitespace = true;
|
isWhitespace = true;
|
||||||
text.clear();
|
text.clear();
|
||||||
clearTextBuffer();
|
clearTextBuffer();
|
||||||
break;
|
break;
|
||||||
@ -571,21 +571,21 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::ProcessingInstruction:
|
case QXmlStreamReader::ProcessingInstruction:
|
||||||
processingInstructionTarget.clear();
|
processingInstructionTarget.clear();
|
||||||
processingInstructionData.clear();
|
processingInstructionData.clear();
|
||||||
clearTextBuffer();
|
clearTextBuffer();
|
||||||
break;
|
break;
|
||||||
case QXmlStreamReader::NoToken:
|
case QXmlStreamReader::NoToken:
|
||||||
case QXmlStreamReader::Invalid:
|
case QXmlStreamReader::Invalid:
|
||||||
break;
|
break;
|
||||||
case QXmlStreamReader::StartDocument:
|
case QXmlStreamReader::StartDocument:
|
||||||
lockEncoding = true;
|
lockEncoding = true;
|
||||||
documentVersion.clear();
|
documentVersion.clear();
|
||||||
documentEncoding.clear();
|
documentEncoding.clear();
|
||||||
#ifndef QT_NO_TEXTCODEC
|
#ifndef QT_NO_TEXTCODEC
|
||||||
if(decoder->hasFailure()) {
|
if (decoder->hasFailure()) {
|
||||||
raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));
|
raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));
|
||||||
readBuffer.clear();
|
readBuffer.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// fall through
|
// fall through
|
||||||
default:
|
default:
|
||||||
@ -1225,7 +1225,7 @@ cdata ::= langle_bang CDATA_START;
|
|||||||
case $rule_number: {
|
case $rule_number: {
|
||||||
setType(QXmlStreamReader::Characters);
|
setType(QXmlStreamReader::Characters);
|
||||||
isCDATA = true;
|
isCDATA = true;
|
||||||
isWhitespace = false;
|
isWhitespace = false;
|
||||||
int pos = sym(2).pos;
|
int pos = sym(2).pos;
|
||||||
if (scanUntil("]]>", -1)) {
|
if (scanUntil("]]>", -1)) {
|
||||||
text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3);
|
text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3);
|
||||||
@ -1294,7 +1294,7 @@ scan_content_char ::= SPACE;
|
|||||||
resume($rule_number);
|
resume($rule_number);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
./
|
./
|
||||||
|
|
||||||
content_char_list ::= content_char_list char_ref;
|
content_char_list ::= content_char_list char_ref;
|
||||||
@ -1310,11 +1310,11 @@ content_char_list ::= scan_content_char;
|
|||||||
character_content ::= content_char_list %prec SHIFT_THERE;
|
character_content ::= content_char_list %prec SHIFT_THERE;
|
||||||
/.
|
/.
|
||||||
case $rule_number:
|
case $rule_number:
|
||||||
if (!textBuffer.isEmpty()) {
|
if (!textBuffer.isEmpty()) {
|
||||||
setType(QXmlStreamReader::Characters);
|
setType(QXmlStreamReader::Characters);
|
||||||
text = &textBuffer;
|
text = &textBuffer;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
./
|
./
|
||||||
|
|
||||||
literal ::= QUOTE QUOTE;
|
literal ::= QUOTE QUOTE;
|
||||||
@ -1361,7 +1361,7 @@ literal_content_start ::= LETTER | DIGIT | RANGLE | HASH | LBRACK | RBRACK | LPA
|
|||||||
literal_content_start ::= SPACE;
|
literal_content_start ::= SPACE;
|
||||||
/.
|
/.
|
||||||
case $rule_number:
|
case $rule_number:
|
||||||
if (normalizeLiterals)
|
if (normalizeLiterals)
|
||||||
textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' ');
|
textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' ');
|
||||||
break;
|
break;
|
||||||
./
|
./
|
||||||
@ -1405,7 +1405,7 @@ entity_value ::= QUOTE entity_value_content_with_dblquote QUOTE;
|
|||||||
entity_value ::= DBLQUOTE entity_value_content_with_quote DBLQUOTE;
|
entity_value ::= DBLQUOTE entity_value_content_with_quote DBLQUOTE;
|
||||||
/.
|
/.
|
||||||
case $rule_number:
|
case $rule_number:
|
||||||
sym(1) = sym(2);
|
sym(1) = sym(2);
|
||||||
break;
|
break;
|
||||||
./
|
./
|
||||||
|
|
||||||
@ -1609,7 +1609,7 @@ unresolved_entity ::= UNRESOLVED_ENTITY;
|
|||||||
}
|
}
|
||||||
setType(QXmlStreamReader::EntityReference);
|
setType(QXmlStreamReader::EntityReference);
|
||||||
name = &unresolvedEntity;
|
name = &unresolvedEntity;
|
||||||
break;
|
break;
|
||||||
./
|
./
|
||||||
|
|
||||||
entity_ref ::= AMPERSAND name SEMICOLON;
|
entity_ref ::= AMPERSAND name SEMICOLON;
|
||||||
@ -1646,10 +1646,10 @@ entity_ref ::= AMPERSAND name SEMICOLON;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
injectToken(UNRESOLVED_ENTITY);
|
injectToken(UNRESOLVED_ENTITY);
|
||||||
unresolvedEntity = symString(2).toString();
|
unresolvedEntity = symString(2).toString();
|
||||||
textBuffer.chop(2 + sym(2).len);
|
textBuffer.chop(2 + sym(2).len);
|
||||||
clearSym();
|
clearSym();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
@ -701,18 +701,18 @@ public:
|
|||||||
|
|
||||||
inline QStringRef addToStringStorage(const QStringRef &s) {
|
inline QStringRef addToStringStorage(const QStringRef &s) {
|
||||||
int pos = tagStackStringStorageSize;
|
int pos = tagStackStringStorageSize;
|
||||||
int sz = s.size();
|
int sz = s.size();
|
||||||
if (pos != tagStackStringStorage.size())
|
if (pos != tagStackStringStorage.size())
|
||||||
tagStackStringStorage.resize(pos);
|
tagStackStringStorage.resize(pos);
|
||||||
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
||||||
tagStackStringStorageSize += sz;
|
tagStackStringStorageSize += sz;
|
||||||
return QStringRef(&tagStackStringStorage, pos, sz);
|
return QStringRef(&tagStackStringStorage, pos, sz);
|
||||||
}
|
}
|
||||||
inline QStringRef addToStringStorage(const QString &s) {
|
inline QStringRef addToStringStorage(const QString &s) {
|
||||||
int pos = tagStackStringStorageSize;
|
int pos = tagStackStringStorageSize;
|
||||||
int sz = s.size();
|
int sz = s.size();
|
||||||
if (pos != tagStackStringStorage.size())
|
if (pos != tagStackStringStorage.size())
|
||||||
tagStackStringStorage.resize(pos);
|
tagStackStringStorage.resize(pos);
|
||||||
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
tagStackStringStorage.insert(pos, s.unicode(), sz);
|
||||||
tagStackStringStorageSize += sz;
|
tagStackStringStorageSize += sz;
|
||||||
return QStringRef(&tagStackStringStorage, pos, sz);
|
return QStringRef(&tagStackStringStorage, pos, sz);
|
||||||
@ -1019,7 +1019,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
name.clear();
|
name.clear();
|
||||||
prefix.clear();
|
prefix.clear();
|
||||||
qualifiedName.clear();
|
qualifiedName.clear();
|
||||||
namespaceUri.clear();
|
namespaceUri.clear();
|
||||||
if (publicNamespaceDeclarations.size())
|
if (publicNamespaceDeclarations.size())
|
||||||
publicNamespaceDeclarations.clear();
|
publicNamespaceDeclarations.clear();
|
||||||
@ -1030,7 +1030,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
Tag &tag = tagStack_pop();
|
Tag &tag = tagStack_pop();
|
||||||
namespaceUri = tag.namespaceDeclaration.namespaceUri;
|
namespaceUri = tag.namespaceDeclaration.namespaceUri;
|
||||||
name = tag.name;
|
name = tag.name;
|
||||||
qualifiedName = tag.qualifiedName;
|
qualifiedName = tag.qualifiedName;
|
||||||
isEmptyElement = false;
|
isEmptyElement = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1039,7 +1039,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::EndElement:
|
case QXmlStreamReader::EndElement:
|
||||||
name.clear();
|
name.clear();
|
||||||
prefix.clear();
|
prefix.clear();
|
||||||
qualifiedName.clear();
|
qualifiedName.clear();
|
||||||
namespaceUri.clear();
|
namespaceUri.clear();
|
||||||
clearTextBuffer();
|
clearTextBuffer();
|
||||||
break;
|
break;
|
||||||
@ -1053,7 +1053,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::Comment:
|
case QXmlStreamReader::Comment:
|
||||||
case QXmlStreamReader::Characters:
|
case QXmlStreamReader::Characters:
|
||||||
isCDATA = false;
|
isCDATA = false;
|
||||||
isWhitespace = true;
|
isWhitespace = true;
|
||||||
text.clear();
|
text.clear();
|
||||||
clearTextBuffer();
|
clearTextBuffer();
|
||||||
break;
|
break;
|
||||||
@ -1065,21 +1065,21 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case QXmlStreamReader::ProcessingInstruction:
|
case QXmlStreamReader::ProcessingInstruction:
|
||||||
processingInstructionTarget.clear();
|
processingInstructionTarget.clear();
|
||||||
processingInstructionData.clear();
|
processingInstructionData.clear();
|
||||||
clearTextBuffer();
|
clearTextBuffer();
|
||||||
break;
|
break;
|
||||||
case QXmlStreamReader::NoToken:
|
case QXmlStreamReader::NoToken:
|
||||||
case QXmlStreamReader::Invalid:
|
case QXmlStreamReader::Invalid:
|
||||||
break;
|
break;
|
||||||
case QXmlStreamReader::StartDocument:
|
case QXmlStreamReader::StartDocument:
|
||||||
lockEncoding = true;
|
lockEncoding = true;
|
||||||
documentVersion.clear();
|
documentVersion.clear();
|
||||||
documentEncoding.clear();
|
documentEncoding.clear();
|
||||||
#ifndef QT_NO_TEXTCODEC
|
#ifndef QT_NO_TEXTCODEC
|
||||||
if(decoder->hasFailure()) {
|
if (decoder->hasFailure()) {
|
||||||
raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));
|
raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));
|
||||||
readBuffer.clear();
|
readBuffer.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// fall through
|
// fall through
|
||||||
default:
|
default:
|
||||||
@ -1550,7 +1550,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
case 101: {
|
case 101: {
|
||||||
setType(QXmlStreamReader::Characters);
|
setType(QXmlStreamReader::Characters);
|
||||||
isCDATA = true;
|
isCDATA = true;
|
||||||
isWhitespace = false;
|
isWhitespace = false;
|
||||||
int pos = sym(2).pos;
|
int pos = sym(2).pos;
|
||||||
if (scanUntil("]]>", -1)) {
|
if (scanUntil("]]>", -1)) {
|
||||||
text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3);
|
text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3);
|
||||||
@ -1597,14 +1597,14 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
resume(130);
|
resume(130);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 139:
|
case 139:
|
||||||
if (!textBuffer.isEmpty()) {
|
if (!textBuffer.isEmpty()) {
|
||||||
setType(QXmlStreamReader::Characters);
|
setType(QXmlStreamReader::Characters);
|
||||||
text = &textBuffer;
|
text = &textBuffer;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 140:
|
case 140:
|
||||||
case 141:
|
case 141:
|
||||||
@ -1624,7 +1624,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 173:
|
case 173:
|
||||||
if (normalizeLiterals)
|
if (normalizeLiterals)
|
||||||
textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' ');
|
textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' ');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1651,7 +1651,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
|
|
||||||
case 178:
|
case 178:
|
||||||
case 179:
|
case 179:
|
||||||
sym(1) = sym(2);
|
sym(1) = sym(2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 180:
|
case 180:
|
||||||
@ -1789,7 +1789,7 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
}
|
}
|
||||||
setType(QXmlStreamReader::EntityReference);
|
setType(QXmlStreamReader::EntityReference);
|
||||||
name = &unresolvedEntity;
|
name = &unresolvedEntity;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 240: {
|
case 240: {
|
||||||
sym(1).len += sym(2).len + 1;
|
sym(1).len += sym(2).len + 1;
|
||||||
@ -1823,10 +1823,10 @@ bool QXmlStreamReaderPrivate::parse()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
injectToken(UNRESOLVED_ENTITY);
|
injectToken(UNRESOLVED_ENTITY);
|
||||||
unresolvedEntity = symString(2).toString();
|
unresolvedEntity = symString(2).toString();
|
||||||
textBuffer.chop(2 + sym(2).len);
|
textBuffer.chop(2 + sym(2).len);
|
||||||
clearSym();
|
clearSym();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user