diff options
Diffstat (limited to 'src/xml')
-rw-r--r-- | src/xml/dom/qdom.cpp | 7 | ||||
-rw-r--r-- | src/xml/sax/qxml.cpp | 12 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 5e2c74b..0e23f05 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -2694,7 +2694,7 @@ void QDomNode::save(QTextStream& str, int indent) const If the document contains invalid XML characters or characters that cannot be encoded in the given encoding, the result and behavior is undefined. - \since 4.2 + \since 4.2 */ void QDomNode::save(QTextStream& str, int indent, EncodingPolicy encodingPolicy) const { @@ -4594,7 +4594,7 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const qName = prefix + QLatin1Char(':') + name; nsDecl = QLatin1String(" xmlns:") + prefix; } - nsDecl += QLatin1String("=\"") + encodeText(namespaceURI, s) + QLatin1String("\""); + nsDecl += QLatin1String("=\"") + encodeText(namespaceURI, s) + QLatin1Char('\"'); } s << '<' << qName << nsDecl; @@ -4602,9 +4602,9 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const /* Write out attributes. */ if (!m_attr->map.isEmpty()) { - s << ' '; QHash<QString, QDomNodePrivate *>::const_iterator it = m_attr->map.constBegin(); for (; it != m_attr->map.constEnd(); ++it) { + s << ' '; if (it.value()->namespaceURI.isNull()) { s << it.value()->name << "=\"" << encodeText(it.value()->value, s, true, true) << '\"'; } else { @@ -4627,7 +4627,6 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const outputtedPrefixes.insert(it.value()->prefix); } } - s << ' '; } } diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index 1655642..8ad9f77 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -5469,7 +5469,7 @@ bool QXmlSimpleReaderPrivate::parsePEReference() if (skipIt) { if (contentHnd) { - if (!contentHnd->skippedEntity(QString::fromLatin1("%") + ref())) { + if (!contentHnd->skippedEntity(QLatin1Char('%') + ref())) { reportParseError(contentHnd->errorString()); return false; } @@ -5481,7 +5481,7 @@ bool QXmlSimpleReaderPrivate::parsePEReference() return false; } else if (parsePEReference_context == InDTD) { // Included as PE - if (!insertXmlRef(QString::fromLatin1(" ")+xmlRefString+QString::fromLatin1(" "), ref(), false)) + if (!insertXmlRef(QLatin1Char(' ') + xmlRefString + QLatin1Char(' '), ref(), false)) return false; } } @@ -6733,7 +6733,7 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl() if ( !entityExist(name())) { parameterEntities.insert(name(), string()); if (declHnd) { - if (!declHnd->internalEntityDecl(QString::fromLatin1("%")+name(), string())) { + if (!declHnd->internalEntityDecl(QLatin1Char('%') + name(), string())) { reportParseError(declHnd->errorString()); return false; } @@ -6745,7 +6745,7 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl() if ( !entityExist(name())) { externParameterEntities.insert(name(), QXmlSimpleReaderPrivate::ExternParameterEntity(publicId, systemId)); if (declHnd) { - if (!declHnd->externalEntityDecl(QString::fromLatin1("%")+name(), publicId, systemId)) { + if (!declHnd->externalEntityDecl(QLatin1Char('%') + name(), publicId, systemId)) { reportParseError(declHnd->errorString()); return false; } @@ -7869,8 +7869,8 @@ bool QXmlSimpleReaderPrivate::insertXmlRef(const QString &data, const QString &n { if (inLiteral) { QString tmp = data; - xmlRefStack.push(XmlRef(name, tmp.replace(QLatin1String("\""), - QLatin1String(""")).replace(QLatin1String("'"), QLatin1String("'")))); + xmlRefStack.push(XmlRef(name, tmp.replace(QLatin1Char('\"'), + QLatin1String(""")).replace(QLatin1Char('\''), QLatin1String("'")))); } else { xmlRefStack.push(XmlRef(name, data)); } |