summaryrefslogtreecommitdiffstats
path: root/src/corelib/xml
diff options
context:
space:
mode:
authorJakub Wieczorek <faw217@gmail.com>2010-05-26 11:50:57 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-26 12:00:47 +0200
commite0dc3b88abc9c4bcd6c3710c458c4948e5b8a912 (patch)
tree0bb9c59a9629decd81bf69652c9bd4497ba50e51 /src/corelib/xml
parent058fa44c7aba859c3383f912da4f976c896f921d (diff)
QXmlStreamWriter: Auto-formatting does not behave properly with processing instructions.
When writing a processing instruction with auto-formatting enabled, it should put it in a new line for readability and apply the indentation properly. Merge-request: 620 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'src/corelib/xml')
-rw-r--r--src/corelib/xml/qxmlstream.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 1bf00b8cd9..ae12007cf9 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3716,7 +3716,8 @@ void QXmlStreamWriter::writeProcessingInstruction(const QString &target, const Q
{
Q_D(QXmlStreamWriter);
Q_ASSERT(!data.contains(QLatin1String("?>")));
- d->finishStartElement();
+ if (!d->finishStartElement(false) && d->autoFormatting)
+ d->indent(d->tagStack.size());
d->write("<?");
d->write(target);
if (!data.isNull()) {