Bugfix: LLVM compiler warnings

This commit is contained in:
Jakub Melka 2021-03-06 18:13:21 +01:00
parent 83e67979e7
commit 848e1aee3c
39 changed files with 201 additions and 175 deletions

View File

@ -496,7 +496,7 @@ PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObject
std::vector<PDFReal> captionOffset = loader.readNumberArrayFromDictionary(dictionary, "CO"); std::vector<PDFReal> captionOffset = loader.readNumberArrayFromDictionary(dictionary, "CO");
if (captionOffset.size() == 2) if (captionOffset.size() == 2)
{ {
lineAnnotation->m_captionOffset == QPointF(captionOffset[0], captionOffset[1]); lineAnnotation->m_captionOffset = QPointF(captionOffset[0], captionOffset[1]);
} }
} }
else if (subtype == "Square" || subtype == "Circle") else if (subtype == "Square" || subtype == "Circle")
@ -1056,7 +1056,7 @@ QPen PDFAnnotation::getPen() const
{ {
PDFLineDashPattern lineDashPattern(border.getDashPattern(), 0.0); PDFLineDashPattern lineDashPattern(border.getDashPattern(), 0.0);
pen.setStyle(Qt::CustomDashLine); pen.setStyle(Qt::CustomDashLine);
pen.setDashPattern(QVector<PDFReal>::fromStdVector(lineDashPattern.getDashArray())); pen.setDashPattern(QVector<qreal>(lineDashPattern.getDashArray().begin(), lineDashPattern.getDashArray().end()));
pen.setDashOffset(lineDashPattern.getDashOffset()); pen.setDashOffset(lineDashPattern.getDashOffset());
} }
@ -1562,7 +1562,7 @@ void PDFAnnotationManager::drawAnnotationUsingAppearanceStream(const PageAnnotat
if (isContentVisible && m_target == Target::View) if (isContentVisible && m_target == Target::View)
{ {
PDFPainterStateGuard guard(painter); PDFPainterStateGuard guard(painter);
painter->resetMatrix(); painter->resetTransform();
drawWidgetAnnotationHighlight(annotationRectangle, annotation.annotation.get(), painter, userSpaceToDeviceSpace); drawWidgetAnnotationHighlight(annotationRectangle, annotation.annotation.get(), painter, userSpaceToDeviceSpace);
} }
} }
@ -3518,7 +3518,7 @@ const PDFAnnotationManager::PageAnnotation* PDFAnnotationManager::PageAnnotation
if (markupAnnotation) if (markupAnnotation)
{ {
const PDFObjectReference popupAnnotation = markupAnnotation->getPopupAnnotation(); const PDFObjectReference popupAnnotation = markupAnnotation->getPopupAnnotation();
auto it = std::find_if(annotations.cbegin(), annotations.cend(), [this, popupAnnotation](const PageAnnotation& pa) { return pa.annotation->getSelfReference() == popupAnnotation; }); auto it = std::find_if(annotations.cbegin(), annotations.cend(), [popupAnnotation](const PageAnnotation& pa) { return pa.annotation->getSelfReference() == popupAnnotation; });
if (it != annotations.cend()) if (it != annotations.cend())
{ {
return &*it; return &*it;

View File

@ -753,7 +753,7 @@ public:
void setExternalData(const PDFObject& externalData); void setExternalData(const PDFObject& externalData);
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QString m_windowTitle; QString m_windowTitle;
PDFObjectReference m_popupAnnotation; PDFObjectReference m_popupAnnotation;
@ -800,7 +800,7 @@ public:
static QIcon createIcon(QString key, QSize size); static QIcon createIcon(QString key, QSize size);
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
static QString getTextForIcon(const QString& key); static QString getTextForIcon(const QString& key);
@ -835,7 +835,7 @@ public:
const PDFAnnotationQuadrilaterals& getActivationRegion() const { return m_activationRegion; } const PDFAnnotationQuadrilaterals& getActivationRegion() const { return m_activationRegion; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
PDFActionPtr m_action; PDFActionPtr m_action;
LinkHighlightMode m_highlightMode = LinkHighlightMode::Invert; LinkHighlightMode m_highlightMode = LinkHighlightMode::Invert;
@ -878,7 +878,7 @@ public:
AnnotationLineEnding getEndLineEnding() const { return m_endLineEnding; } AnnotationLineEnding getEndLineEnding() const { return m_endLineEnding; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QByteArray m_defaultAppearance; QByteArray m_defaultAppearance;
Justification m_justification = Justification::Left; Justification m_justification = Justification::Left;
@ -931,7 +931,7 @@ protected:
virtual QColor getFillColor() const override; virtual QColor getFillColor() const override;
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QLineF m_line; QLineF m_line;
AnnotationLineEnding m_startLineEnding = AnnotationLineEnding::None; AnnotationLineEnding m_startLineEnding = AnnotationLineEnding::None;
@ -971,7 +971,7 @@ protected:
virtual QColor getFillColor() const override; virtual QColor getFillColor() const override;
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
AnnotationType m_type; AnnotationType m_type;
std::vector<PDFReal> m_interiorColor; std::vector<PDFReal> m_interiorColor;
@ -1015,7 +1015,7 @@ protected:
virtual QColor getFillColor() const override; virtual QColor getFillColor() const override;
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
AnnotationType m_type; AnnotationType m_type;
std::vector<QPointF> m_vertices; std::vector<QPointF> m_vertices;
@ -1045,7 +1045,7 @@ public:
const PDFAnnotationQuadrilaterals& getHiglightArea() const { return m_highlightArea; } const PDFAnnotationQuadrilaterals& getHiglightArea() const { return m_highlightArea; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
AnnotationType m_type; AnnotationType m_type;
PDFAnnotationQuadrilaterals m_highlightArea; PDFAnnotationQuadrilaterals m_highlightArea;
@ -1070,7 +1070,7 @@ public:
Symbol getSymbol() const { return m_symbol; } Symbol getSymbol() const { return m_symbol; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QRectF m_caretRectangle; QRectF m_caretRectangle;
Symbol m_symbol = Symbol::None; Symbol m_symbol = Symbol::None;
@ -1120,7 +1120,7 @@ public:
static QString getText(Stamp stamp); static QString getText(Stamp stamp);
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
Stamp m_stamp = Stamp::Draft; Stamp m_stamp = Stamp::Draft;
StampIntent m_intent = StampIntent::Stamp; StampIntent m_intent = StampIntent::Stamp;
@ -1138,7 +1138,7 @@ public:
const QPainterPath& getInkPath() const { return m_inkPath; } const QPainterPath& getInkPath() const { return m_inkPath; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QPainterPath m_inkPath; QPainterPath m_inkPath;
}; };
@ -1156,7 +1156,7 @@ public:
bool isOpened() const { return m_opened; } bool isOpened() const { return m_opened; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
bool m_opened = false; bool m_opened = false;
}; };
@ -1184,7 +1184,7 @@ public:
FileAttachmentIcon getIcon() const { return m_icon; } FileAttachmentIcon getIcon() const { return m_icon; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
PDFFileSpecification m_fileSpecification; PDFFileSpecification m_fileSpecification;
FileAttachmentIcon m_icon = FileAttachmentIcon::PushPin; FileAttachmentIcon m_icon = FileAttachmentIcon::PushPin;
@ -1210,7 +1210,7 @@ public:
Icon getIcon() const { return m_icon; } Icon getIcon() const { return m_icon; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
PDFSound m_sound; PDFSound m_sound;
Icon m_icon = Icon::Speaker; Icon m_icon = Icon::Speaker;
@ -1231,7 +1231,7 @@ public:
const PDFMovieActivation& getMovieActivation() const { return m_movieActivation; } const PDFMovieActivation& getMovieActivation() const { return m_movieActivation; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QString m_movieTitle; QString m_movieTitle;
bool m_playMovie = true; bool m_playMovie = true;
@ -1254,7 +1254,7 @@ public:
const PDFAnnotationAdditionalActions& getAdditionalActions() const { return m_additionalActions; } const PDFAnnotationAdditionalActions& getAdditionalActions() const { return m_additionalActions; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QString m_screenTitle; QString m_screenTitle;
PDFAnnotationAppearanceCharacteristics m_appearanceCharacteristics; PDFAnnotationAppearanceCharacteristics m_appearanceCharacteristics;
@ -1289,7 +1289,7 @@ public:
const PDFAnnotationAdditionalActions& getAdditionalActions() const { return m_additionalActions; } const PDFAnnotationAdditionalActions& getAdditionalActions() const { return m_additionalActions; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
HighlightMode m_highlightMode = HighlightMode::Invert; HighlightMode m_highlightMode = HighlightMode::Invert;
PDFAnnotationAppearanceCharacteristics m_appearanceCharacteristics; PDFAnnotationAppearanceCharacteristics m_appearanceCharacteristics;
@ -1331,7 +1331,7 @@ public:
PDFReal getRelativeVerticalOffset() const { return m_relativeVerticalOffset; } PDFReal getRelativeVerticalOffset() const { return m_relativeVerticalOffset; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
QMatrix m_matrix; QMatrix m_matrix;
PDFReal m_relativeHorizontalOffset = 0.0; PDFReal m_relativeHorizontalOffset = 0.0;
@ -1360,7 +1360,7 @@ protected:
virtual QColor getFillColor() const override; virtual QColor getFillColor() const override;
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
PDFAnnotationQuadrilaterals m_redactionRegion; PDFAnnotationQuadrilaterals m_redactionRegion;
std::vector<PDFReal> m_interiorColor; std::vector<PDFReal> m_interiorColor;
@ -1379,7 +1379,7 @@ public:
virtual AnnotationType getType() const override { return AnnotationType::Projection; } virtual AnnotationType getType() const override { return AnnotationType::Projection; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
}; };
/// 3D annotations represents 3D scene, which can be viewed in the application. /// 3D annotations represents 3D scene, which can be viewed in the application.
@ -1397,7 +1397,7 @@ public:
QRectF getViewBox() const { return m_viewBox; } QRectF getViewBox() const { return m_viewBox; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
PDF3DStream m_stream; PDF3DStream m_stream;
std::optional<PDF3DView> m_defaultView; std::optional<PDF3DView> m_defaultView;
@ -1421,7 +1421,7 @@ public:
const PDFRichMediaSettings* getSettings() const { return &m_settings; } const PDFRichMediaSettings* getSettings() const { return &m_settings; }
private: private:
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference); friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
PDFRichMediaContent m_content; PDFRichMediaContent m_content;
PDFRichMediaSettings m_settings; PDFRichMediaSettings m_settings;

View File

@ -261,7 +261,7 @@ PDFCatalog PDFCatalog::parse(const PDFObject& catalog, const PDFDocument* docume
auto getObject = [](const PDFObjectStorage*, PDFObject object) auto getObject = [](const PDFObjectStorage*, PDFObject object)
{ {
return qMove(object); return object;
}; };
catalogObject.m_namedDestinations = PDFNameTreeLoader<PDFDestination>::parse(&document->getStorage(), namesDictionary->get("Dests"), parseDestination); catalogObject.m_namedDestinations = PDFNameTreeLoader<PDFDestination>::parse(&document->getStorage(), namesDictionary->get("Dests"), parseDestination);

View File

@ -94,6 +94,11 @@ public:
/// Comparison operator, works only with page indices (because they should be unique) /// Comparison operator, works only with page indices (because they should be unique)
bool operator<(const PDFPageLabel& other) const { return m_pageIndex < other.m_pageIndex; } bool operator<(const PDFPageLabel& other) const { return m_pageIndex < other.m_pageIndex; }
NumberingStyle getNumberingStyle() const { return m_numberingType; }
const QString& getPrefix() const { return m_prefix; }
PDFInteger getPageIndex() const { return m_pageIndex; }
PDFInteger getPageStartNumber() const { return m_startNumber; }
/// Parses page label object from PDF object, according to PDF Reference 1.7, Table 8.10 /// Parses page label object from PDF object, according to PDF Reference 1.7, Table 8.10
static PDFPageLabel parse(PDFInteger pageIndex, const PDFObjectStorage* storage, const PDFObject& object); static PDFPageLabel parse(PDFInteger pageIndex, const PDFObjectStorage* storage, const PDFObject& object);
@ -196,13 +201,13 @@ public:
EndProperties EndProperties
}; };
constexpr inline PDFViewerPreferences() = default; inline PDFViewerPreferences() = default;
constexpr inline PDFViewerPreferences(const PDFViewerPreferences&) = default; inline PDFViewerPreferences(const PDFViewerPreferences&) = default;
constexpr inline PDFViewerPreferences(PDFViewerPreferences&&) = default; inline PDFViewerPreferences(PDFViewerPreferences&&) = default;
constexpr inline PDFViewerPreferences& operator=(const PDFViewerPreferences&) = default; inline PDFViewerPreferences& operator=(const PDFViewerPreferences&) = default;
constexpr inline PDFViewerPreferences& operator=(PDFViewerPreferences&&) = default; inline PDFViewerPreferences& operator=(PDFViewerPreferences&&) = default;
/// Parses viewer preferences from catalog dictionary. If object cannot be parsed, or error occurs, /// Parses viewer preferences from catalog dictionary. If object cannot be parsed, or error occurs,
/// then exception is thrown. /// then exception is thrown.
@ -561,13 +566,13 @@ private:
class Pdf4QtLIBSHARED_EXPORT PDFCatalog class Pdf4QtLIBSHARED_EXPORT PDFCatalog
{ {
public: public:
constexpr inline PDFCatalog() = default; inline PDFCatalog() = default;
constexpr inline PDFCatalog(const PDFCatalog&) = default; inline PDFCatalog(const PDFCatalog&) = default;
constexpr inline PDFCatalog(PDFCatalog&&) = default; inline PDFCatalog(PDFCatalog&&) = default;
constexpr inline PDFCatalog& operator=(const PDFCatalog&) = default; inline PDFCatalog& operator=(const PDFCatalog&) = default;
constexpr inline PDFCatalog& operator=(PDFCatalog&&) = default; inline PDFCatalog& operator=(PDFCatalog&&) = default;
static constexpr const size_t INVALID_PAGE_INDEX = std::numeric_limits<size_t>::max(); static constexpr const size_t INVALID_PAGE_INDEX = std::numeric_limits<size_t>::max();

View File

@ -24,6 +24,7 @@
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:5033) #pragma warning(disable:5033)
#define CMS_NO_REGISTER_KEYWORD
#include <lcms2.h> #include <lcms2.h>
#pragma warning(pop) #pragma warning(pop)
@ -708,7 +709,7 @@ cmsHPROFILE PDFLittleCMS::createProfile(const QString& id, const PDFColorProfile
if (!identifier.isOutputIntentProfile) if (!identifier.isOutputIntentProfile)
{ {
// Find first output intent color profile // Find first output intent color profile
auto itOutputIntentColorProfile = std::find_if(profileDescriptors.cbegin(), profileDescriptors.cend(), [&id](const PDFColorProfileIdentifier& identifier) { return identifier.isOutputIntentProfile; }); auto itOutputIntentColorProfile = std::find_if(profileDescriptors.cbegin(), profileDescriptors.cend(), [](const PDFColorProfileIdentifier& identifier) { return identifier.isOutputIntentProfile; });
if (itOutputIntentColorProfile != profileDescriptors.end()) if (itOutputIntentColorProfile != profileDescriptors.end())
{ {
it = itOutputIntentColorProfile; it = itOutputIntentColorProfile;
@ -1215,8 +1216,8 @@ bool PDFCMSGeneric::transformColorSpace(const PDFCMS::ColorSpaceTransformParams&
PDFCMSManager::PDFCMSManager(QObject* parent) : PDFCMSManager::PDFCMSManager(QObject* parent) :
BaseClass(parent), BaseClass(parent),
m_mutex(QMutex::Recursive), m_document(nullptr),
m_document(nullptr) m_mutex(QMutex::Recursive)
{ {
} }

View File

@ -377,7 +377,7 @@ PDFTextSelection PDFAsynchronousTextLayoutCompiler::getTextSelectionAll(QColor c
QMutex mutex; QMutex mutex;
PDFIntegerRange<size_t> pageRange(0, textLayouts.getCount()); PDFIntegerRange<size_t> pageRange(0, textLayouts.getCount());
auto selectPageText = [this, &mutex, &textLayouts, &result, color](PDFInteger pageIndex) auto selectPageText = [&mutex, &textLayouts, &result, color](PDFInteger pageIndex)
{ {
PDFTextLayout textLayout = textLayouts.getTextLayout(pageIndex); PDFTextLayout textLayout = textLayouts.getTextLayout(pageIndex);
PDFTextSelectionItems items; PDFTextSelectionItems items;

View File

@ -363,9 +363,8 @@ std::vector<PDFReal> PDFDocumentDataLoaderDecorator::readNumberArray(const PDFOb
result.push_back(number); result.push_back(number);
} }
// We assume, that RVO (return value optimization) will not work for this function // We assume, that RVO (return value optimization) will work
// (multiple return points). return result;
return std::move(result);
} }
return defaultValue; return defaultValue;
@ -386,7 +385,7 @@ std::vector<PDFInteger> PDFDocumentDataLoaderDecorator::readIntegerArray(const P
// This value is not representable in the current PDF parser. So we assume we // This value is not representable in the current PDF parser. So we assume we
// can't get this value. // can't get this value.
constexpr const PDFInteger INVALID_VALUE = std::numeric_limits<PDFInteger>::max(); constexpr const PDFInteger INVALID_VALUE = std::numeric_limits<PDFInteger>::max();
const PDFReal number = readInteger(array->getItem(i), INVALID_VALUE); const PDFInteger number = readInteger(array->getItem(i), INVALID_VALUE);
if (number == INVALID_VALUE) if (number == INVALID_VALUE)
{ {
return std::vector<PDFInteger>(); return std::vector<PDFInteger>();
@ -394,9 +393,8 @@ std::vector<PDFInteger> PDFDocumentDataLoaderDecorator::readIntegerArray(const P
result.push_back(number); result.push_back(number);
} }
// We assume, that RVO (return value optimization) will not work for this function // We assume, that RVO (return value optimization) will work
// (multiple return points). return result;
return std::move(result);
} }
return std::vector<PDFInteger>(); return std::vector<PDFInteger>();
@ -448,9 +446,8 @@ std::vector<PDFObjectReference> PDFDocumentDataLoaderDecorator::readReferenceArr
} }
} }
// We assume, that RVO (return value optimization) will not work for this function // We assume, that RVO (return value optimization) will work
// (multiple return points). return result;
return std::move(result);
} }
return std::vector<PDFObjectReference>(); return std::vector<PDFObjectReference>();
@ -480,9 +477,8 @@ std::vector<QByteArray> PDFDocumentDataLoaderDecorator::readNameArray(const PDFO
} }
} }
// We assume, that RVO (return value optimization) will not work for this function // We assume, that RVO (return value optimization) will work
// (multiple return points). return result;
return std::move(result);
} }
return std::vector<QByteArray>(); return std::vector<QByteArray>();
@ -619,9 +615,8 @@ std::vector<QByteArray> PDFDocumentDataLoaderDecorator::readStringArray(const PD
} }
} }
// We assume, that RVO (return value optimization) will not work for this function // We assume, that RVO (return value optimization) will work
// (multiple return points). return result;
return std::move(result);
} }
return std::vector<QByteArray>(); return std::vector<QByteArray>();

View File

@ -41,13 +41,13 @@ class PDFDocumentBuilder;
class PDFObjectStorage class PDFObjectStorage
{ {
public: public:
constexpr inline PDFObjectStorage() = default; inline PDFObjectStorage() = default;
constexpr inline PDFObjectStorage(const PDFObjectStorage&) = default; inline PDFObjectStorage(const PDFObjectStorage&) = default;
constexpr inline PDFObjectStorage(PDFObjectStorage&&) = default; inline PDFObjectStorage(PDFObjectStorage&&) = default;
constexpr inline PDFObjectStorage& operator=(const PDFObjectStorage&) = default; inline PDFObjectStorage& operator=(const PDFObjectStorage&) = default;
constexpr inline PDFObjectStorage& operator=(PDFObjectStorage&&) = default; inline PDFObjectStorage& operator=(PDFObjectStorage&&) = default;
bool operator==(const PDFObjectStorage& other) const; bool operator==(const PDFObjectStorage& other) const;
bool operator!=(const PDFObjectStorage& other) const { return !(*this == other); } bool operator!=(const PDFObjectStorage& other) const { return !(*this == other); }

View File

@ -394,8 +394,8 @@ PDFDrawWidgetProxy::PDFDrawWidgetProxy(QObject* parent) :
m_horizontalOffset(0), m_horizontalOffset(0),
m_controller(nullptr), m_controller(nullptr),
m_widget(nullptr), m_widget(nullptr),
m_horizontalScrollbar(nullptr),
m_verticalScrollbar(nullptr), m_verticalScrollbar(nullptr),
m_horizontalScrollbar(nullptr),
m_features(PDFRenderer::getDefaultFeatures()), m_features(PDFRenderer::getDefaultFeatures()),
m_compiler(new PDFAsynchronousPageCompiler(this)), m_compiler(new PDFAsynchronousPageCompiler(this)),
m_textLayoutCompiler(new PDFAsynchronousTextLayoutCompiler(this)), m_textLayoutCompiler(new PDFAsynchronousTextLayoutCompiler(this)),
@ -878,7 +878,7 @@ std::vector<PDFInteger> PDFDrawWidgetProxy::getPagesIntersectingRect(QRect rect)
pages.push_back(item.pageIndex); pages.push_back(item.pageIndex);
} }
} }
qSort(pages); std::sort(pages.begin(), pages.end());
return pages; return pages;
} }

