summaryrefslogtreecommitdiffstats
path: root/src/corelib/xml/qxmlstream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/xml/qxmlstream.cpp')
-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 f1487f7..1fc2a9f 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3410,11 +3410,12 @@ void QXmlStreamWriter::writeComment(const QString &text)
{
Q_D(QXmlStreamWriter);
Q_ASSERT(!text.contains(QLatin1String("--")) && !text.endsWith(QLatin1Char('-')));
- if (!d->finishStartElement() && d->autoFormatting)
+ if (!d->finishStartElement(false) && d->autoFormatting)
d->indent(d->tagStack.size());
d->write("<!--");
d->write(text);
d->write("-->");
+ d->inStartElement = d->lastWasStartElement = false;
}