From 8ff197cd111a2fef784399f46bf7b7917d1b3524 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 16 Oct 2020 16:13:40 +0200 Subject: QPdf: consolidate usage of uint Objects in QPdf are indexed by uint. In a couple of places (incl. QFontSubset) int were used instead, causing sign conversion warnings (turned into errors by -Werror). Use uint instead. Change-Id: Ie0436c8aff3b67d8ef95a5f26fc16403e7e02bd1 Reviewed-by: Lars Knoll --- src/gui/painting/qpdf.cpp | 4 ++-- src/gui/painting/qpdf_p.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index d510e28c6f..0d175adaa8 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -784,7 +784,7 @@ QPdfPage::QPdfPage() { } -void QPdfPage::streamImage(int w, int h, int object) +void QPdfPage::streamImage(int w, int h, uint object) { *this << w << "0 0 " << -h << "0 " << h << "cm /Im" << object << " Do\n"; if (!images.contains(object)) @@ -2714,7 +2714,7 @@ int QPdfEnginePrivate::addConstantAlphaObject(int brushAlpha, int penAlpha) { if (brushAlpha == 255 && penAlpha == 255) return 0; - int object = alphaCache.value(QPair(brushAlpha, penAlpha), 0); + uint object = alphaCache.value(QPair(brushAlpha, penAlpha), 0); if (!object) { object = addXrefEntry(-1); QByteArray alphaDef; diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h index e775406e65..67b189a4db 100644 --- a/src/gui/painting/qpdf_p.h +++ b/src/gui/painting/qpdf_p.h @@ -86,6 +86,7 @@ namespace QPdf { ByteStream &operator <<(const ByteStream &src); ByteStream &operator <<(qreal val); ByteStream &operator <<(int val); + ByteStream &operator <<(uint val) { return (*this << int(val)); } ByteStream &operator <<(qint64 val) { return (*this << int(val)); } ByteStream &operator <<(const QPointF &p); // Note that the stream may be invalidated by calls that insert data. @@ -154,7 +155,7 @@ public: QList fonts; QList annotations; - void streamImage(int w, int h, int object); + void streamImage(int w, int h, uint object); QSize pageSize; private: -- cgit v1.2.3