View File

@ -373,9 +373,11 @@ public:
class PDFRealizedType3FontImpl : public IRealizedFontImpl class PDFRealizedType3FontImpl : public IRealizedFontImpl
{ {
public: public:
explicit PDFRealizedType3FontImpl(PDFFontPointer parentFont, PDFReal pixelSize) : m_parentFont(parentFont), m_pixelSize(pixelSize) { } explicit PDFRealizedType3FontImpl(PDFFontPointer parentFont, PDFReal pixelSize) : m_pixelSize(pixelSize), m_parentFont(parentFont) { }
virtual ~PDFRealizedType3FontImpl() override = default; virtual ~PDFRealizedType3FontImpl() override = default;
PDFReal getPixelSize() const { return m_pixelSize; }
virtual void fillTextSequence(const QByteArray& byteArray, TextSequence& textSequence, PDFRenderErrorReporter* reporter) override; virtual void fillTextSequence(const QByteArray& byteArray, TextSequence& textSequence, PDFRenderErrorReporter* reporter) override;
virtual bool isHorizontalWritingSystem() const override; virtual bool isHorizontalWritingSystem() const override;
virtual CharacterInfos getCharacterInfos() const override; virtual CharacterInfos getCharacterInfos() const override;
@ -1942,7 +1944,7 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data)
return std::pair<unsigned int, unsigned int>(); return std::pair<unsigned int, unsigned int>();
}; };
auto fetchCID = [&parser] (const PDFLexicalAnalyzer::Token& currentToken) -> CID auto fetchCID = [] (const PDFLexicalAnalyzer::Token& currentToken) -> CID
{ {
if (currentToken.type == PDFLexicalAnalyzer::TokenType::Integer) if (currentToken.type == PDFLexicalAnalyzer::TokenType::Integer)
{ {
@ -1953,7 +1955,7 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data)
return 0; return 0;
}; };
auto fetchUnicode = [&parser](const PDFLexicalAnalyzer::Token& currentToken) -> CID auto fetchUnicode = [](const PDFLexicalAnalyzer::Token& currentToken) -> CID
{ {
if (currentToken.type == PDFLexicalAnalyzer::TokenType::String) if (currentToken.type == PDFLexicalAnalyzer::TokenType::String)
{ {

View File

@ -484,7 +484,7 @@ private:
class Pdf4QtLIBSHARED_EXPORT PDFFontCMap class Pdf4QtLIBSHARED_EXPORT PDFFontCMap
{ {
public: public:
constexpr explicit PDFFontCMap() = default; explicit PDFFontCMap() = default;
/// Returns true, if mapping is valid /// Returns true, if mapping is valid
bool isValid() const { return !m_entries.empty(); } bool isValid() const { return !m_entries.empty(); }

View File

@ -273,7 +273,7 @@ public:
void initializeTextEdit(PDFTextEditPseudowidget* textEdit) const; void initializeTextEdit(PDFTextEditPseudowidget* textEdit) const;
protected: protected:
virtual void setFocusImpl(bool focused); virtual void setFocusImpl(bool focused) override;
private: private:
PDFTextEditPseudowidget m_textEdit; PDFTextEditPseudowidget m_textEdit;
@ -446,7 +446,7 @@ public:
void initializeListBox(PDFListBoxPseudowidget* listBox) const; void initializeListBox(PDFListBoxPseudowidget* listBox) const;
protected: protected:
virtual void setFocusImpl(bool focused); virtual void setFocusImpl(bool focused) override;
private: private:
static PDFFormField::FieldFlags getTextEditFlags(PDFFormField::FieldFlags flags); static PDFFormField::FieldFlags getTextEditFlags(PDFFormField::FieldFlags flags);
@ -489,7 +489,7 @@ public:
void initializeListBox(PDFListBoxPseudowidget* listBox) const; void initializeListBox(PDFListBoxPseudowidget* listBox) const;
protected: protected:
virtual void setFocusImpl(bool focused); virtual void setFocusImpl(bool focused) override;
private: private:
/// Returns list of selected items parsed from the object. /// Returns list of selected items parsed from the object.

View File

@ -315,7 +315,7 @@ public:
virtual void resetValue(const ResetValueParameters& parameters) override; virtual void resetValue(const ResetValueParameters& parameters) override;
private: private:
friend static PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField); friend PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField);
/// List of export names of 'On' state for radio buttons. In widget annotation's appearance /// List of export names of 'On' state for radio buttons. In widget annotation's appearance
/// dictionaries, state names are computer generated numbers (for example /1, /3, ...), /// dictionaries, state names are computer generated numbers (for example /1, /3, ...),
@ -340,7 +340,7 @@ public:
virtual void resetValue(const ResetValueParameters& parameters) override; virtual void resetValue(const ResetValueParameters& parameters) override;
private: private:
friend static PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField); friend PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField);
/// Maximal length of text in the field. If zero, /// Maximal length of text in the field. If zero,
/// no maximal length is specified. /// no maximal length is specified.
@ -387,7 +387,7 @@ public:
virtual void reloadValue(const PDFObjectStorage* storage, PDFObject parentValue) override; virtual void reloadValue(const PDFObjectStorage* storage, PDFObject parentValue) override;
private: private:
friend static PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField); friend PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField);
Options m_options; Options m_options;
PDFInteger m_topIndex; PDFInteger m_topIndex;
@ -402,7 +402,7 @@ public:
const PDFSignature& getSignature() const { return m_signature; } const PDFSignature& getSignature() const { return m_signature; }
private: private:
friend static PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField); friend PDFFormFieldPointer PDFFormField::parse(const PDFObjectStorage* storage, PDFObjectReference reference, PDFFormField* parentField);
PDFSignature m_signature; PDFSignature m_signature;
}; };

