diff options
-rw-r--r-- | src/gui/painting/qpdf.cpp | 6 | ||||
-rw-r--r-- | src/gui/painting/qpdf_p.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 2d25b5811e..61d776603c 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -2182,7 +2182,7 @@ int QPdfEnginePrivate::addXrefEntry(int object, bool printostr) return object; } -void QPdfEnginePrivate::printString(const QString &string) +void QPdfEnginePrivate::printString(QStringView string) { if (string.isEmpty()) { write("()"); @@ -2193,9 +2193,9 @@ void QPdfEnginePrivate::printString(const QString &string) // Unicode UTF-16 with a Unicode byte order mark as the first character // (0xfeff), with the high-order byte first. QByteArray array("(\xfe\xff"); - const ushort *utf16 = string.utf16(); + const char16_t *utf16 = string.utf16(); - for (int i=0; i < string.size(); ++i) { + for (qsizetype i = 0; i < string.size(); ++i) { char part[2] = {char((*(utf16 + i)) >> 8), char((*(utf16 + i)) & 0xff)}; for(int j=0; j < 2; ++j) { if (part[j] == '(' || part[j] == ')' || part[j] == '\\') diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h index 121ec4dee7..51e2ce82d5 100644 --- a/src/gui/painting/qpdf_p.h +++ b/src/gui/painting/qpdf_p.h @@ -321,7 +321,7 @@ private: void writePage(); int addXrefEntry(int object, bool printostr = true); - void printString(const QString &string); + void printString(QStringView string); void xprintf(const char* fmt, ...); inline void write(const QByteArray &data) { stream->writeRawData(data.constData(), data.size()); |