From 7dbc1327c513823631986ecaea9b2bae8efc53fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 25 May 2009 17:20:06 +0200 Subject: 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 --- src/xml/dom/qdom.cpp | 5 ++--- 1 file 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::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 << ' '; } } -- cgit v0.12