View File

@ -688,7 +688,7 @@ QVariant PDFThumbnailsItemModel::data(const QModelIndex& index, int role) const
QString key = getKey(index.row()); QString key = getKey(index.row());
QPixmap pixmap; QPixmap pixmap;
if (!m_thumbnailCache.find(key, pixmap)) if (!m_thumbnailCache.find(key, &pixmap))
{ {
QImage thumbnail = m_proxy->drawThumbnailImage(index.row(), m_thumbnailSize); QImage thumbnail = m_proxy->drawThumbnailImage(index.row(), m_thumbnailSize);
if (!thumbnail.isNull()) if (!thumbnail.isNull())

View File

@ -32,7 +32,7 @@ PDFJavaScriptScanner::Entries PDFJavaScriptScanner::scan(const std::vector<PDFIn
{ {
Entries result; Entries result;
auto scanAction = [this, options, &result](PDFJavaScriptEntry::Type type, PDFInteger pageIndex, const PDFAction* action) auto scanAction = [options, &result](PDFJavaScriptEntry::Type type, PDFInteger pageIndex, const PDFAction* action)
{ {
if (!result.empty() && options.testFlag(FindFirstOnly)) if (!result.empty() && options.testFlag(FindFirstOnly))
{ {
@ -79,7 +79,7 @@ PDFJavaScriptScanner::Entries PDFJavaScriptScanner::scan(const std::vector<PDFIn
} }
}; };
auto scanContainer = [this, options, &scanAction](PDFJavaScriptEntry::Type type, PDFInteger pageIndex, const auto& container) auto scanContainer = [&scanAction](PDFJavaScriptEntry::Type type, PDFInteger pageIndex, const auto& container)
{ {
for (const PDFActionPtr& action : container) for (const PDFActionPtr& action : container)
{ {
@ -107,7 +107,7 @@ PDFJavaScriptScanner::Entries PDFJavaScriptScanner::scan(const std::vector<PDFIn
PDFForm form = PDFForm::parse(m_document, catalog->getFormObject()); PDFForm form = PDFForm::parse(m_document, catalog->getFormObject());
if (form.isAcroForm() || form.isXFAForm()) if (form.isAcroForm() || form.isXFAForm())
{ {
auto fillActions = [this, &scanContainer](const PDFFormField* formField) auto fillActions = [&scanContainer](const PDFFormField* formField)
{ {
scanContainer(PDFJavaScriptEntry::Type::Form, -1, formField->getActions().getActions()); scanContainer(PDFJavaScriptEntry::Type::Form, -1, formField->getActions().getActions());
}; };
@ -188,7 +188,7 @@ PDFJavaScriptScanner::Entries PDFJavaScriptScanner::scan(const std::vector<PDFIn
} }
} }
qSort(result); std::sort(result.begin(), result.end());
if (options.testFlag(Optimize)) if (options.testFlag(Optimize))
{ {
result.erase(std::unique(result.begin(), result.end()), result.end()); result.erase(std::unique(result.begin(), result.end()), result.end());

View File

@ -2196,6 +2196,7 @@ void PDFJBIG2Decoder::processPatternDictionary(const PDFJBIG2SegmentHeader& head
} }
} }
int8_t gbat0_x = -static_cast<int8_t>(HDPW);
PDFJBIG2BitmapDecodingParameters parameters; PDFJBIG2BitmapDecodingParameters parameters;
parameters.MMR = HDMMR; parameters.MMR = HDMMR;
parameters.GBW = (GRAYMAX + 1) * HDPW; parameters.GBW = (GRAYMAX + 1) * HDPW;
@ -2203,7 +2204,7 @@ void PDFJBIG2Decoder::processPatternDictionary(const PDFJBIG2SegmentHeader& head
parameters.GBTEMPLATE = HDTEMPLATE; parameters.GBTEMPLATE = HDTEMPLATE;
parameters.TPGDON = false; parameters.TPGDON = false;
parameters.SKIP = nullptr; parameters.SKIP = nullptr;
parameters.GBAT[0] = { -static_cast<int8_t>(HDPW), 0 }; parameters.GBAT[0] = { gbat0_x, 0 };
parameters.GBAT[1] = { -3, -1 }; parameters.GBAT[1] = { -3, -1 };
parameters.GBAT[2] = { 2, -2 }; parameters.GBAT[2] = { 2, -2 };
parameters.GBAT[3] = { -2, -2 }; parameters.GBAT[3] = { -2, -2 };
@ -2363,6 +2364,7 @@ void PDFJBIG2Decoder::processHalftoneRegion(const PDFJBIG2SegmentHeader& header)
} }
/* Annex C5 decoding procedure */ /* Annex C5 decoding procedure */
const int8_t gbat0_x = ((HTEMPLATE <= 1) ? 3 : 2);
PDFJBIG2BitmapDecodingParameters parameters; PDFJBIG2BitmapDecodingParameters parameters;
parameters.MMR = HMMR; parameters.MMR = HMMR;
parameters.GBW = HGW; parameters.GBW = HGW;
@ -2370,7 +2372,7 @@ void PDFJBIG2Decoder::processHalftoneRegion(const PDFJBIG2SegmentHeader& header)
parameters.GBTEMPLATE = HTEMPLATE; parameters.GBTEMPLATE = HTEMPLATE;
parameters.SKIP = HENABLESKIP ? &HSKIP : nullptr; parameters.SKIP = HENABLESKIP ? &HSKIP : nullptr;
parameters.TPGDON = false; parameters.TPGDON = false;
parameters.GBAT[0] = { ((HTEMPLATE <= 1) ? 3 : 2), -1 }; parameters.GBAT[0] = { gbat0_x, -1 };
parameters.GBAT[1] = { -3, -1 }; parameters.GBAT[1] = { -3, -1 };
parameters.GBAT[2] = { 2, -2 }; parameters.GBAT[2] = { 2, -2 };
parameters.GBAT[3] = { -2, -2 }; parameters.GBAT[3] = { -2, -2 };
@ -2661,6 +2663,8 @@ void PDFJBIG2Decoder::processPageInformation(const PDFJBIG2SegmentHeader&)
const uint8_t flags = m_reader.readUnsignedByte(); const uint8_t flags = m_reader.readUnsignedByte();
const uint16_t striping = m_reader.readUnsignedWord(); const uint16_t striping = m_reader.readUnsignedWord();
Q_UNUSED(striping);
m_pageDefaultPixelValue = (flags & 0x04) ? 0xFF : 0x00; m_pageDefaultPixelValue = (flags & 0x04) ? 0xFF : 0x00;
m_pageDefaultCompositionOperatorOverriden = (flags & 0x40); m_pageDefaultCompositionOperatorOverriden = (flags & 0x40);

View File

@ -84,6 +84,7 @@ public:
static PDFMediaOffset parse(const PDFObjectStorage* storage, PDFObject object); static PDFMediaOffset parse(const PDFObjectStorage* storage, PDFObject object);
Type getType() const { return m_type; }
const TimeData* getTimeData() const { return std::holds_alternative<TimeData>(m_data) ? &std::get<TimeData>(m_data) : nullptr; } const TimeData* getTimeData() const { return std::holds_alternative<TimeData>(m_data) ? &std::get<TimeData>(m_data) : nullptr; }
const FrameData* getFrameData() const { return std::holds_alternative<FrameData>(m_data) ? &std::get<FrameData>(m_data) : nullptr; } const FrameData* getFrameData() const { return std::holds_alternative<FrameData>(m_data) ? &std::get<FrameData>(m_data) : nullptr; }
const MarkerData* getMarkerData() const { return std::holds_alternative<MarkerData>(m_data) ? &std::get<MarkerData>(m_data) : nullptr; } const MarkerData* getMarkerData() const { return std::holds_alternative<MarkerData>(m_data) ? &std::get<MarkerData>(m_data) : nullptr; }
@ -152,8 +153,8 @@ public:
std::vector<PDFMediaPlayer>&& playersAlternate, std::vector<PDFMediaPlayer>&& playersAlternate,
std::vector<PDFMediaPlayer>&& playersNeverUsed) : std::vector<PDFMediaPlayer>&& playersNeverUsed) :
m_playersMustUsed(qMove(playersMustUsed)), m_playersMustUsed(qMove(playersMustUsed)),
m_playersNeverUsed(qMove(playersNeverUsed)), m_playersAlternate(qMove(playersAlternate)),
m_playersAlternate(qMove(playersAlternate)) m_playersNeverUsed(qMove(playersNeverUsed))
{ {
} }
@ -399,6 +400,10 @@ public:
static PDFMediaMinimumScreenSize parse(const PDFObjectStorage* storage, PDFObject object); static PDFMediaMinimumScreenSize parse(const PDFObjectStorage* storage, PDFObject object);
PDFInteger getMinimumWidth() const { return m_minimumWidth; }
PDFInteger getMinimumHeight() const { return m_minimumHeight; }
PDFInteger getMonitorSpecifier() const { return m_monitorSpecifier; }
private: private:
PDFInteger m_minimumWidth; PDFInteger m_minimumWidth;
PDFInteger m_minimumHeight; PDFInteger m_minimumHeight;

View File

@ -132,12 +132,12 @@ public:
inline ~PDFInplaceOrMemoryString() = default; inline ~PDFInplaceOrMemoryString() = default;
// Enforce default copy constructor and default move constructor // Enforce default copy constructor and default move constructor
constexpr inline PDFInplaceOrMemoryString(const PDFInplaceOrMemoryString&) = default; inline PDFInplaceOrMemoryString(const PDFInplaceOrMemoryString&) = default;
constexpr inline PDFInplaceOrMemoryString(PDFInplaceOrMemoryString&&) = default; inline PDFInplaceOrMemoryString(PDFInplaceOrMemoryString&&) = default;
// Enforce default copy assignment operator and move assignment operator // Enforce default copy assignment operator and move assignment operator
constexpr inline PDFInplaceOrMemoryString& operator=(const PDFInplaceOrMemoryString&) = default; inline PDFInplaceOrMemoryString& operator=(const PDFInplaceOrMemoryString&) = default;
constexpr inline PDFInplaceOrMemoryString& operator=(PDFInplaceOrMemoryString&&) = default; inline PDFInplaceOrMemoryString& operator=(PDFInplaceOrMemoryString&&) = default;
bool equals(const char* value, size_t length) const; bool equals(const char* value, size_t length) const;
@ -183,8 +183,8 @@ public:
// Default constructor should be constexpr // Default constructor should be constexpr
constexpr inline PDFObject() : constexpr inline PDFObject() :
m_type(Type::Null), m_data(),
m_data() m_type(Type::Null)
{ {
} }
@ -193,12 +193,12 @@ public:
inline ~PDFObject() = default; inline ~PDFObject() = default;
// Enforce default copy constructor and default move constructor // Enforce default copy constructor and default move constructor
constexpr inline PDFObject(const PDFObject&) = default; inline PDFObject(const PDFObject&) = default;
constexpr inline PDFObject(PDFObject&&) = default; inline PDFObject(PDFObject&&) = default;
// Enforce default copy assignment operator and move assignment operator // Enforce default copy assignment operator and move assignment operator
constexpr inline PDFObject& operator=(const PDFObject&) = default; inline PDFObject& operator=(const PDFObject&) = default;
constexpr inline PDFObject& operator=(PDFObject&&) = default; inline PDFObject& operator=(PDFObject&&) = default;
inline Type getType() const { return m_type; } inline Type getType() const { return m_type; }
@ -268,7 +268,7 @@ public:
private: private:
template<typename T> template<typename T>
constexpr inline PDFObject(Type type, T&& value) : inline PDFObject(Type type, T&& value) :
m_data(std::forward<T>(value)), m_data(std::forward<T>(value)),
m_type(type) m_type(type)
{ {
@ -310,7 +310,7 @@ private:
class PDFArray : public PDFObjectContent class PDFArray : public PDFObjectContent
{ {
public: public:
inline constexpr PDFArray() = default; inline PDFArray() = default;
inline PDFArray(std::vector<PDFObject>&& objects) : m_objects(qMove(objects)) { } inline PDFArray(std::vector<PDFObject>&& objects) : m_objects(qMove(objects)) { }
virtual ~PDFArray() override = default; virtual ~PDFArray() override = default;
@ -354,7 +354,7 @@ class Pdf4QtLIBSHARED_EXPORT PDFDictionary : public PDFObjectContent
public: public:
using DictionaryEntry = std::pair<PDFInplaceOrMemoryString, PDFObject>; using DictionaryEntry = std::pair<PDFInplaceOrMemoryString, PDFObject>;
inline constexpr PDFDictionary() = default; inline PDFDictionary() = default;
inline PDFDictionary(std::vector<DictionaryEntry>&& dictionary) : m_dictionary(qMove(dictionary)) { } inline PDFDictionary(std::vector<DictionaryEntry>&& dictionary) : m_dictionary(qMove(dictionary)) { }
virtual ~PDFDictionary() override = default; virtual ~PDFDictionary() override = default;
@ -453,7 +453,7 @@ private:
class PDFStream : public PDFObjectContent class PDFStream : public PDFObjectContent
{ {
public: public:
inline explicit constexpr PDFStream() = default; inline explicit PDFStream() = default;
inline explicit PDFStream(PDFDictionary&& dictionary, QByteArray&& content) : inline explicit PDFStream(PDFDictionary&& dictionary, QByteArray&& content) :
m_dictionary(std::move(dictionary)), m_dictionary(std::move(dictionary)),
m_content(std::move(content)) m_content(std::move(content))

View File

@ -45,6 +45,15 @@ enum ObjectEditorAttributeType
struct PDFObjectEditorModelAttributeEnumItem struct PDFObjectEditorModelAttributeEnumItem
{ {
PDFObjectEditorModelAttributeEnumItem() = default;
PDFObjectEditorModelAttributeEnumItem(QString name, uint32_t flags, PDFObject value) :
name(qMove(name)),
flags(flags),
value(qMove(value))
{
}
QString name; QString name;
uint32_t flags = 0; uint32_t flags = 0;
PDFObject value; PDFObject value;

View File

@ -231,7 +231,7 @@ void PDFOptimizer::optimize()
{ {
// Jakub Melka: We divide optimization into stages, each // Jakub Melka: We divide optimization into stages, each
// stage can consist from multiple passes. // stage can consist from multiple passes.
constexpr auto stages = { OptimizationFlags(DereferenceSimpleObjects), constexpr OptimizationFlags stages[] = { OptimizationFlags(DereferenceSimpleObjects),
OptimizationFlags(RemoveNullObjects), OptimizationFlags(RemoveNullObjects),
OptimizationFlags(RemoveUnusedObjects | MergeIdenticalObjects), OptimizationFlags(RemoveUnusedObjects | MergeIdenticalObjects),
OptimizationFlags(ShrinkObjectStorage), OptimizationFlags(ShrinkObjectStorage),
@ -337,7 +337,7 @@ bool PDFOptimizer::performRemoveUnusedObjects()
std::set<PDFObjectReference> references = PDFObjectUtils::getReferences({ m_storage.getTrailerDictionary() }, m_storage); std::set<PDFObjectReference> references = PDFObjectUtils::getReferences({ m_storage.getTrailerDictionary() }, m_storage);
PDFIntegerRange<size_t> range(0, objects.size()); PDFIntegerRange<size_t> range(0, objects.size());
auto processEntry = [this, &counter, &objects, &references](size_t index) auto processEntry = [&counter, &objects, &references](size_t index)
{ {
PDFObjectStorage::Entry& entry = objects[index]; PDFObjectStorage::Entry& entry = objects[index];
PDFObjectReference reference(PDFInteger(index), entry.generation); PDFObjectReference reference(PDFInteger(index), entry.generation);

View File

@ -80,10 +80,10 @@ class PDFOptionalContentMembershipObject
public: public:
explicit PDFOptionalContentMembershipObject() = default; explicit PDFOptionalContentMembershipObject() = default;
constexpr inline PDFOptionalContentMembershipObject(const PDFOptionalContentMembershipObject&) = delete; inline PDFOptionalContentMembershipObject(const PDFOptionalContentMembershipObject&) = delete;
constexpr inline PDFOptionalContentMembershipObject(PDFOptionalContentMembershipObject&&) = default; inline PDFOptionalContentMembershipObject(PDFOptionalContentMembershipObject&&) = default;
constexpr inline PDFOptionalContentMembershipObject& operator=(const PDFOptionalContentMembershipObject&) = delete; inline PDFOptionalContentMembershipObject& operator=(const PDFOptionalContentMembershipObject&) = delete;
constexpr inline PDFOptionalContentMembershipObject& operator=(PDFOptionalContentMembershipObject&&) = default; inline PDFOptionalContentMembershipObject& operator=(PDFOptionalContentMembershipObject&&) = default;
/// Creates optional content membership dictionary. If creation fails, then /// Creates optional content membership dictionary. If creation fails, then
/// exception is thrown. /// exception is thrown.

View File

@ -3369,12 +3369,12 @@ bool PDFPageContentProcessor::isContentSuppressedByOC(PDFObjectReference ocgOrOc
PDFPageContentProcessor::PDFPageContentProcessorState::PDFPageContentProcessorState() : PDFPageContentProcessor::PDFPageContentProcessorState::PDFPageContentProcessorState() :
m_currentTransformationMatrix(), m_currentTransformationMatrix(),
m_fillColorSpace(),
m_strokeColorSpace(), m_strokeColorSpace(),
m_fillColor(Qt::black), m_fillColorSpace(),
m_fillColorOriginal(),
m_strokeColor(Qt::black), m_strokeColor(Qt::black),
m_strokeColorOriginal(), m_strokeColorOriginal(),
m_fillColor(Qt::black),
m_fillColorOriginal(),
m_lineWidth(1.0), m_lineWidth(1.0),
m_lineCapStyle(Qt::FlatCap), m_lineCapStyle(Qt::FlatCap),
m_lineJoinStyle(Qt::MiterJoin), m_lineJoinStyle(Qt::MiterJoin),

View File

@ -51,8 +51,8 @@ public:
protected: protected:
virtual void performUpdateGraphicsState(const PDFPageContentProcessorState& state) override; virtual void performUpdateGraphicsState(const PDFPageContentProcessorState& state) override;
virtual void performBeginTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup); virtual void performBeginTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup) override;
virtual void performEndTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup); virtual void performEndTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup) override;
virtual void setWorldMatrix(const QMatrix& matrix) = 0; virtual void setWorldMatrix(const QMatrix& matrix) = 0;
virtual void setCompositionMode(QPainter::CompositionMode mode) = 0; virtual void setCompositionMode(QPainter::CompositionMode mode) = 0;

View File

@ -672,8 +672,8 @@ void PDFParsingContext::endParsingObject(PDFObjectReference reference)
PDFParser::PDFParser(const QByteArray& data, PDFParsingContext* context, Features features) : PDFParser::PDFParser(const QByteArray& data, PDFParsingContext* context, Features features) :
m_context(context), m_context(context),
m_lexicalAnalyzer(data.constData(), data.constData() + data.size()), m_features(features),
m_features(features) m_lexicalAnalyzer(data.constData(), data.constData() + data.size())
{ {
m_lookAhead1 = fetch(); m_lookAhead1 = fetch();
m_lookAhead2 = fetch(); m_lookAhead2 = fetch();
@ -681,8 +681,8 @@ PDFParser::PDFParser(const QByteArray& data, PDFParsingContext* context, Feature
PDFParser::PDFParser(const char* begin, const char* end, PDFParsingContext* context, Features features) : PDFParser::PDFParser(const char* begin, const char* end, PDFParsingContext* context, Features features) :
m_context(context), m_context(context),
m_lexicalAnalyzer(begin, end), m_features(features),
m_features(features) m_lexicalAnalyzer(begin, end)
{ {
m_lookAhead1 = fetch(); m_lookAhead1 = fetch();
m_lookAhead2 = fetch(); m_lookAhead2 = fetch();
@ -691,8 +691,8 @@ PDFParser::PDFParser(const char* begin, const char* end, PDFParsingContext* cont
PDFParser::PDFParser(std::function<PDFLexicalAnalyzer::Token ()> tokenFetcher) : PDFParser::PDFParser(std::function<PDFLexicalAnalyzer::Token ()> tokenFetcher) :
m_tokenFetcher(qMove(tokenFetcher)), m_tokenFetcher(qMove(tokenFetcher)),
m_context(nullptr), m_context(nullptr),
m_lexicalAnalyzer(nullptr, nullptr), m_features(None),
m_features(None) m_lexicalAnalyzer(nullptr, nullptr)
{ {
m_lookAhead1 = fetch(); m_lookAhead1 = fetch();
m_lookAhead2 = fetch(); m_lookAhead2 = fetch();

View File

@ -1672,7 +1672,7 @@ PDFMesh PDFFreeFormGouradTriangleShading::createMesh(const PDFMeshQualitySetting
const VertexData* vc = nullptr; const VertexData* vc = nullptr;
const VertexData* vd = nullptr; const VertexData* vd = nullptr;
auto addTriangle = [this, &settings, &mesh, &vertices, cms, intent, reporter](const VertexData* va, const VertexData* vb, const VertexData* vc) auto addTriangle = [this, &settings, &mesh, cms, intent, reporter](const VertexData* va, const VertexData* vb, const VertexData* vc)
{ {
const uint32_t via = va->index; const uint32_t via = va->index;
const uint32_t vib = vb->index; const uint32_t vib = vb->index;

View File

@ -217,7 +217,7 @@ class PDFInvalidPattern : public PDFPattern
public: public:
explicit PDFInvalidPattern() = default; explicit PDFInvalidPattern() = default;
virtual PatternType getType() const { return PatternType::Invalid; } virtual PatternType getType() const override { return PatternType::Invalid; }
virtual const PDFShadingPattern* getShadingPattern() const override { return nullptr; } virtual const PDFShadingPattern* getShadingPattern() const override { return nullptr; }
virtual const PDFTilingPattern* getTilingPattern() const override { return nullptr; } virtual const PDFTilingPattern* getTilingPattern() const override { return nullptr; }
}; };
@ -399,7 +399,7 @@ public:
virtual ShadingType getShadingType() const override; virtual ShadingType getShadingType() const override;
virtual PDFMesh createMesh(const PDFMeshQualitySettings& settings, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override; virtual PDFMesh createMesh(const PDFMeshQualitySettings& settings, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual PDFShadingSampler* createSampler(QMatrix userSpaceToDeviceSpaceMatrix) const; virtual PDFShadingSampler* createSampler(QMatrix userSpaceToDeviceSpaceMatrix) const override;
private: private:
friend class PDFPattern; friend class PDFPattern;

View File

@ -55,8 +55,8 @@ private:
std::atomic<int> m_percentage = 0; std::atomic<int> m_percentage = 0;
}; };
Q_DECLARE_METATYPE(ProgressStartupInfo)
} // namespace pdf } // namespace pdf
Q_DECLARE_METATYPE(pdf::ProgressStartupInfo)
#endif // PDFPROGRESS_H #endif // PDFPROGRESS_H

View File

@ -837,7 +837,7 @@ std::vector<PDFInteger> PDFPageImageExportSettings::getPages() const
} }
// We must remove duplicate pages // We must remove duplicate pages
qSort(result); std::sort(result.begin(), result.end());
result.erase(std::unique(result.begin(), result.end()), result.end()); result.erase(std::unique(result.begin(), result.end()), result.end());
} }

View File

@ -35,7 +35,7 @@ PDFRenderingErrorsWidget::PDFRenderingErrorsWidget(QWidget* parent, PDFWidget* p
Q_ASSERT(pdfWidget); Q_ASSERT(pdfWidget);
std::vector<PDFInteger> currentPages = pdfWidget->getDrawWidget()->getCurrentPages(); std::vector<PDFInteger> currentPages = pdfWidget->getDrawWidget()->getCurrentPages();
qSort(currentPages); std::sort(currentPages.begin(), currentPages.end());
QTreeWidgetItem* scrollToItem = nullptr; QTreeWidgetItem* scrollToItem = nullptr;
const PDFWidget::PageRenderingErrors* pageRenderingErrors = pdfWidget->getPageRenderingErrors(); const PDFWidget::PageRenderingErrors* pageRenderingErrors = pdfWidget->getPageRenderingErrors();
@ -84,7 +84,7 @@ PDFRenderingErrorsWidget::PDFRenderingErrorsWidget(QWidget* parent, PDFWidget* p
} }
bool isCurrentPage = std::binary_search(currentPages.cbegin(), currentPages.cend(), pageIndex); bool isCurrentPage = std::binary_search(currentPages.cbegin(), currentPages.cend(), pageIndex);
ui->renderErrorsTreeWidget->setItemExpanded(root, isCurrentPage); root->setExpanded(isCurrentPage);
if (isCurrentPage && !scrollToItem) if (isCurrentPage && !scrollToItem)
{ {

View File

@ -187,7 +187,7 @@ protected:
class PDFNoneSecurityHandler : public PDFSecurityHandler class PDFNoneSecurityHandler : public PDFSecurityHandler
{ {
public: public:
virtual EncryptionMode getMode() const { return EncryptionMode::None; } virtual EncryptionMode getMode() const override { return EncryptionMode::None; }
virtual AuthorizationResult authenticate(const std::function<QString(bool*)>&) override { return AuthorizationResult::OwnerAuthorized; } virtual AuthorizationResult authenticate(const std::function<QString(bool*)>&) override { return AuthorizationResult::OwnerAuthorized; }
virtual QByteArray decrypt(const QByteArray& data, PDFObjectReference, EncryptionScope) const override { return data; } virtual QByteArray decrypt(const QByteArray& data, PDFObjectReference, EncryptionScope) const override { return data; }
virtual QByteArray decryptByFilter(const QByteArray& data, const QByteArray&, PDFObjectReference) const override { return data; } virtual QByteArray decryptByFilter(const QByteArray& data, const QByteArray&, PDFObjectReference) const override { return data; }
@ -201,12 +201,12 @@ public:
class PDFStandardSecurityHandler : public PDFSecurityHandler class PDFStandardSecurityHandler : public PDFSecurityHandler
{ {
public: public:
virtual EncryptionMode getMode() const { return EncryptionMode::Standard; } virtual EncryptionMode getMode() const override { return EncryptionMode::Standard; }
virtual AuthorizationResult authenticate(const std::function<QString(bool*)>& getPasswordCallback) override; virtual AuthorizationResult authenticate(const std::function<QString(bool*)>& getPasswordCallback) override;
virtual QByteArray decrypt(const QByteArray& data, PDFObjectReference reference, EncryptionScope encryptionScope) const override; virtual QByteArray decrypt(const QByteArray& data, PDFObjectReference reference, EncryptionScope encryptionScope) const override;
virtual QByteArray decryptByFilter(const QByteArray& data, const QByteArray& filterName, PDFObjectReference reference) const override; virtual QByteArray decryptByFilter(const QByteArray& data, const QByteArray& filterName, PDFObjectReference reference) const override;
virtual bool isMetadataEncrypted() const override { return m_encryptMetadata; } virtual bool isMetadataEncrypted() const override { return m_encryptMetadata; }
virtual bool isAllowed(Permission permission) const { return m_authorizationData.authorizationResult == AuthorizationResult::OwnerAuthorized || (m_permissions & static_cast<uint32_t>(permission)); } virtual bool isAllowed(Permission permission) const override { return m_authorizationData.authorizationResult == AuthorizationResult::OwnerAuthorized || (m_permissions & static_cast<uint32_t>(permission)); }
virtual AuthorizationResult getAuthorizationResult() const override { return m_authorizationData.authorizationResult; } virtual AuthorizationResult getAuthorizationResult() const override { return m_authorizationData.authorizationResult; }
struct AuthorizationData struct AuthorizationData
@ -218,7 +218,7 @@ public:
}; };
private: private:
friend static PDFSecurityHandlerPointer PDFSecurityHandler::createSecurityHandler(const PDFObject& encryptionDictionaryObject, const QByteArray& id); friend PDFSecurityHandlerPointer PDFSecurityHandler::createSecurityHandler(const PDFObject& encryptionDictionaryObject, const QByteArray& id);
struct UserOwnerData_r6 struct UserOwnerData_r6
{ {

View File

@ -73,7 +73,7 @@ QByteArray PDFAscii85DecodeFilter::apply(const QByteArray& data,
const unsigned char* it = dataBegin; const unsigned char* it = dataBegin;
const constexpr uint32_t STREAM_END = 0xFFFFFFFF; const constexpr uint32_t STREAM_END = 0xFFFFFFFF;
auto getChar = [&it, dataEnd, STREAM_END]() -> uint32_t auto getChar = [&it, dataEnd]() -> uint32_t
{ {
// Skip whitespace characters // Skip whitespace characters
while (it != dataEnd && PDFLexicalAnalyzer::isWhitespace(*it)) while (it != dataEnd && PDFLexicalAnalyzer::isWhitespace(*it))

View File

@ -211,7 +211,7 @@ public:
const PDFObject& parameters, const PDFObject& parameters,
const PDFSecurityHandler* securityHandler) const override; const PDFSecurityHandler* securityHandler) const override;
virtual PDFInteger getStreamDataLength(const QByteArray& data, PDFInteger offset) const; virtual PDFInteger getStreamDataLength(const QByteArray& data, PDFInteger offset) const override;
/// Recompresses data. So, first, data are decompressed, and then /// Recompresses data. So, first, data are decompressed, and then
/// recompressed again with maximal compress ratio possible. /// recompressed again with maximal compress ratio possible.

View File

@ -858,7 +858,7 @@ PDFTextBlock::PDFTextBlock(PDFTextLines textLines) :
const PDFReal xR = br.x(); const PDFReal xR = br.x();
const PDFReal yL = qRound(bl.y() * 100.0); const PDFReal yL = qRound(bl.y() * 100.0);
const PDFReal yR = qRound(br.y() * 100.0); const PDFReal yR = qRound(br.y() * 100.0);
return std::tie(-yL, xL) < std::tie(-yR, xR); return std::make_pair(-yL, xL) < std::make_pair(-yR, xR);
}; };
std::sort(m_lines.begin(), m_lines.end(), sortFunction); std::sort(m_lines.begin(), m_lines.end(), sortFunction);

View File

@ -503,7 +503,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
{ {
if (!isProcessColorSubtractive) if (!isProcessColorSubtractive)
{ {
for (uint8_t i = pixelFormat.getProcessColorChannelIndexStart(); i < pixelFormat.getProcessColorChannelIndexEnd(); ++i) for (uint8_t i = processColorChannelStart; i < processColorChannelEnd; ++i)
{ {
const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i); const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i);
B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]); B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]);
@ -511,7 +511,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
} }
else else
{ {
for (uint8_t i = pixelFormat.getProcessColorChannelIndexStart(); i < pixelFormat.getProcessColorChannelIndexEnd(); ++i) for (uint8_t i = processColorChannelStart; i < processColorChannelEnd; ++i)
{ {
const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i); const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i);
B_i[i] = 1.0f - PDFBlendFunction::blend(pixelBlendMode, 1.0f - backdropColor[i], 1.0f - sourceColor[i]); B_i[i] = 1.0f - PDFBlendFunction::blend(pixelBlendMode, 1.0f - backdropColor[i], 1.0f - sourceColor[i]);
@ -524,7 +524,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
if (!isSpotColorSubtractive) if (!isSpotColorSubtractive)
{ {
for (uint8_t i = pixelFormat.getSpotColorChannelIndexStart(); i < pixelFormat.getSpotColorChannelIndexEnd(); ++i) for (uint8_t i = spotColorChannelStart; i < spotColorChannelEnd; ++i)
{ {
const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i); const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i);
B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]); B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]);
@ -532,7 +532,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
} }
else else
{ {
for (uint8_t i = pixelFormat.getSpotColorChannelIndexStart(); i < pixelFormat.getSpotColorChannelIndexEnd(); ++i) for (uint8_t i = spotColorChannelStart; i < spotColorChannelEnd; ++i)
{ {
const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i); const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i);
B_i[i] = 1.0f - PDFBlendFunction::blend(pixelBlendMode, 1.0f - backdropColor[i], 1.0f - sourceColor[i]); B_i[i] = 1.0f - PDFBlendFunction::blend(pixelBlendMode, 1.0f - backdropColor[i], 1.0f - sourceColor[i]);
@ -550,8 +550,8 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
case 1: case 1:
{ {
// Gray // Gray
const PDFGray Cb = backdropColor[pixelFormat.getProcessColorChannelIndexStart()]; const PDFGray Cb = backdropColor[processColorChannelStart];
const PDFGray Cs = sourceColor[pixelFormat.getProcessColorChannelIndexStart()]; const PDFGray Cs = sourceColor[processColorChannelStart];
const PDFGray blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs); const PDFGray blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs);
B_i[pixelFormat.getProcessColorChannelIndexStart()] = blended; B_i[pixelFormat.getProcessColorChannelIndexStart()] = blended;
break; break;
@ -560,35 +560,35 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
case 3: case 3:
{ {
// RGB // RGB
const PDFRGB Cb = { backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 0], const PDFRGB Cb = { backdropColor[processColorChannelStart + 0],
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 1], backdropColor[processColorChannelStart + 1],
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 2] }; backdropColor[processColorChannelStart + 2] };
const PDFRGB Cs = { sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 0], const PDFRGB Cs = { sourceColor[processColorChannelStart + 0],
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 1], sourceColor[processColorChannelStart + 1],
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 2] }; sourceColor[processColorChannelStart + 2] };
const PDFRGB blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs); const PDFRGB blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs);
B_i[pixelFormat.getProcessColorChannelIndexStart() + 0] = blended[0]; B_i[processColorChannelStart + 0] = blended[0];
B_i[pixelFormat.getProcessColorChannelIndexStart() + 1] = blended[1]; B_i[processColorChannelStart + 1] = blended[1];
B_i[pixelFormat.getProcessColorChannelIndexStart() + 2] = blended[2]; B_i[processColorChannelStart + 2] = blended[2];
break; break;
} }
case 4: case 4:
{ {
// CMYK // CMYK
const PDFCMYK Cb = { backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 0], const PDFCMYK Cb = { backdropColor[processColorChannelStart + 0],
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 1], backdropColor[processColorChannelStart + 1],
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 2], backdropColor[processColorChannelStart + 2],
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 3] }; backdropColor[processColorChannelStart + 3] };
const PDFCMYK Cs = { sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 0], const PDFCMYK Cs = { sourceColor[processColorChannelStart + 0],
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 1], sourceColor[processColorChannelStart + 1],
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 2], sourceColor[processColorChannelStart + 2],
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 3] }; sourceColor[processColorChannelStart + 3] };
const PDFCMYK blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs); const PDFCMYK blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs);
B_i[pixelFormat.getProcessColorChannelIndexStart() + 0] = blended[0]; B_i[processColorChannelStart + 0] = blended[0];
B_i[pixelFormat.getProcessColorChannelIndexStart() + 1] = blended[1]; B_i[processColorChannelStart + 1] = blended[1];
B_i[pixelFormat.getProcessColorChannelIndexStart() + 2] = blended[2]; B_i[processColorChannelStart + 2] = blended[2];
B_i[pixelFormat.getProcessColorChannelIndexStart() + 3] = blended[3]; B_i[processColorChannelStart + 3] = blended[3];
break; break;
} }
@ -606,7 +606,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
const bool isSpotColorSubtractive = pixelFormat.hasSpotColorsSubtractive(); const bool isSpotColorSubtractive = pixelFormat.hasSpotColorsSubtractive();
if (!isSpotColorSubtractive) if (!isSpotColorSubtractive)
{ {
for (uint8_t i = pixelFormat.getSpotColorChannelIndexStart(); i < pixelFormat.getSpotColorChannelIndexEnd(); ++i) for (uint8_t i = spotColorChannelStart; i < spotColorChannelEnd; ++i)
{ {
const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i); const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i);
B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]); B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]);
@ -614,7 +614,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
} }
else else
{ {
for (uint8_t i = pixelFormat.getSpotColorChannelIndexStart(); i < pixelFormat.getSpotColorChannelIndexEnd(); ++i) for (uint8_t i = spotColorChannelStart; i < spotColorChannelEnd; ++i)
{ {
const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i); const BlendMode pixelBlendMode = getBlendModeForPixel(x, y, i);
B_i[i] = 1.0f - PDFBlendFunction::blend(pixelBlendMode, 1.0f - backdropColor[i], 1.0f - sourceColor[i]); B_i[i] = 1.0f - PDFBlendFunction::blend(pixelBlendMode, 1.0f - backdropColor[i], 1.0f - sourceColor[i]);
@ -3061,6 +3061,9 @@ PDFInkMapping PDFInkMapper::createMapping(const PDFAbstractColorSpace* sourceCol
break; break;
} }
default:
break;
} }
} }

