summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Wieczorek <faw217@gmail.com>2010-05-26 09:50:57 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-26 10:00:47 (GMT)
commite0dc3b88abc9c4bcd6c3710c458c4948e5b8a912 (patch)
tree0bb9c59a9629decd81bf69652c9bd4497ba50e51 /src
parent058fa44c7aba859c3383f912da4f976c896f921d (diff)
downloadQt-e0dc3b88abc9c4bcd6c3710c458c4948e5b8a912.zip
Qt-e0dc3b88abc9c4bcd6c3710c458c4948e5b8a912.tar.gz
Qt-e0dc3b88abc9c4bcd6c3710c458c4948e5b8a912.tar.bz2
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')
-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 1bf00b8..ae12007 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()) {