QXmlStreamWriter: port Private::write(p, n) from int to qsizetype

We have at least one caller which passes QtContainer::size() as the
length, so don't truncate.

Pick-to: 6.3 6.2
Task-number: QTBUG-102465
Change-Id: I8a692bd6a7b75e745c08b072f53b6efe901d5436
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Marc Mutz 2022-05-06 01:21:20 +02:00
parent 66b62bd1ab
commit 507b9963b8

View File

@ -2850,7 +2850,7 @@ public:
void write(const XmlStringRef &); void write(const XmlStringRef &);
void write(const QString &); void write(const QString &);
void writeEscaped(const QString &, bool escapeWhitespace = false); void writeEscaped(const QString &, bool escapeWhitespace = false);
void write(const char *s, int len); void write(const char *s, qsizetype len);
template <int N> void write(const char (&s)[N]) { write(s, N - 1); } template <int N> void write(const char (&s)[N]) { write(s, N - 1); }
bool finishStartElement(bool contents = true); bool finishStartElement(bool contents = true);
void writeStartElement(const QString &namespaceUri, const QString &name); void writeStartElement(const QString &namespaceUri, const QString &name);
@ -2986,7 +2986,7 @@ void QXmlStreamWriterPrivate::writeEscaped(const QString &s, bool escapeWhitespa
} }
// Writes utf8 // Writes utf8
void QXmlStreamWriterPrivate::write(const char *s, int len) void QXmlStreamWriterPrivate::write(const char *s, qsizetype len)
{ {
if (device) { if (device) {
if (hasIoError) if (hasIoError)