summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moore <rich@kde.org>2012-02-19 13:41:31 +0000
committerQt by Nokia <qt-info@nokia.com>2012-02-20 22:06:24 +0100
commit4c05bc811c06afb718ddbf9db1a3a6cf4086cbc5 (patch)
tree907777fddfc60ba5849e4cb6a42b94a7df4de67b /src
parent451bc474075aa435e4d97496e32986b76b0f9baa (diff)
Merge overloads.
Fix a ### Qt 5 by merging the overloads. Change-Id: If33e7592191c81b32caa6d68c73dbf2282437886 Reviewed-by: David Faure <faure@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/xml/dom/qdom.cpp27
-rw-r--r--src/xml/dom/qdom.h3
2 files changed, 11 insertions, 19 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 1eaa74a730..2188b8d6ab 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -2668,23 +2668,16 @@ QDomNode QDomNode::namedItem(const QString& name) const
the stream \a str. This function uses \a indent as the amount of
space to indent the node.
- If this node is a document node, the encoding of text stream \a str's encoding is
- set by treating a processing instruction by name "xml" as an XML declaration, if such a one exists,
- and otherwise defaults to UTF-8. XML declarations are not processing instructions, but this
- behavior exists for historical reasons. If this node is not a document node,
- the text stream's encoding is used.
-
If the document contains invalid XML characters or characters that cannot be
encoded in the given encoding, the result and behavior is undefined.
-*/
-void QDomNode::save(QTextStream& str, int indent) const
-{
- save(str, indent, QDomNode::EncodingFromDocument);
-}
-
-/*!
- If \a encodingPolicy is QDomNode::EncodingFromDocument, this function behaves as save(QTextStream &str, int indent).
+ If \a encodingPolicy is QDomNode::EncodingFromDocument and this node is a
+ document node, the encoding of text stream \a str's encoding is set by
+ treating a processing instruction by name "xml" as an XML declaration, if
+ one exists, and otherwise defaults to UTF-8. XML declarations are not
+ processing instructions, but this behavior exists for historical
+ reasons. If this node is not a document node, the text stream's encoding
+ is used.
If \a encodingPolicy is EncodingFromTextStream and this node is a document node, this
function behaves as save(QTextStream &str, int indent) with the exception that the encoding
@@ -2695,15 +2688,15 @@ void QDomNode::save(QTextStream& str, int indent) const
\since 4.2
*/
-void QDomNode::save(QTextStream& str, int indent, EncodingPolicy encodingPolicy) const
+void QDomNode::save(QTextStream& stream, int indent, EncodingPolicy encodingPolicy) const
{
if (!impl)
return;
if(isDocument())
- static_cast<const QDomDocumentPrivate *>(impl)->saveDocument(str, indent, encodingPolicy);
+ static_cast<const QDomDocumentPrivate *>(impl)->saveDocument(stream, indent, encodingPolicy);
else
- IMPL->save(str, 1, indent);
+ IMPL->save(stream, 1, indent);
}
/*!
diff --git a/src/xml/dom/qdom.h b/src/xml/dom/qdom.h
index 8b049b211b..5dafb9e6a3 100644
--- a/src/xml/dom/qdom.h
+++ b/src/xml/dom/qdom.h
@@ -227,8 +227,7 @@ public:
QDomCharacterData toCharacterData() const;
QDomComment toComment() const;
- void save(QTextStream&, int) const;
- void save(QTextStream&, int, EncodingPolicy) const; // ### Qt 5: Merge overload(if we at all keep this)
+ void save(QTextStream&, int, EncodingPolicy=QDomNode::EncodingFromDocument) const;
QDomElement firstChildElement(const QString &tagName = QString()) const;
QDomElement lastChildElement(const QString &tagName = QString()) const;