From 3e67c1241a1915effd96d9c5b2d797f7a5d7df2a Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Wed, 26 Mar 2025 18:25:29 +0200 Subject: [PATCH] Put qxmlstreamreader code behind its feature-flag Missed feature guards from: - QXmlStreamReaderPrivate class declaration - QXmlStreamWriter::writeCurrentToken definition [*] [*] Function takes in a qxmlstreamreader. The declaration of the function already had the necessary feature guard. Pick-to: 6.8 Fixes: QTBUG-135230 Change-Id: I78741bc75a6baa8bc86ec5ce7d34a4333d8bdad4 Reviewed-by: Edward Welbourne (cherry picked from commit 90c90d50715b7e7501b0a2153122d576656b9e4d) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/serialization/qxmlstream.cpp | 4 +++- src/corelib/serialization/qxmlstream_p.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 182f3d7e1e8..88dd59a04d4 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -3880,6 +3880,7 @@ void QXmlStreamWriterPrivate::writeStartElement(QAnyStringView namespaceUri, QAn didWriteAnyToken = true; } +#if QT_CONFIG(xmlstreamreader) /*! Writes the current state of the \a reader. All possible valid states are supported. @@ -3943,8 +3944,9 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader) break; } } - +#endif // feature xmlstreamreader #endif // feature xmlstreamwriter + #if QT_CONFIG(xmlstreamreader) static constexpr bool isTokenAllowedInContext(QXmlStreamReader::TokenType type, QXmlStreamReaderPrivate::XmlContext ctxt) diff --git a/src/corelib/serialization/qxmlstream_p.h b/src/corelib/serialization/qxmlstream_p.h index a29ee656e9e..f5695dd6670 100644 --- a/src/corelib/serialization/qxmlstream_p.h +++ b/src/corelib/serialization/qxmlstream_p.h @@ -225,7 +225,7 @@ public: } }; - +#if QT_CONFIG(xmlstreamreader) class QXmlStreamEntityResolver; class QXmlStreamReaderPrivate : public QXmlStreamGrammar, public QXmlStreamPrivateTagStack { @@ -535,6 +535,7 @@ private: type = t; } }; +#endif // feature xmlstreamreader QT_END_NAMESPACE