View File

@ -616,8 +616,8 @@ public:
QImage toImage(bool use16Bit, bool usePaper = false, PDFRGB paperColor = PDFRGB()) const; QImage toImage(bool use16Bit, bool usePaper = false, PDFRGB paperColor = PDFRGB()) const;
virtual void performPathPainting(const QPainterPath& path, bool stroke, bool fill, bool text, Qt::FillRule fillRule) override; virtual void performPathPainting(const QPainterPath& path, bool stroke, bool fill, bool text, Qt::FillRule fillRule) override;
virtual bool performPathPaintingUsingShading(const QPainterPath& path, bool stroke, bool fill, const PDFShadingPattern* shadingPattern); virtual bool performPathPaintingUsingShading(const QPainterPath& path, bool stroke, bool fill, const PDFShadingPattern* shadingPattern) override;
virtual void performFinishPathPainting(); virtual void performFinishPathPainting() override;
virtual void performClipping(const QPainterPath& path, Qt::FillRule fillRule) override; virtual void performClipping(const QPainterPath& path, Qt::FillRule fillRule) override;
virtual void performUpdateGraphicsState(const PDFPageContentProcessorState& state) override; virtual void performUpdateGraphicsState(const PDFPageContentProcessorState& state) override;
virtual void performSaveGraphicState(ProcessOrder order) override; virtual void performSaveGraphicState(ProcessOrder order) override;
@ -628,7 +628,7 @@ public:
virtual void performTextEnd(ProcessOrder order) override; virtual void performTextEnd(ProcessOrder order) override;
virtual bool performOriginalImagePainting(const PDFImage& image) override; virtual bool performOriginalImagePainting(const PDFImage& image) override;
virtual void performImagePainting(const QImage& image) override; virtual void performImagePainting(const QImage& image) override;
virtual void performMeshPainting(const PDFMesh& mesh); virtual void performMeshPainting(const PDFMesh& mesh) override;
private: private:

