summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-05-25 15:20:06 (GMT)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-05-25 15:34:21 (GMT)
commit7dbc1327c513823631986ecaea9b2bae8efc53fa (patch)
treef9224a51fec4c5b29e6867e559f1e853d5a5ec94 /src/xml
parentac2ea04e516fa7818cb7b4dbe7dd2619cec9fbda (diff)
downloadQt-7dbc1327c513823631986ecaea9b2bae8efc53fa.zip
Qt-7dbc1327c513823631986ecaea9b2bae8efc53fa.tar.gz
Qt-7dbc1327c513823631986ecaea9b2bae8efc53fa.tar.bz2
Fixed insertion of unnecessary spaces at the end of attribute lists
Also makes QDomDocument::toString() consistent with QXmlStreamWriter and xmlTextWriter from libxml2. Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/dom/qdom.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 550abc9..dc6ff92 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
{
@@ -4597,9 +4597,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 {
@@ -4622,7 +4622,6 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
outputtedPrefixes.insert(it.value()->prefix);
}
}
- s << ' ';
}
}