diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2023-04-21 13:36:29 +0200 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2023-04-26 12:46:06 +0200 |
commit | 55a51e19091714a0ce7af3bfe0d06d138bc04bca (patch) | |
tree | ab3e5080ec508cb99426257c44b6021d058e8a9a /src/xml | |
parent | b85a9d0ee16e3bdc817eb1e8a8f85026e631b401 (diff) |
Implement QXmlStreamReader::hasStandaloneDeclaration()
This patch implements a public getter for the hasStandalone attribute.
It returns true, if standalone has been explicitly declared in an XML
header and false otherwise.
As this is no longer necessary it removes accessing QXmlStreamPrivate
from QDomParser.
[ChangeLog][QtCore][QXmlStreamReader] added hasStandaloneDeclaration()
Change-Id: Iaaa0a728a6f7186e40637186077f7b49c112f7a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Diffstat (limited to 'src/xml')
-rw-r--r-- | src/xml/dom/qdomhelpers.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/xml/dom/qdomhelpers.cpp b/src/xml/dom/qdomhelpers.cpp index 48869907f8..0649e0c75d 100644 --- a/src/xml/dom/qdomhelpers.cpp +++ b/src/xml/dom/qdomhelpers.cpp @@ -266,8 +266,7 @@ bool QDomParser::parseProlog() value += u" standalone='yes'"_s; } else { // Add the standalone attribute only if it was specified - QXmlStreamReaderPrivate *priv = QXmlStreamReaderPrivate::get(reader); - if (priv->hasStandalone) + if (reader->hasStandaloneDeclaration()) value += u" standalone='no'"_s; } |