mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-02-26 08:27:49 +01:00
Bugfix: LLVM compiler warnings
This commit is contained in:
parent
83e67979e7
commit
848e1aee3c
@ -496,7 +496,7 @@ PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObject
|
||||
std::vector<PDFReal> captionOffset = loader.readNumberArrayFromDictionary(dictionary, "CO");
|
||||
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")
|
||||
@ -1056,7 +1056,7 @@ QPen PDFAnnotation::getPen() const
|
||||
{
|
||||
PDFLineDashPattern lineDashPattern(border.getDashPattern(), 0.0);
|
||||
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());
|
||||
}
|
||||
|
||||
@ -1562,7 +1562,7 @@ void PDFAnnotationManager::drawAnnotationUsingAppearanceStream(const PageAnnotat
|
||||
if (isContentVisible && m_target == Target::View)
|
||||
{
|
||||
PDFPainterStateGuard guard(painter);
|
||||
painter->resetMatrix();
|
||||
painter->resetTransform();
|
||||
drawWidgetAnnotationHighlight(annotationRectangle, annotation.annotation.get(), painter, userSpaceToDeviceSpace);
|
||||
}
|
||||
}
|
||||
@ -3518,7 +3518,7 @@ const PDFAnnotationManager::PageAnnotation* PDFAnnotationManager::PageAnnotation
|
||||
if (markupAnnotation)
|
||||
{
|
||||
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())
|
||||
{
|
||||
return &*it;
|
||||
|
@ -753,7 +753,7 @@ public:
|
||||
void setExternalData(const PDFObject& externalData);
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QString m_windowTitle;
|
||||
PDFObjectReference m_popupAnnotation;
|
||||
@ -800,7 +800,7 @@ public:
|
||||
static QIcon createIcon(QString key, QSize size);
|
||||
|
||||
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);
|
||||
|
||||
@ -835,7 +835,7 @@ public:
|
||||
const PDFAnnotationQuadrilaterals& getActivationRegion() const { return m_activationRegion; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
PDFActionPtr m_action;
|
||||
LinkHighlightMode m_highlightMode = LinkHighlightMode::Invert;
|
||||
@ -878,7 +878,7 @@ public:
|
||||
AnnotationLineEnding getEndLineEnding() const { return m_endLineEnding; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QByteArray m_defaultAppearance;
|
||||
Justification m_justification = Justification::Left;
|
||||
@ -931,7 +931,7 @@ protected:
|
||||
virtual QColor getFillColor() const override;
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QLineF m_line;
|
||||
AnnotationLineEnding m_startLineEnding = AnnotationLineEnding::None;
|
||||
@ -971,7 +971,7 @@ protected:
|
||||
virtual QColor getFillColor() const override;
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
AnnotationType m_type;
|
||||
std::vector<PDFReal> m_interiorColor;
|
||||
@ -1015,7 +1015,7 @@ protected:
|
||||
virtual QColor getFillColor() const override;
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
AnnotationType m_type;
|
||||
std::vector<QPointF> m_vertices;
|
||||
@ -1045,7 +1045,7 @@ public:
|
||||
const PDFAnnotationQuadrilaterals& getHiglightArea() const { return m_highlightArea; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
AnnotationType m_type;
|
||||
PDFAnnotationQuadrilaterals m_highlightArea;
|
||||
@ -1070,7 +1070,7 @@ public:
|
||||
Symbol getSymbol() const { return m_symbol; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QRectF m_caretRectangle;
|
||||
Symbol m_symbol = Symbol::None;
|
||||
@ -1120,7 +1120,7 @@ public:
|
||||
static QString getText(Stamp stamp);
|
||||
|
||||
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;
|
||||
StampIntent m_intent = StampIntent::Stamp;
|
||||
@ -1138,7 +1138,7 @@ public:
|
||||
const QPainterPath& getInkPath() const { return m_inkPath; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QPainterPath m_inkPath;
|
||||
};
|
||||
@ -1156,7 +1156,7 @@ public:
|
||||
bool isOpened() const { return m_opened; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
bool m_opened = false;
|
||||
};
|
||||
@ -1184,7 +1184,7 @@ public:
|
||||
FileAttachmentIcon getIcon() const { return m_icon; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
PDFFileSpecification m_fileSpecification;
|
||||
FileAttachmentIcon m_icon = FileAttachmentIcon::PushPin;
|
||||
@ -1210,7 +1210,7 @@ public:
|
||||
Icon getIcon() const { return m_icon; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
PDFSound m_sound;
|
||||
Icon m_icon = Icon::Speaker;
|
||||
@ -1231,7 +1231,7 @@ public:
|
||||
const PDFMovieActivation& getMovieActivation() const { return m_movieActivation; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QString m_movieTitle;
|
||||
bool m_playMovie = true;
|
||||
@ -1254,7 +1254,7 @@ public:
|
||||
const PDFAnnotationAdditionalActions& getAdditionalActions() const { return m_additionalActions; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QString m_screenTitle;
|
||||
PDFAnnotationAppearanceCharacteristics m_appearanceCharacteristics;
|
||||
@ -1289,7 +1289,7 @@ public:
|
||||
const PDFAnnotationAdditionalActions& getAdditionalActions() const { return m_additionalActions; }
|
||||
|
||||
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;
|
||||
PDFAnnotationAppearanceCharacteristics m_appearanceCharacteristics;
|
||||
@ -1331,7 +1331,7 @@ public:
|
||||
PDFReal getRelativeVerticalOffset() const { return m_relativeVerticalOffset; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
QMatrix m_matrix;
|
||||
PDFReal m_relativeHorizontalOffset = 0.0;
|
||||
@ -1360,7 +1360,7 @@ protected:
|
||||
virtual QColor getFillColor() const override;
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
PDFAnnotationQuadrilaterals m_redactionRegion;
|
||||
std::vector<PDFReal> m_interiorColor;
|
||||
@ -1379,7 +1379,7 @@ public:
|
||||
virtual AnnotationType getType() const override { return AnnotationType::Projection; }
|
||||
|
||||
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.
|
||||
@ -1397,7 +1397,7 @@ public:
|
||||
QRectF getViewBox() const { return m_viewBox; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
PDF3DStream m_stream;
|
||||
std::optional<PDF3DView> m_defaultView;
|
||||
@ -1421,7 +1421,7 @@ public:
|
||||
const PDFRichMediaSettings* getSettings() const { return &m_settings; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
friend PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
PDFRichMediaContent m_content;
|
||||
PDFRichMediaSettings m_settings;
|
||||
|
@ -261,7 +261,7 @@ PDFCatalog PDFCatalog::parse(const PDFObject& catalog, const PDFDocument* docume
|
||||
|
||||
auto getObject = [](const PDFObjectStorage*, PDFObject object)
|
||||
{
|
||||
return qMove(object);
|
||||
return object;
|
||||
};
|
||||
|
||||
catalogObject.m_namedDestinations = PDFNameTreeLoader<PDFDestination>::parse(&document->getStorage(), namesDictionary->get("Dests"), parseDestination);
|
||||
|
@ -94,6 +94,11 @@ public:
|
||||
/// Comparison operator, works only with page indices (because they should be unique)
|
||||
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
|
||||
static PDFPageLabel parse(PDFInteger pageIndex, const PDFObjectStorage* storage, const PDFObject& object);
|
||||
|
||||
@ -196,13 +201,13 @@ public:
|
||||
EndProperties
|
||||
};
|
||||
|
||||
constexpr inline PDFViewerPreferences() = default;
|
||||
inline PDFViewerPreferences() = default;
|
||||
|
||||
constexpr inline PDFViewerPreferences(const PDFViewerPreferences&) = default;
|
||||
constexpr inline PDFViewerPreferences(PDFViewerPreferences&&) = default;
|
||||
inline PDFViewerPreferences(const PDFViewerPreferences&) = default;
|
||||
inline PDFViewerPreferences(PDFViewerPreferences&&) = default;
|
||||
|
||||
constexpr inline PDFViewerPreferences& operator=(const PDFViewerPreferences&) = default;
|
||||
constexpr inline PDFViewerPreferences& operator=(PDFViewerPreferences&&) = default;
|
||||
inline PDFViewerPreferences& operator=(const PDFViewerPreferences&) = default;
|
||||
inline PDFViewerPreferences& operator=(PDFViewerPreferences&&) = default;
|
||||
|
||||
/// Parses viewer preferences from catalog dictionary. If object cannot be parsed, or error occurs,
|
||||
/// then exception is thrown.
|
||||
@ -561,13 +566,13 @@ private:
|
||||
class Pdf4QtLIBSHARED_EXPORT PDFCatalog
|
||||
{
|
||||
public:
|
||||
constexpr inline PDFCatalog() = default;
|
||||
inline PDFCatalog() = default;
|
||||
|
||||
constexpr inline PDFCatalog(const PDFCatalog&) = default;
|
||||
constexpr inline PDFCatalog(PDFCatalog&&) = default;
|
||||
inline PDFCatalog(const PDFCatalog&) = default;
|
||||
inline PDFCatalog(PDFCatalog&&) = default;
|
||||
|
||||
constexpr inline PDFCatalog& operator=(const PDFCatalog&) = default;
|
||||
constexpr inline PDFCatalog& operator=(PDFCatalog&&) = default;
|
||||
inline PDFCatalog& operator=(const PDFCatalog&) = default;
|
||||
inline PDFCatalog& operator=(PDFCatalog&&) = default;
|
||||
|
||||
static constexpr const size_t INVALID_PAGE_INDEX = std::numeric_limits<size_t>::max();
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:5033)
|
||||
#define CMS_NO_REGISTER_KEYWORD
|
||||
#include <lcms2.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
@ -708,7 +709,7 @@ cmsHPROFILE PDFLittleCMS::createProfile(const QString& id, const PDFColorProfile
|
||||
if (!identifier.isOutputIntentProfile)
|
||||
{
|
||||
// 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())
|
||||
{
|
||||
it = itOutputIntentColorProfile;
|
||||
@ -1215,8 +1216,8 @@ bool PDFCMSGeneric::transformColorSpace(const PDFCMS::ColorSpaceTransformParams&
|
||||
|
||||
PDFCMSManager::PDFCMSManager(QObject* parent) :
|
||||
BaseClass(parent),
|
||||
m_mutex(QMutex::Recursive),
|
||||
m_document(nullptr)
|
||||
m_document(nullptr),
|
||||
m_mutex(QMutex::Recursive)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ PDFTextSelection PDFAsynchronousTextLayoutCompiler::getTextSelectionAll(QColor c
|
||||
|
||||
QMutex mutex;
|
||||
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);
|
||||
PDFTextSelectionItems items;
|
||||
|
@ -363,9 +363,8 @@ std::vector<PDFReal> PDFDocumentDataLoaderDecorator::readNumberArray(const PDFOb
|
||||
result.push_back(number);
|
||||
}
|
||||
|
||||
// We assume, that RVO (return value optimization) will not work for this function
|
||||
// (multiple return points).
|
||||
return std::move(result);
|
||||
// We assume, that RVO (return value optimization) will work
|
||||
return result;
|
||||
}
|
||||
|
||||
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
|
||||
// can't get this value.
|
||||
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)
|
||||
{
|
||||
return std::vector<PDFInteger>();
|
||||
@ -394,9 +393,8 @@ std::vector<PDFInteger> PDFDocumentDataLoaderDecorator::readIntegerArray(const P
|
||||
result.push_back(number);
|
||||
}
|
||||
|
||||
// We assume, that RVO (return value optimization) will not work for this function
|
||||
// (multiple return points).
|
||||
return std::move(result);
|
||||
// We assume, that RVO (return value optimization) will work
|
||||
return result;
|
||||
}
|
||||
|
||||
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
|
||||
// (multiple return points).
|
||||
return std::move(result);
|
||||
// We assume, that RVO (return value optimization) will work
|
||||
return result;
|
||||
}
|
||||
|
||||
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
|
||||
// (multiple return points).
|
||||
return std::move(result);
|
||||
// We assume, that RVO (return value optimization) will work
|
||||
return result;
|
||||
}
|
||||
|
||||
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
|
||||
// (multiple return points).
|
||||
return std::move(result);
|
||||
// We assume, that RVO (return value optimization) will work
|
||||
return result;
|
||||
}
|
||||
|
||||
return std::vector<QByteArray>();
|
||||
|
@ -41,13 +41,13 @@ class PDFDocumentBuilder;
|
||||
class PDFObjectStorage
|
||||
{
|
||||
public:
|
||||
constexpr inline PDFObjectStorage() = default;
|
||||
inline PDFObjectStorage() = default;
|
||||
|
||||
constexpr inline PDFObjectStorage(const PDFObjectStorage&) = default;
|
||||
constexpr inline PDFObjectStorage(PDFObjectStorage&&) = default;
|
||||
inline PDFObjectStorage(const PDFObjectStorage&) = default;
|
||||
inline PDFObjectStorage(PDFObjectStorage&&) = default;
|
||||
|
||||
constexpr inline PDFObjectStorage& operator=(const PDFObjectStorage&) = default;
|
||||
constexpr inline PDFObjectStorage& operator=(PDFObjectStorage&&) = default;
|
||||
inline PDFObjectStorage& operator=(const PDFObjectStorage&) = default;
|
||||
inline PDFObjectStorage& operator=(PDFObjectStorage&&) = default;
|
||||
|
||||
bool operator==(const PDFObjectStorage& other) const;
|
||||
bool operator!=(const PDFObjectStorage& other) const { return !(*this == other); }
|
||||
|
@ -394,8 +394,8 @@ PDFDrawWidgetProxy::PDFDrawWidgetProxy(QObject* parent) :
|
||||
m_horizontalOffset(0),
|
||||
m_controller(nullptr),
|
||||
m_widget(nullptr),
|
||||
m_horizontalScrollbar(nullptr),
|
||||
m_verticalScrollbar(nullptr),
|
||||
m_horizontalScrollbar(nullptr),
|
||||
m_features(PDFRenderer::getDefaultFeatures()),
|
||||
m_compiler(new PDFAsynchronousPageCompiler(this)),
|
||||
m_textLayoutCompiler(new PDFAsynchronousTextLayoutCompiler(this)),
|
||||
@ -878,7 +878,7 @@ std::vector<PDFInteger> PDFDrawWidgetProxy::getPagesIntersectingRect(QRect rect)
|
||||
pages.push_back(item.pageIndex);
|
||||
}
|
||||
}
|
||||
qSort(pages);
|
||||
std::sort(pages.begin(), pages.end());
|
||||
|
||||
return pages;
|
||||
}
|
||||
|
@ -373,9 +373,11 @@ public:
|
||||
class PDFRealizedType3FontImpl : public IRealizedFontImpl
|
||||
{
|
||||
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;
|
||||
|
||||
PDFReal getPixelSize() const { return m_pixelSize; }
|
||||
|
||||
virtual void fillTextSequence(const QByteArray& byteArray, TextSequence& textSequence, PDFRenderErrorReporter* reporter) override;
|
||||
virtual bool isHorizontalWritingSystem() const override;
|
||||
virtual CharacterInfos getCharacterInfos() const override;
|
||||
@ -1942,7 +1944,7 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data)
|
||||
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)
|
||||
{
|
||||
@ -1953,7 +1955,7 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data)
|
||||
return 0;
|
||||
};
|
||||
|
||||
auto fetchUnicode = [&parser](const PDFLexicalAnalyzer::Token& currentToken) -> CID
|
||||
auto fetchUnicode = [](const PDFLexicalAnalyzer::Token& currentToken) -> CID
|
||||
{
|
||||
if (currentToken.type == PDFLexicalAnalyzer::TokenType::String)
|
||||
{
|
||||
|
@ -484,7 +484,7 @@ private:
|
||||
class Pdf4QtLIBSHARED_EXPORT PDFFontCMap
|
||||
{
|
||||
public:
|
||||
constexpr explicit PDFFontCMap() = default;
|
||||
explicit PDFFontCMap() = default;
|
||||
|
||||
/// Returns true, if mapping is valid
|
||||
bool isValid() const { return !m_entries.empty(); }
|
||||
|
@ -273,7 +273,7 @@ public:
|
||||
void initializeTextEdit(PDFTextEditPseudowidget* textEdit) const;
|
||||
|
||||
protected:
|
||||
virtual void setFocusImpl(bool focused);
|
||||
virtual void setFocusImpl(bool focused) override;
|
||||
|
||||
private:
|
||||
PDFTextEditPseudowidget m_textEdit;
|
||||
@ -446,7 +446,7 @@ public:
|
||||
void initializeListBox(PDFListBoxPseudowidget* listBox) const;
|
||||
|
||||
protected:
|
||||
virtual void setFocusImpl(bool focused);
|
||||
virtual void setFocusImpl(bool focused) override;
|
||||
|
||||
private:
|
||||
static PDFFormField::FieldFlags getTextEditFlags(PDFFormField::FieldFlags flags);
|
||||
@ -489,7 +489,7 @@ public:
|
||||
void initializeListBox(PDFListBoxPseudowidget* listBox) const;
|
||||
|
||||
protected:
|
||||
virtual void setFocusImpl(bool focused);
|
||||
virtual void setFocusImpl(bool focused) override;
|
||||
|
||||
private:
|
||||
/// Returns list of selected items parsed from the object.
|
||||
|
@ -315,7 +315,7 @@ public:
|
||||
virtual void resetValue(const ResetValueParameters& parameters) override;
|
||||
|
||||
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
|
||||
/// dictionaries, state names are computer generated numbers (for example /1, /3, ...),
|
||||
@ -340,7 +340,7 @@ public:
|
||||
virtual void resetValue(const ResetValueParameters& parameters) override;
|
||||
|
||||
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,
|
||||
/// no maximal length is specified.
|
||||
@ -387,7 +387,7 @@ public:
|
||||
virtual void reloadValue(const PDFObjectStorage* storage, PDFObject parentValue) override;
|
||||
|
||||
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;
|
||||
PDFInteger m_topIndex;
|
||||
@ -402,7 +402,7 @@ public:
|
||||
const PDFSignature& getSignature() const { return m_signature; }
|
||||
|
||||
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;
|
||||
};
|
||||
|
@ -688,7 +688,7 @@ QVariant PDFThumbnailsItemModel::data(const QModelIndex& index, int role) const
|
||||
QString key = getKey(index.row());
|
||||
|
||||
QPixmap pixmap;
|
||||
if (!m_thumbnailCache.find(key, pixmap))
|
||||
if (!m_thumbnailCache.find(key, &pixmap))
|
||||
{
|
||||
QImage thumbnail = m_proxy->drawThumbnailImage(index.row(), m_thumbnailSize);
|
||||
if (!thumbnail.isNull())
|
||||
|
@ -32,7 +32,7 @@ PDFJavaScriptScanner::Entries PDFJavaScriptScanner::scan(const std::vector<PDFIn
|
||||
{
|
||||
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))
|
||||
{
|
||||
@ -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)
|
||||
{
|
||||
@ -107,7 +107,7 @@ PDFJavaScriptScanner::Entries PDFJavaScriptScanner::scan(const std::vector<PDFIn
|
||||
PDFForm form = PDFForm::parse(m_document, catalog->getFormObject());
|
||||
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());
|
||||
};
|
||||
@ -188,7 +188,7 @@ PDFJavaScriptScanner::Entries PDFJavaScriptScanner::scan(const std::vector<PDFIn
|
||||
}
|
||||
}
|
||||
|
||||
qSort(result);
|
||||
std::sort(result.begin(), result.end());
|
||||
if (options.testFlag(Optimize))
|
||||
{
|
||||
result.erase(std::unique(result.begin(), result.end()), result.end());
|
||||
|
@ -2196,6 +2196,7 @@ void PDFJBIG2Decoder::processPatternDictionary(const PDFJBIG2SegmentHeader& head
|
||||
}
|
||||
}
|
||||
|
||||
int8_t gbat0_x = -static_cast<int8_t>(HDPW);
|
||||
PDFJBIG2BitmapDecodingParameters parameters;
|
||||
parameters.MMR = HDMMR;
|
||||
parameters.GBW = (GRAYMAX + 1) * HDPW;
|
||||
@ -2203,7 +2204,7 @@ void PDFJBIG2Decoder::processPatternDictionary(const PDFJBIG2SegmentHeader& head
|
||||
parameters.GBTEMPLATE = HDTEMPLATE;
|
||||
parameters.TPGDON = false;
|
||||
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[2] = { 2, -2 };
|
||||
parameters.GBAT[3] = { -2, -2 };
|
||||
@ -2363,6 +2364,7 @@ void PDFJBIG2Decoder::processHalftoneRegion(const PDFJBIG2SegmentHeader& header)
|
||||
}
|
||||
|
||||
/* Annex C5 decoding procedure */
|
||||
const int8_t gbat0_x = ((HTEMPLATE <= 1) ? 3 : 2);
|
||||
PDFJBIG2BitmapDecodingParameters parameters;
|
||||
parameters.MMR = HMMR;
|
||||
parameters.GBW = HGW;
|
||||
@ -2370,7 +2372,7 @@ void PDFJBIG2Decoder::processHalftoneRegion(const PDFJBIG2SegmentHeader& header)
|
||||
parameters.GBTEMPLATE = HTEMPLATE;
|
||||
parameters.SKIP = HENABLESKIP ? &HSKIP : nullptr;
|
||||
parameters.TPGDON = false;
|
||||
parameters.GBAT[0] = { ((HTEMPLATE <= 1) ? 3 : 2), -1 };
|
||||
parameters.GBAT[0] = { gbat0_x, -1 };
|
||||
parameters.GBAT[1] = { -3, -1 };
|
||||
parameters.GBAT[2] = { 2, -2 };
|
||||
parameters.GBAT[3] = { -2, -2 };
|
||||
@ -2661,6 +2663,8 @@ void PDFJBIG2Decoder::processPageInformation(const PDFJBIG2SegmentHeader&)
|
||||
const uint8_t flags = m_reader.readUnsignedByte();
|
||||
const uint16_t striping = m_reader.readUnsignedWord();
|
||||
|
||||
Q_UNUSED(striping);
|
||||
|
||||
m_pageDefaultPixelValue = (flags & 0x04) ? 0xFF : 0x00;
|
||||
m_pageDefaultCompositionOperatorOverriden = (flags & 0x40);
|
||||
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
|
||||
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 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; }
|
||||
@ -152,8 +153,8 @@ public:
|
||||
std::vector<PDFMediaPlayer>&& playersAlternate,
|
||||
std::vector<PDFMediaPlayer>&& playersNeverUsed) :
|
||||
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);
|
||||
|
||||
PDFInteger getMinimumWidth() const { return m_minimumWidth; }
|
||||
PDFInteger getMinimumHeight() const { return m_minimumHeight; }
|
||||
PDFInteger getMonitorSpecifier() const { return m_monitorSpecifier; }
|
||||
|
||||
private:
|
||||
PDFInteger m_minimumWidth;
|
||||
PDFInteger m_minimumHeight;
|
||||
|
@ -132,12 +132,12 @@ public:
|
||||
inline ~PDFInplaceOrMemoryString() = default;
|
||||
|
||||
// Enforce default copy constructor and default move constructor
|
||||
constexpr inline PDFInplaceOrMemoryString(const PDFInplaceOrMemoryString&) = default;
|
||||
constexpr inline PDFInplaceOrMemoryString(PDFInplaceOrMemoryString&&) = default;
|
||||
inline PDFInplaceOrMemoryString(const PDFInplaceOrMemoryString&) = default;
|
||||
inline PDFInplaceOrMemoryString(PDFInplaceOrMemoryString&&) = default;
|
||||
|
||||
// Enforce default copy assignment operator and move assignment operator
|
||||
constexpr inline PDFInplaceOrMemoryString& operator=(const PDFInplaceOrMemoryString&) = default;
|
||||
constexpr inline PDFInplaceOrMemoryString& operator=(PDFInplaceOrMemoryString&&) = default;
|
||||
inline PDFInplaceOrMemoryString& operator=(const PDFInplaceOrMemoryString&) = default;
|
||||
inline PDFInplaceOrMemoryString& operator=(PDFInplaceOrMemoryString&&) = default;
|
||||
|
||||
bool equals(const char* value, size_t length) const;
|
||||
|
||||
@ -183,8 +183,8 @@ public:
|
||||
|
||||
// Default constructor should be constexpr
|
||||
constexpr inline PDFObject() :
|
||||
m_type(Type::Null),
|
||||
m_data()
|
||||
m_data(),
|
||||
m_type(Type::Null)
|
||||
{
|
||||
|
||||
}
|
||||
@ -193,12 +193,12 @@ public:
|
||||
inline ~PDFObject() = default;
|
||||
|
||||
// Enforce default copy constructor and default move constructor
|
||||
constexpr inline PDFObject(const PDFObject&) = default;
|
||||
constexpr inline PDFObject(PDFObject&&) = default;
|
||||
inline PDFObject(const PDFObject&) = default;
|
||||
inline PDFObject(PDFObject&&) = default;
|
||||
|
||||
// Enforce default copy assignment operator and move assignment operator
|
||||
constexpr inline PDFObject& operator=(const PDFObject&) = default;
|
||||
constexpr inline PDFObject& operator=(PDFObject&&) = default;
|
||||
inline PDFObject& operator=(const PDFObject&) = default;
|
||||
inline PDFObject& operator=(PDFObject&&) = default;
|
||||
|
||||
inline Type getType() const { return m_type; }
|
||||
|
||||
@ -268,7 +268,7 @@ public:
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
constexpr inline PDFObject(Type type, T&& value) :
|
||||
inline PDFObject(Type type, T&& value) :
|
||||
m_data(std::forward<T>(value)),
|
||||
m_type(type)
|
||||
{
|
||||
@ -310,7 +310,7 @@ private:
|
||||
class PDFArray : public PDFObjectContent
|
||||
{
|
||||
public:
|
||||
inline constexpr PDFArray() = default;
|
||||
inline PDFArray() = default;
|
||||
inline PDFArray(std::vector<PDFObject>&& objects) : m_objects(qMove(objects)) { }
|
||||
virtual ~PDFArray() override = default;
|
||||
|
||||
@ -354,7 +354,7 @@ class Pdf4QtLIBSHARED_EXPORT PDFDictionary : public PDFObjectContent
|
||||
public:
|
||||
using DictionaryEntry = std::pair<PDFInplaceOrMemoryString, PDFObject>;
|
||||
|
||||
inline constexpr PDFDictionary() = default;
|
||||
inline PDFDictionary() = default;
|
||||
inline PDFDictionary(std::vector<DictionaryEntry>&& dictionary) : m_dictionary(qMove(dictionary)) { }
|
||||
virtual ~PDFDictionary() override = default;
|
||||
|
||||
@ -453,7 +453,7 @@ private:
|
||||
class PDFStream : public PDFObjectContent
|
||||
{
|
||||
public:
|
||||
inline explicit constexpr PDFStream() = default;
|
||||
inline explicit PDFStream() = default;
|
||||
inline explicit PDFStream(PDFDictionary&& dictionary, QByteArray&& content) :
|
||||
m_dictionary(std::move(dictionary)),
|
||||
m_content(std::move(content))
|
||||
|
@ -45,6 +45,15 @@ enum ObjectEditorAttributeType
|
||||
|
||||
struct PDFObjectEditorModelAttributeEnumItem
|
||||
{
|
||||
PDFObjectEditorModelAttributeEnumItem() = default;
|
||||
PDFObjectEditorModelAttributeEnumItem(QString name, uint32_t flags, PDFObject value) :
|
||||
name(qMove(name)),
|
||||
flags(flags),
|
||||
value(qMove(value))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString name;
|
||||
uint32_t flags = 0;
|
||||
PDFObject value;
|
||||
|
@ -231,7 +231,7 @@ void PDFOptimizer::optimize()
|
||||
{
|
||||
// Jakub Melka: We divide optimization into stages, each
|
||||
// stage can consist from multiple passes.
|
||||
constexpr auto stages = { OptimizationFlags(DereferenceSimpleObjects),
|
||||
constexpr OptimizationFlags stages[] = { OptimizationFlags(DereferenceSimpleObjects),
|
||||
OptimizationFlags(RemoveNullObjects),
|
||||
OptimizationFlags(RemoveUnusedObjects | MergeIdenticalObjects),
|
||||
OptimizationFlags(ShrinkObjectStorage),
|
||||
@ -337,7 +337,7 @@ bool PDFOptimizer::performRemoveUnusedObjects()
|
||||
std::set<PDFObjectReference> references = PDFObjectUtils::getReferences({ m_storage.getTrailerDictionary() }, m_storage);
|
||||
|
||||
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];
|
||||
PDFObjectReference reference(PDFInteger(index), entry.generation);
|
||||
|
@ -80,10 +80,10 @@ class PDFOptionalContentMembershipObject
|
||||
public:
|
||||
explicit PDFOptionalContentMembershipObject() = default;
|
||||
|
||||
constexpr inline PDFOptionalContentMembershipObject(const PDFOptionalContentMembershipObject&) = delete;
|
||||
constexpr inline PDFOptionalContentMembershipObject(PDFOptionalContentMembershipObject&&) = default;
|
||||
constexpr inline PDFOptionalContentMembershipObject& operator=(const PDFOptionalContentMembershipObject&) = delete;
|
||||
constexpr inline PDFOptionalContentMembershipObject& operator=(PDFOptionalContentMembershipObject&&) = default;
|
||||
inline PDFOptionalContentMembershipObject(const PDFOptionalContentMembershipObject&) = delete;
|
||||
inline PDFOptionalContentMembershipObject(PDFOptionalContentMembershipObject&&) = default;
|
||||
inline PDFOptionalContentMembershipObject& operator=(const PDFOptionalContentMembershipObject&) = delete;
|
||||
inline PDFOptionalContentMembershipObject& operator=(PDFOptionalContentMembershipObject&&) = default;
|
||||
|
||||
/// Creates optional content membership dictionary. If creation fails, then
|
||||
/// exception is thrown.
|
||||
|
@ -3369,12 +3369,12 @@ bool PDFPageContentProcessor::isContentSuppressedByOC(PDFObjectReference ocgOrOc
|
||||
|
||||
PDFPageContentProcessor::PDFPageContentProcessorState::PDFPageContentProcessorState() :
|
||||
m_currentTransformationMatrix(),
|
||||
m_fillColorSpace(),
|
||||
m_strokeColorSpace(),
|
||||
m_fillColor(Qt::black),
|
||||
m_fillColorOriginal(),
|
||||
m_fillColorSpace(),
|
||||
m_strokeColor(Qt::black),
|
||||
m_strokeColorOriginal(),
|
||||
m_fillColor(Qt::black),
|
||||
m_fillColorOriginal(),
|
||||
m_lineWidth(1.0),
|
||||
m_lineCapStyle(Qt::FlatCap),
|
||||
m_lineJoinStyle(Qt::MiterJoin),
|
||||
|
@ -51,8 +51,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void performUpdateGraphicsState(const PDFPageContentProcessorState& state) override;
|
||||
virtual void performBeginTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup);
|
||||
virtual void performEndTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup);
|
||||
virtual void performBeginTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup) override;
|
||||
virtual void performEndTransparencyGroup(ProcessOrder order, const PDFTransparencyGroup& transparencyGroup) override;
|
||||
virtual void setWorldMatrix(const QMatrix& matrix) = 0;
|
||||
virtual void setCompositionMode(QPainter::CompositionMode mode) = 0;
|
||||
|
||||
|
@ -672,8 +672,8 @@ void PDFParsingContext::endParsingObject(PDFObjectReference reference)
|
||||
|
||||
PDFParser::PDFParser(const QByteArray& data, PDFParsingContext* context, Features features) :
|
||||
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_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) :
|
||||
m_context(context),
|
||||
m_lexicalAnalyzer(begin, end),
|
||||
m_features(features)
|
||||
m_features(features),
|
||||
m_lexicalAnalyzer(begin, end)
|
||||
{
|
||||
m_lookAhead1 = 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) :
|
||||
m_tokenFetcher(qMove(tokenFetcher)),
|
||||
m_context(nullptr),
|
||||
m_lexicalAnalyzer(nullptr, nullptr),
|
||||
m_features(None)
|
||||
m_features(None),
|
||||
m_lexicalAnalyzer(nullptr, nullptr)
|
||||
{
|
||||
m_lookAhead1 = fetch();
|
||||
m_lookAhead2 = fetch();
|
||||
|
@ -1672,7 +1672,7 @@ PDFMesh PDFFreeFormGouradTriangleShading::createMesh(const PDFMeshQualitySetting
|
||||
const VertexData* vc = 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 vib = vb->index;
|
||||
|
@ -217,7 +217,7 @@ class PDFInvalidPattern : public PDFPattern
|
||||
public:
|
||||
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 PDFTilingPattern* getTilingPattern() const override { return nullptr; }
|
||||
};
|
||||
@ -399,7 +399,7 @@ public:
|
||||
|
||||
virtual ShadingType getShadingType() 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:
|
||||
friend class PDFPattern;
|
||||
|
@ -55,8 +55,8 @@ private:
|
||||
std::atomic<int> m_percentage = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ProgressStartupInfo)
|
||||
|
||||
} // namespace pdf
|
||||
|
||||
Q_DECLARE_METATYPE(pdf::ProgressStartupInfo)
|
||||
|
||||
#endif // PDFPROGRESS_H
|
||||
|
@ -837,7 +837,7 @@ std::vector<PDFInteger> PDFPageImageExportSettings::getPages() const
|
||||
}
|
||||
|
||||
// We must remove duplicate pages
|
||||
qSort(result);
|
||||
std::sort(result.begin(), result.end());
|
||||
result.erase(std::unique(result.begin(), result.end()), result.end());
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ PDFRenderingErrorsWidget::PDFRenderingErrorsWidget(QWidget* parent, PDFWidget* p
|
||||
|
||||
Q_ASSERT(pdfWidget);
|
||||
std::vector<PDFInteger> currentPages = pdfWidget->getDrawWidget()->getCurrentPages();
|
||||
qSort(currentPages);
|
||||
std::sort(currentPages.begin(), currentPages.end());
|
||||
|
||||
QTreeWidgetItem* scrollToItem = nullptr;
|
||||
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);
|
||||
ui->renderErrorsTreeWidget->setItemExpanded(root, isCurrentPage);
|
||||
root->setExpanded(isCurrentPage);
|
||||
|
||||
if (isCurrentPage && !scrollToItem)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ protected:
|
||||
class PDFNoneSecurityHandler : public PDFSecurityHandler
|
||||
{
|
||||
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 QByteArray decrypt(const QByteArray& data, PDFObjectReference, EncryptionScope) 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
|
||||
{
|
||||
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 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 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; }
|
||||
|
||||
struct AuthorizationData
|
||||
@ -218,7 +218,7 @@ public:
|
||||
};
|
||||
|
||||
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
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ QByteArray PDFAscii85DecodeFilter::apply(const QByteArray& data,
|
||||
const unsigned char* it = dataBegin;
|
||||
const constexpr uint32_t STREAM_END = 0xFFFFFFFF;
|
||||
|
||||
auto getChar = [&it, dataEnd, STREAM_END]() -> uint32_t
|
||||
auto getChar = [&it, dataEnd]() -> uint32_t
|
||||
{
|
||||
// Skip whitespace characters
|
||||
while (it != dataEnd && PDFLexicalAnalyzer::isWhitespace(*it))
|
||||
|
@ -211,7 +211,7 @@ public:
|
||||
const PDFObject& parameters,
|
||||
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
|
||||
/// recompressed again with maximal compress ratio possible.
|
||||
|
@ -858,7 +858,7 @@ PDFTextBlock::PDFTextBlock(PDFTextLines textLines) :
|
||||
const PDFReal xR = br.x();
|
||||
const PDFReal yL = qRound(bl.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);
|
||||
|
||||
|
@ -503,7 +503,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
|
||||
{
|
||||
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);
|
||||
B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]);
|
||||
@ -511,7 +511,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
|
||||
}
|
||||
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);
|
||||
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)
|
||||
{
|
||||
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);
|
||||
B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]);
|
||||
@ -532,7 +532,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
|
||||
}
|
||||
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);
|
||||
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:
|
||||
{
|
||||
// Gray
|
||||
const PDFGray Cb = backdropColor[pixelFormat.getProcessColorChannelIndexStart()];
|
||||
const PDFGray Cs = sourceColor[pixelFormat.getProcessColorChannelIndexStart()];
|
||||
const PDFGray Cb = backdropColor[processColorChannelStart];
|
||||
const PDFGray Cs = sourceColor[processColorChannelStart];
|
||||
const PDFGray blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs);
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart()] = blended;
|
||||
break;
|
||||
@ -560,35 +560,35 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
|
||||
case 3:
|
||||
{
|
||||
// RGB
|
||||
const PDFRGB Cb = { backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 0],
|
||||
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 1],
|
||||
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 2] };
|
||||
const PDFRGB Cs = { sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 0],
|
||||
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 1],
|
||||
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 2] };
|
||||
const PDFRGB Cb = { backdropColor[processColorChannelStart + 0],
|
||||
backdropColor[processColorChannelStart + 1],
|
||||
backdropColor[processColorChannelStart + 2] };
|
||||
const PDFRGB Cs = { sourceColor[processColorChannelStart + 0],
|
||||
sourceColor[processColorChannelStart + 1],
|
||||
sourceColor[processColorChannelStart + 2] };
|
||||
const PDFRGB blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs);
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart() + 0] = blended[0];
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart() + 1] = blended[1];
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart() + 2] = blended[2];
|
||||
B_i[processColorChannelStart + 0] = blended[0];
|
||||
B_i[processColorChannelStart + 1] = blended[1];
|
||||
B_i[processColorChannelStart + 2] = blended[2];
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
{
|
||||
// CMYK
|
||||
const PDFCMYK Cb = { backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 0],
|
||||
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 1],
|
||||
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 2],
|
||||
backdropColor[pixelFormat.getProcessColorChannelIndexStart() + 3] };
|
||||
const PDFCMYK Cs = { sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 0],
|
||||
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 1],
|
||||
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 2],
|
||||
sourceColor[pixelFormat.getProcessColorChannelIndexStart() + 3] };
|
||||
const PDFCMYK Cb = { backdropColor[processColorChannelStart + 0],
|
||||
backdropColor[processColorChannelStart + 1],
|
||||
backdropColor[processColorChannelStart + 2],
|
||||
backdropColor[processColorChannelStart + 3] };
|
||||
const PDFCMYK Cs = { sourceColor[processColorChannelStart + 0],
|
||||
sourceColor[processColorChannelStart + 1],
|
||||
sourceColor[processColorChannelStart + 2],
|
||||
sourceColor[processColorChannelStart + 3] };
|
||||
const PDFCMYK blended = PDFBlendFunction::blend_Nonseparable(mode, Cb, Cs);
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart() + 0] = blended[0];
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart() + 1] = blended[1];
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart() + 2] = blended[2];
|
||||
B_i[pixelFormat.getProcessColorChannelIndexStart() + 3] = blended[3];
|
||||
B_i[processColorChannelStart + 0] = blended[0];
|
||||
B_i[processColorChannelStart + 1] = blended[1];
|
||||
B_i[processColorChannelStart + 2] = blended[2];
|
||||
B_i[processColorChannelStart + 3] = blended[3];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -606,7 +606,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
|
||||
const bool isSpotColorSubtractive = pixelFormat.hasSpotColorsSubtractive();
|
||||
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);
|
||||
B_i[i] = PDFBlendFunction::blend(pixelBlendMode, backdropColor[i], sourceColor[i]);
|
||||
@ -614,7 +614,7 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
|
||||
}
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -616,8 +616,8 @@ public:
|
||||
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 bool performPathPaintingUsingShading(const QPainterPath& path, bool stroke, bool fill, const PDFShadingPattern* shadingPattern);
|
||||
virtual void performFinishPathPainting();
|
||||
virtual bool performPathPaintingUsingShading(const QPainterPath& path, bool stroke, bool fill, const PDFShadingPattern* shadingPattern) override;
|
||||
virtual void performFinishPathPainting() override;
|
||||
virtual void performClipping(const QPainterPath& path, Qt::FillRule fillRule) override;
|
||||
virtual void performUpdateGraphicsState(const PDFPageContentProcessorState& state) override;
|
||||
virtual void performSaveGraphicState(ProcessOrder order) override;
|
||||
@ -628,7 +628,7 @@ public:
|
||||
virtual void performTextEnd(ProcessOrder order) override;
|
||||
virtual bool performOriginalImagePainting(const PDFImage& image) override;
|
||||
virtual void performImagePainting(const QImage& image) override;
|
||||
virtual void performMeshPainting(const PDFMesh& mesh);
|
||||
virtual void performMeshPainting(const PDFMesh& mesh) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:5033)
|
||||
#define CMS_NO_REGISTER_KEYWORD
|
||||
#include <lcms2.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
@ -444,7 +445,7 @@ void PDFClosedIntervalSet::normalize()
|
||||
// 1) sort all ranges
|
||||
// 2) merge adjacent ones
|
||||
|
||||
qSort(m_intervals);
|
||||
std::sort(m_intervals.begin(), m_intervals.end());
|
||||
|
||||
std::vector<ClosedInterval> intervals;
|
||||
auto it = m_intervals.cbegin();
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
namespace pdf
|
||||
{
|
||||
@ -518,10 +519,10 @@ class PDFBuffer
|
||||
public:
|
||||
using value_type = T;
|
||||
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 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() :
|
||||
m_begin(nullptr),
|
||||
|
@ -205,8 +205,8 @@ PDFFindTextTool::PDFFindTextTool(PDFDrawWidgetProxy* proxy, QAction* prevAction,
|
||||
BaseClass(proxy, parent),
|
||||
m_prevAction(prevAction),
|
||||
m_nextAction(nextAction),
|
||||
m_dialog(nullptr),
|
||||
m_parentDialog(parentDialog),
|
||||
m_dialog(nullptr),
|
||||
m_caseSensitiveCheckBox(nullptr),
|
||||
m_wholeWordsCheckBox(nullptr),
|
||||
m_findTextEdit(nullptr),
|
||||
|
@ -37,15 +37,15 @@ class PDFXRefTable
|
||||
Q_DECLARE_TR_FUNCTIONS(pdf::PDFXRefTable)
|
||||
|
||||
public:
|
||||
constexpr inline explicit PDFXRefTable() = default;
|
||||
inline explicit PDFXRefTable() = default;
|
||||
|
||||
// Enforce default copy constructor and default move constructor
|
||||
constexpr inline PDFXRefTable(const PDFXRefTable&) = default;
|
||||
constexpr inline PDFXRefTable(PDFXRefTable&&) = default;
|
||||
inline PDFXRefTable(const PDFXRefTable&) = default;
|
||||
inline PDFXRefTable(PDFXRefTable&&) = default;
|
||||
|
||||
// Enforce default copy assignment operator and move assignment operator
|
||||
constexpr inline PDFXRefTable& operator=(const PDFXRefTable&) = default;
|
||||
constexpr inline PDFXRefTable& operator=(PDFXRefTable&&) = default;
|
||||
inline PDFXRefTable& operator=(const PDFXRefTable&) = default;
|
||||
inline PDFXRefTable& operator=(PDFXRefTable&&) = default;
|
||||
|
||||
enum class EntryType
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user