View File

@ -37,6 +37,7 @@
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:5033) #pragma warning(disable:5033)
#define CMS_NO_REGISTER_KEYWORD
#include <lcms2.h> #include <lcms2.h>
#pragma warning(pop) #pragma warning(pop)
@ -444,7 +445,7 @@ void PDFClosedIntervalSet::normalize()
// 1) sort all ranges // 1) sort all ranges
// 2) merge adjacent ones // 2) merge adjacent ones
qSort(m_intervals); std::sort(m_intervals.begin(), m_intervals.end());
std::vector<ClosedInterval> intervals; std::vector<ClosedInterval> intervals;
auto it = m_intervals.cbegin(); auto it = m_intervals.cbegin();

View File

@ -29,6 +29,7 @@
#include <vector> #include <vector>
#include <iterator> #include <iterator>
#include <functional> #include <functional>
#include <type_traits>
namespace pdf namespace pdf
{ {
@ -518,10 +519,10 @@ class PDFBuffer
public: public:
using value_type = T; using value_type = T;
using value_ptr = value_type*; using value_ptr = value_type*;
using const_value_type = const value_type; using const_value_type = typename std::add_const<value_type>::type;
using const_value_ptr = const_value_type*; using const_value_ptr = const_value_type*;
using value_ref = value_type&; using value_ref = value_type&;
using const_value_ref = const value_ref; using const_value_ref = typename std::add_const<value_ref>::type;
explicit inline PDFBuffer() : explicit inline PDFBuffer() :
m_begin(nullptr), m_begin(nullptr),

View File

@ -205,8 +205,8 @@ PDFFindTextTool::PDFFindTextTool(PDFDrawWidgetProxy* proxy, QAction* prevAction,
BaseClass(proxy, parent), BaseClass(proxy, parent),
m_prevAction(prevAction), m_prevAction(prevAction),
m_nextAction(nextAction), m_nextAction(nextAction),
m_dialog(nullptr),
m_parentDialog(parentDialog), m_parentDialog(parentDialog),
m_dialog(nullptr),
m_caseSensitiveCheckBox(nullptr), m_caseSensitiveCheckBox(nullptr),
m_wholeWordsCheckBox(nullptr), m_wholeWordsCheckBox(nullptr),
m_findTextEdit(nullptr), m_findTextEdit(nullptr),

View File

@ -37,15 +37,15 @@ class PDFXRefTable
Q_DECLARE_TR_FUNCTIONS(pdf::PDFXRefTable) Q_DECLARE_TR_FUNCTIONS(pdf::PDFXRefTable)
public: public:
constexpr inline explicit PDFXRefTable() = default; inline explicit PDFXRefTable() = default;
// Enforce default copy constructor and default move constructor // Enforce default copy constructor and default move constructor
constexpr inline PDFXRefTable(const PDFXRefTable&) = default; inline PDFXRefTable(const PDFXRefTable&) = default;
constexpr inline PDFXRefTable(PDFXRefTable&&) = default; inline PDFXRefTable(PDFXRefTable&&) = default;
// Enforce default copy assignment operator and move assignment operator // Enforce default copy assignment operator and move assignment operator
constexpr inline PDFXRefTable& operator=(const PDFXRefTable&) = default; inline PDFXRefTable& operator=(const PDFXRefTable&) = default;
constexpr inline PDFXRefTable& operator=(PDFXRefTable&&) = default; inline PDFXRefTable& operator=(PDFXRefTable&&) = default;
enum class EntryType enum class EntryType
{ {