From 568ecdfabe9f69f2a5b976ff7831f60534c3e5f3 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Fri, 25 Jan 2019 20:05:03 +0100 Subject: [PATCH] Update to 0.73.0 --- .gitignore | 2 + 0001-Revert-Remove-the-Qt4-frontend.patch | 602 +++++++++--------- poppler-0.30.0-rotated-words-selection.patch | 8 +- poppler-0.63.0-tiling-patterns.patch | 6 +- poppler-0.67.0-cycles-in-pdf-parsing.patch | 65 -- poppler-0.67.0-display-profile.patch | 63 -- poppler-0.67.0-dummy-xref-entry.patch | 63 -- poppler-0.67.0-embedded-file-check.patch | 71 --- poppler-0.67.0-filespec.patch | 35 - poppler-0.67.0-qt4-const.patch | 248 +------- poppler-0.67.0-rich-media-annotation.patch | 51 -- poppler-0.67.0-stream-check.patch | 28 - poppler-0.67.0-valid-embedded-file-name.patch | 81 --- poppler-0.67.0-valid-embedded-file.patch | 46 -- poppler.spec | 44 +- sources | 4 +- 16 files changed, 342 insertions(+), 1075 deletions(-) delete mode 100644 poppler-0.67.0-cycles-in-pdf-parsing.patch delete mode 100644 poppler-0.67.0-display-profile.patch delete mode 100644 poppler-0.67.0-dummy-xref-entry.patch delete mode 100644 poppler-0.67.0-embedded-file-check.patch delete mode 100644 poppler-0.67.0-filespec.patch delete mode 100644 poppler-0.67.0-rich-media-annotation.patch delete mode 100644 poppler-0.67.0-stream-check.patch delete mode 100644 poppler-0.67.0-valid-embedded-file-name.patch delete mode 100644 poppler-0.67.0-valid-embedded-file.patch diff --git a/.gitignore b/.gitignore index 8a977c2..d6cddd7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ /poppler-0.62.0.tar.xz /poppler-0.63.0.tar.xz /poppler-0.67.0.tar.xz +/poppler-0.73.0.tar.xz +/poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz diff --git a/0001-Revert-Remove-the-Qt4-frontend.patch b/0001-Revert-Remove-the-Qt4-frontend.patch index b01cdd9..b6c4495 100644 --- a/0001-Revert-Remove-the-Qt4-frontend.patch +++ b/0001-Revert-Remove-the-Qt4-frontend.patch @@ -227,7 +227,7 @@ index 5e3d6a17..431059fb 100644 +++ b/CMakeLists.txt @@ -40,6 +40,7 @@ set (CMAKE_CXX_EXTENSIONS OFF) # command line switches - option(ENABLE_XPDF_HEADERS "Install unsupported xpdf headers." OFF) + option(ENABLE_UNSTABLE_API_ABI_HEADERS "Install API/ABI unstable xpdf headers." OFF) option(BUILD_GTK_TESTS "Whether compile the GTK+ test programs." ON) +option(BUILD_QT4_TESTS "Whether compile the Qt4 test programs." ON) option(BUILD_QT5_TESTS "Whether compile the Qt5 test programs." ON) @@ -3875,11 +3875,11 @@ index 00000000..f2fa6f17 +class SplashOutFontFileID: public SplashFontFileID { +public: + -+ SplashOutFontFileID(Ref *rA) { r = *rA; } ++ SplashOutFontFileID(const Ref *rA) { r = *rA; } + + ~SplashOutFontFileID() {} + -+ GBool matches(SplashFontFileID *id) { ++ bool matches(SplashFontFileID *id) { + return ((SplashOutFontFileID *)id)->r.num == r.num && + ((SplashOutFontFileID *)id)->r.gen == r.gen; + } @@ -3957,7 +3957,7 @@ index 00000000..f2fa6f17 +void ArthurOutputDev::updateAll(GfxState *state) +{ + OutputDev::updateAll(state); -+ m_needFontUpdate = gTrue; ++ m_needFontUpdate = true; +} + +// This looks wrong - why aren't adjusting the matrix? @@ -4084,7 +4084,7 @@ index 00000000..f2fa6f17 + char *tmpBuf; + int tmpBufLen = 0; + int *codeToGID; -+ double *textMat; ++ const double *textMat; + double m11, m12, m21, m22, fontSize; + SplashCoord mat[4]; + int n; @@ -4114,7 +4114,7 @@ index 00000000..f2fa6f17 + + if (!(fontLoc = gfxFont->locateFont(xref, NULL))) { + error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4134,9 +4134,9 @@ index 00000000..f2fa6f17 + + fontsrc = new SplashFontSrc; + if (fileName) -+ fontsrc->setFile(fileName, gFalse); ++ fontsrc->setFile(fileName, false); + else -+ fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue); ++ fontsrc->setBuf(tmpBuf, tmpBufLen, true); + + // load the font file + switch (fontType) { @@ -4146,7 +4146,7 @@ index 00000000..f2fa6f17 + fontsrc, + (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) { + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4157,7 +4157,7 @@ index 00000000..f2fa6f17 + fontsrc, + (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) { + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4168,7 +4168,7 @@ index 00000000..f2fa6f17 + fontsrc, + (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) { + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4176,7 +4176,7 @@ index 00000000..f2fa6f17 + case fontTrueType: + case fontTrueTypeOT: + if (fileName) -+ ff = FoFiTrueType::load(fileName->getCString()); ++ ff = FoFiTrueType::load(fileName->c_str()); + else + ff = FoFiTrueType::make(tmpBuf, tmpBufLen); + if (ff) { @@ -4192,7 +4192,7 @@ index 00000000..f2fa6f17 + fontsrc, + codeToGID, n))) { + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4203,7 +4203,7 @@ index 00000000..f2fa6f17 + id, + fontsrc))) { + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4223,7 +4223,7 @@ index 00000000..f2fa6f17 + fontsrc, + codeToGID, n))) { + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4237,11 +4237,11 @@ index 00000000..f2fa6f17 + if (n) { + codeToGID = (int *)gmallocn(n, sizeof(int)); + memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), -+ n * sizeof(Gushort)); ++ n * sizeof(int)); + } + } else { + if (fileName) -+ ff = FoFiTrueType::load(fileName->getCString()); ++ ff = FoFiTrueType::load(fileName->c_str()); + else + ff = FoFiTrueType::make(tmpBuf, tmpBufLen); + if (! ff) @@ -4254,7 +4254,7 @@ index 00000000..f2fa6f17 + fontsrc, + codeToGID, n, faceIndex))) { + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->getCString() ++ gfxFont->getName() ? gfxFont->getName()->c_str() + : "(unnamed)"); + goto err2; + } @@ -4373,7 +4373,7 @@ index 00000000..f2fa6f17 + double px, py; +// SplashPath *path; + int render; -+ Guchar f; ++ unsigned char f; + + if (m_needFontUpdate) { + updateFont(state); @@ -4465,11 +4465,11 @@ index 00000000..f2fa6f17 +#endif +} + -+GBool ArthurOutputDev::beginType3Char(GfxState *state, double x, double y, ++bool ArthurOutputDev::beginType3Char(GfxState *state, double x, double y, + double dx, double dy, + CharCode code, Unicode *u, int uLen) +{ -+ return gFalse; ++ return false; +} + +void ArthurOutputDev::endType3Char(GfxState *state) @@ -4491,8 +4491,8 @@ index 00000000..f2fa6f17 + + +void ArthurOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, -+ int width, int height, GBool invert, -+ GBool interpolate, GBool inlineImg) ++ int width, int height, bool invert, ++ bool interpolate, bool inlineImg) +{ + qDebug() << "drawImageMask"; +#if 0 @@ -4570,15 +4570,15 @@ index 00000000..f2fa6f17 +void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, + GfxImageColorMap *colorMap, -+ GBool interpolate, int *maskColors, GBool inlineImg) ++ bool interpolate, int *maskColors, bool inlineImg) +{ + unsigned int *data; + unsigned int *line; + int x, y; + ImageStream *imgStr; -+ Guchar *pix; ++ unsigned char *pix; + int i; -+ double *ctm; ++ const double *ctm; + QMatrix matrix; + QImage image; + int stride; @@ -4627,7 +4627,7 @@ new file mode 100644 index 00000000..9d5e8679 --- /dev/null +++ b/qt4/src/ArthurOutputDev.h -@@ -0,0 +1,170 @@ +@@ -0,0 +1,169 @@ +//======================================================================== +// +// ArthurOutputDev.h @@ -4662,7 +4662,6 @@ index 00000000..9d5e8679 +#pragma interface +#endif + -+#include "goo/gtypes.h" +#include "OutputDev.h" +#include "GfxState.h" + @@ -4705,14 +4704,14 @@ index 00000000..9d5e8679 + + // Does this device use upside-down coordinates? + // (Upside-down means (0,0) is the top left corner of the page.) -+ virtual GBool upsideDown() { return gTrue; } ++ virtual bool upsideDown() { return true; } + + // Does this device use drawChar() or drawString()? -+ virtual GBool useDrawChar() { return gTrue; } ++ virtual bool useDrawChar() { return true; } + + // Does this device use beginType3Char/endType3Char? Otherwise, + // text in Type 3 fonts will be drawn with drawChar/drawString. -+ virtual GBool interpretType3Chars() { return gTrue; } ++ virtual bool interpretType3Chars() { return true; } + + //----- initialization and control + @@ -4759,7 +4758,7 @@ index 00000000..9d5e8679 + double dx, double dy, + double originX, double originY, + CharCode code, int nBytes, Unicode *u, int uLen); -+ virtual GBool beginType3Char(GfxState *state, double x, double y, ++ virtual bool beginType3Char(GfxState *state, double x, double y, + double dx, double dy, + CharCode code, Unicode *u, int uLen); + virtual void endType3Char(GfxState *state); @@ -4767,11 +4766,11 @@ index 00000000..9d5e8679 + + //----- image drawing + virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, -+ int width, int height, GBool invert, -+ GBool interpolate, GBool inlineImg); ++ int width, int height, bool invert, ++ bool interpolate, bool inlineImg); + virtual void drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, -+ GBool interpolate, int *maskColors, GBool inlineImg); ++ bool interpolate, int *maskColors, bool inlineImg); + + //----- Type 3 font operators + virtual void type3D0(GfxState *state, double wx, double wy); @@ -4783,7 +4782,7 @@ index 00000000..9d5e8679 + // Called to indicate that a new PDF document has been loaded. + void startDoc(XRef *xrefA); + -+ GBool isReverseVideo() { return gFalse; } ++ bool isReverseVideo() { return false; } + +private: + QPainter *m_painter; @@ -4791,7 +4790,7 @@ index 00000000..9d5e8679 + QFont m_currentFont; + QPen m_currentPen; + QBrush m_currentBrush; -+ GBool m_needFontUpdate; // set when the font needs to be updated ++ bool m_needFontUpdate; // set when the font needs to be updated + SplashFontEngine *m_fontEngine; + SplashFont *m_font; // current font + XRef *xref; // xref table for current document @@ -6597,7 +6596,7 @@ new file mode 100644 index 00000000..3150569c --- /dev/null +++ b/qt4/src/poppler-annotation-helper.h -@@ -0,0 +1,181 @@ +@@ -0,0 +1,183 @@ +/* poppler-annotation-helper.h: qt interface to poppler + * Copyright (C) 2006, 2008, 2017, Albert Astals Cid + * Copyright (C) 2008, Pino Toscano @@ -6620,6 +6619,8 @@ index 00000000..3150569c + * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ + ++#include ++ +#include + +#include @@ -6665,7 +6666,7 @@ index 00000000..3150569c + if ( stringObj.isNull() ) + return; + if ( stringObj.isString() ) -+ dest = stringObj.getString()->getCString(); ++ dest = stringObj.getString()->c_str(); + else + qDebug() << type << " is not String." << endl; +} @@ -6676,7 +6677,7 @@ index 00000000..3150569c + if ( boolObj.isNull() ) + return; + if ( boolObj.isBool() ) -+ dest = boolObj.getBool() == gTrue; ++ dest = boolObj.getBool() == true; + else + qDebug() << type << " is not Bool." << endl; +} @@ -6750,7 +6751,7 @@ index 00000000..3150569c + return; + if ( dateObj.isString() ) + { -+ dest = convertDate( dateObj.getString()->getCString() ); ++ dest = convertDate( dateObj.getString()->c_str() ); + } + else + qDebug() << type << " is not Date" << endl; @@ -6775,8 +6776,8 @@ index 00000000..3150569c + y = invM[1] * xt + invM[3] * yt; +} + -+QColor convertAnnotColor( AnnotColor *color ); -+AnnotColor* convertQColor( const QColor &color ); ++QColor convertAnnotColor( const AnnotColor *color ); ++std::unique_ptr convertQColor( const QColor &c ); + +} diff --git a/qt4/src/poppler-annotation-private.h b/qt4/src/poppler-annotation-private.h @@ -6902,7 +6903,7 @@ new file mode 100644 index 00000000..8a7f60b1 --- /dev/null +++ b/qt4/src/poppler-annotation.cc -@@ -0,0 +1,5089 @@ +@@ -0,0 +1,5118 @@ +/* poppler-annotation.cc: qt interface to poppler + * Copyright (C) 2006, 2009, 2012-2015 Albert Astals Cid + * Copyright (C) 2006, 2008, 2010 Pino Toscano @@ -6964,10 +6965,10 @@ index 00000000..8a7f60b1 +{ + // safety check on annotation element + if ( !annElement.hasAttribute( "type" ) ) -+ return 0; ++ return nullptr; + + // build annotation of given type -+ Annotation * annotation = 0; ++ Annotation * annotation = nullptr; + int typeNumber = annElement.attribute( "type" ).toInt(); + switch ( typeNumber ) + { @@ -7029,8 +7030,8 @@ index 00000000..8a7f60b1 +//BEGIN Annotation implementation +AnnotationPrivate::AnnotationPrivate() + : flags( 0 ), revisionScope ( Annotation::Root ), -+ revisionType ( Annotation::None ), pdfAnnot ( 0 ), pdfPage ( 0 ), -+ parentDoc ( 0 ) ++ revisionType ( Annotation::None ), pdfAnnot ( nullptr ), pdfPage ( nullptr ), ++ parentDoc ( nullptr ) +{ +} + @@ -7111,8 +7112,8 @@ index 00000000..8a7f60b1 + Q_ASSERT ( pdfPage ); + + // build a normalized transform matrix for this page at 100% scale -+ GfxState * gfxState = new GfxState( 72.0, 72.0, pdfPage->getCropBox(), pageRotation, gTrue ); -+ double * gfxCTM = gfxState->getCTM(); ++ GfxState * gfxState = new GfxState( 72.0, 72.0, pdfPage->getCropBox(), pageRotation, true ); ++ const double * gfxCTM = gfxState->getCTM(); + + double w = pdfPage->getCropWidth(); + double h = pdfPage->getCropHeight(); @@ -7255,20 +7256,20 @@ index 00000000..8a7f60b1 +AnnotPath * AnnotationPrivate::toAnnotPath(const QLinkedList &list) const +{ + const int count = list.size(); -+ AnnotCoord **ac = (AnnotCoord **) gmallocn(count, sizeof(AnnotCoord*)); ++ std::vector ac; ++ ac.reserve(count); + + double MTX[6]; + fillTransformationMTX(MTX); + -+ int pos = 0; + foreach (const QPointF &p, list) + { + double x, y; + XPDFReader::invTransform( MTX, p, x, y ); -+ ac[pos++] = new AnnotCoord(x, y); ++ ac.emplace_back(x, y); + } + -+ return new AnnotPath(ac, count); ++ return new AnnotPath(std::move(ac)); +} + +QList AnnotationPrivate::findAnnotations(::Page *pdfPage, DocumentData *doc, const QSet &subtypes, int parentID) @@ -7318,7 +7319,7 @@ index 00000000..8a7f60b1 + continue; + + /* Create Annotation of the right subclass */ -+ Annotation * annotation = 0; ++ Annotation * annotation = nullptr; + Annot::AnnotSubtype subType = ann->getType(); + + switch ( subType ) @@ -7407,7 +7408,7 @@ index 00000000..8a7f60b1 + FileAttachmentAnnotation * f = new FileAttachmentAnnotation(); + annotation = f; + // -> fileIcon -+ f->setFileIconName( QString::fromLatin1( attachann->getName()->getCString() ) ); ++ f->setFileIconName( QString::fromLatin1( attachann->getName()->c_str() ) ); + // -> embeddedFile + FileSpec *filespec = new FileSpec( attachann->getFile() ); + f->setEmbeddedFile( new EmbeddedFile( *new EmbeddedFileData( filespec ) ) ); @@ -7422,7 +7423,7 @@ index 00000000..8a7f60b1 + annotation = s; + + // -> soundIcon -+ s->setSoundIconName( QString::fromLatin1( soundann->getName()->getCString() ) ); ++ s->setSoundIconName( QString::fromLatin1( soundann->getName()->c_str() ) ); + // -> sound + s->setSound( new SoundObject( soundann->getSound() ) ); + break; @@ -7439,9 +7440,9 @@ index 00000000..8a7f60b1 + MovieObject *movie = new MovieObject( movieann ); + m->setMovie( movie ); + // -> movieTitle -+ GooString * movietitle = movieann->getTitle(); ++ const GooString * movietitle = movieann->getTitle(); + if ( movietitle ) -+ m->setMovieTitle( QString::fromLatin1( movietitle->getCString() ) ); ++ m->setMovieTitle( QString::fromLatin1( movietitle->c_str() ) ); + break; + } + case Annot::typeScreen: @@ -7459,7 +7460,7 @@ index 00000000..8a7f60b1 + s->setAction( static_cast(popplerLink) ); + + // -> screenTitle -+ GooString * screentitle = screenann->getTitle(); ++ const GooString * screentitle = screenann->getTitle(); + if ( screentitle ) + s->setScreenTitle( UnicodeParsedString( screentitle ) ); + break; @@ -7665,7 +7666,7 @@ index 00000000..8a7f60b1 + +Ref AnnotationPrivate::pdfObjectReference() const +{ -+ if (pdfAnnot == 0) ++ if (pdfAnnot == nullptr) + { + const Ref invalid_ref = { -1, -1 }; + return invalid_ref; @@ -7677,7 +7678,7 @@ index 00000000..8a7f60b1 +Link* AnnotationPrivate::additionalAction( Annotation::AdditionalActionType type ) const +{ + if ( pdfAnnot->getType() != Annot::typeScreen && pdfAnnot->getType() != Annot::typeWidget ) -+ return 0; ++ return nullptr; + + Annot::AdditionalActionsType actionType = Annot::actionCursorEntering; + switch ( type ) @@ -7694,13 +7695,13 @@ index 00000000..8a7f60b1 + case Annotation::PageInvisibleAction: actionType = Annot::actionPageInvisible; break; + } + -+ ::LinkAction *linkAction = 0; ++ ::LinkAction *linkAction = nullptr; + if ( pdfAnnot->getType() == Annot::typeScreen ) + linkAction = static_cast( pdfAnnot )->getAdditionalAction( actionType ); + else + linkAction = static_cast( pdfAnnot )->getAdditionalAction( actionType ); + -+ Link *link = 0; ++ Link *link = nullptr; + + if ( linkAction ) + link = PageData::convertLinkActionToLink( linkAction, parentDoc, QRectF() ); @@ -7710,7 +7711,7 @@ index 00000000..8a7f60b1 + +void AnnotationPrivate::addAnnotationToPage(::Page *pdfPage, DocumentData *doc, const Annotation * ann) +{ -+ if (ann->d_ptr->pdfAnnot != 0) ++ if (ann->d_ptr->pdfAnnot != nullptr) + { + error(errIO, -1, "Annotation is already tied"); + return; @@ -7725,7 +7726,7 @@ index 00000000..8a7f60b1 + +void AnnotationPrivate::removeAnnotationFromPage(::Page *pdfPage, const Annotation * ann) +{ -+ if (ann->d_ptr->pdfAnnot == 0) ++ if (ann->d_ptr->pdfAnnot == nullptr) + { + error(errIO, -1, "Annotation is not tied"); + return; @@ -8330,7 +8331,7 @@ index 00000000..8a7f60b1 + return d->modDate; + + if ( d->pdfAnnot->getModified() ) -+ return convertDate( d->pdfAnnot->getModified()->getCString() ); ++ return convertDate( d->pdfAnnot->getModified()->c_str() ); + else + return QDateTime(); +} @@ -8366,7 +8367,7 @@ index 00000000..8a7f60b1 + const AnnotMarkup *markupann = dynamic_cast(d->pdfAnnot); + + if (markupann && markupann->getDate()) -+ return convertDate( markupann->getDate()->getCString() ); ++ return convertDate( markupann->getDate()->c_str() ); + + return modificationDate(); +} @@ -8531,7 +8532,7 @@ index 00000000..8a7f60b1 + border_effect = static_cast(d->pdfAnnot)->getBorderEffect(); + break; + default: -+ border_effect = 0; ++ border_effect = nullptr; + } + if (border_effect) + { @@ -8558,11 +8559,11 @@ index 00000000..8a7f60b1 + if (markupann) + markupann->setOpacity( style.opacity() ); + -+ AnnotBorderArray * border = new AnnotBorderArray(); ++ auto border = std::make_unique(); + border->setWidth( style.width() ); + border->setHorizontalCorner( style.xCorners() ); + border->setVerticalCorner( style.yCorners() ); -+ d->pdfAnnot->setBorder(border); ++ d->pdfAnnot->setBorder(std::move(border)); +} + +Annotation::Popup Annotation::popup() const @@ -8573,7 +8574,7 @@ index 00000000..8a7f60b1 + return d->popup; + + Popup w; -+ AnnotPopup *popup = 0; ++ AnnotPopup *popup = nullptr; + int flags = -1; // Not initialized + + const AnnotMarkup *markupann = dynamic_cast(d->pdfAnnot); @@ -8733,17 +8734,17 @@ index 00000000..8a7f60b1 + TextAnnotationPrivate(); + Annotation * makeAlias(); + Annot* createNativeAnnot(::Page *destPage, DocumentData *doc); ++ void setDefaultAppearanceToNative(); ++ std::unique_ptr getDefaultAppearanceFromNative() const; + + // data fields + TextAnnotation::TextType textType; + QString textIcon; + QFont textFont; ++ QColor textColor; + int inplaceAlign; // 0:left, 1:center, 2:right + QVector inplaceCallout; + TextAnnotation::InplaceIntent inplaceIntent; -+ -+ // Helper -+ static GooString * toAppearanceString(const QFont &font); +}; + +TextAnnotationPrivate::TextAnnotationPrivate() @@ -8758,13 +8759,6 @@ index 00000000..8a7f60b1 + return new TextAnnotation(*this); +} + -+GooString * TextAnnotationPrivate::toAppearanceString(const QFont &font) -+{ -+ GooString * s = GooString::format("/Invalid_font {0:d} Tf", font.pointSize()); -+ // TODO: Font family, style (bold, italic, ...) and pointSize as float -+ return s; -+} -+ +Annot* TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) +{ + // Setters are defined in the public class @@ -8776,15 +8770,11 @@ index 00000000..8a7f60b1 + + // Set pdfAnnot + PDFRectangle rect = boundaryToPdfRectangle(boundary, flags); -+ if (textType == TextAnnotation::Linked) -+ { -+ pdfAnnot = new AnnotText(destPage->getDoc(), &rect); -+ } -+ else -+ { -+ GooString * da = toAppearanceString(textFont); -+ pdfAnnot = new AnnotFreeText(destPage->getDoc(), &rect, da); -+ delete da; ++ if (textType == TextAnnotation::Linked) { ++ pdfAnnot = new AnnotText(destPage->getDoc(), &rect); ++ } else { ++ DefaultAppearance da{ { objName, "Invalid_font" }, static_cast( textFont.pointSize() ), std::unique_ptr{ convertQColor( textColor ) } }; ++ pdfAnnot = new AnnotFreeText(destPage->getDoc(), &rect, da); + } + + // Set properties @@ -8801,6 +8791,25 @@ index 00000000..8a7f60b1 + return pdfAnnot; +} + ++void TextAnnotationPrivate::setDefaultAppearanceToNative() ++{ ++ if (pdfAnnot && pdfAnnot->getType() == Annot::typeFreeText) { ++ AnnotFreeText * ftextann = static_cast(pdfAnnot); ++ DefaultAppearance da{ { objName, "Invalid_font" }, static_cast( textFont.pointSize() ), std::unique_ptr{ convertQColor( textColor ) } }; ++ ftextann->setDefaultAppearance( da ); ++ } ++} ++ ++std::unique_ptr TextAnnotationPrivate::getDefaultAppearanceFromNative() const ++{ ++ if (pdfAnnot && pdfAnnot->getType() == Annot::typeFreeText) { ++ AnnotFreeText * ftextann = static_cast(pdfAnnot); ++ return ftextann->getDefaultAppearance(); ++ } else { ++ return nullptr; ++ } ++} ++ +TextAnnotation::TextAnnotation( TextAnnotation::TextType type ) + : Annotation( *new TextAnnotationPrivate() ) +{ @@ -8833,6 +8842,11 @@ index 00000000..8a7f60b1 + QFont font; + font.fromString( e.attribute( "font" ) ); + setTextFont(font); ++ if ( e.hasAttribute( "fontColor" ) ) ++ { ++ const QColor color = QColor(e.attribute( "fontColor" ) ); ++ setTextColor(color); ++ } + } + if ( e.hasAttribute( "align" ) ) + setInplaceAlign(e.attribute( "align" ).toInt()); @@ -8892,6 +8906,7 @@ index 00000000..8a7f60b1 + textElement.setAttribute( "intent", (int)inplaceIntent() ); + + textElement.setAttribute( "font", textFont().toString() ); ++ textElement.setAttribute( "fontColor", textColor().name() ); + + // Sub-Node-1 - escapedText + if ( !inplaceText().isEmpty() ) @@ -8955,7 +8970,7 @@ index 00000000..8a7f60b1 + if (d->pdfAnnot->getType() == Annot::typeText) + { + const AnnotText * textann = static_cast(d->pdfAnnot); -+ return QString::fromLatin1( textann->getIcon()->getCString() ); ++ return QString::fromLatin1( textann->getIcon()->c_str() ); + } + + return QString(); @@ -8991,16 +9006,9 @@ index 00000000..8a7f60b1 + + if (d->pdfAnnot->getType() == Annot::typeFreeText) + { -+ const AnnotFreeText * ftextann = static_cast(d->pdfAnnot); -+ const GooString * da = ftextann->getAppearanceString(); -+ if (da) ++ if ( std::unique_ptr da{ d->getDefaultAppearanceFromNative() } ) + { -+ // At the moment, only font size is parsed -+ QString style = QString::fromLatin1( da->getCString() ); -+ QRegExp rx("(\\d+)(\\.\\d*)? Tf"); -+ if (rx.indexIn(style) != -1) -+ font.setPointSize( rx.cap(1).toInt() ); -+ // TODO: Other properties ++ font.setPointSize( da->getFontPtSize() ); + } + } + @@ -9010,20 +9018,33 @@ index 00000000..8a7f60b1 +void TextAnnotation::setTextFont( const QFont &font ) +{ + Q_D( TextAnnotation ); ++ d->textFont = font; ++ d->textColor = Qt::black; + -+ if (!d->pdfAnnot) ++ d->setDefaultAppearanceToNative(); ++} ++ ++QColor TextAnnotation::textColor() const ++{ ++ Q_D( const TextAnnotation ); ++ ++ if ( !d->pdfAnnot ) ++ return d->textColor; ++ ++ if ( std::unique_ptr da{ d->getDefaultAppearanceFromNative() } ) + { -+ d->textFont = font; -+ return; ++ return convertAnnotColor( da->getFontColor() ); + } + -+ if (d->pdfAnnot->getType() != Annot::typeFreeText) -+ return; ++ return {}; ++} + -+ AnnotFreeText * ftextann = static_cast(d->pdfAnnot); -+ GooString * da = TextAnnotationPrivate::toAppearanceString(font); -+ ftextann->setAppearanceString(da); -+ delete da; ++void TextAnnotation::setTextColor( const QColor &color ) ++{ ++ Q_D( TextAnnotation ); ++ d->textColor = color; ++ ++ d->setDefaultAppearanceToNative(); +} + +int TextAnnotation::inplaceAlign() const @@ -9626,17 +9647,17 @@ index 00000000..8a7f60b1 + return; + } + -+ AnnotColor * c = convertQColor(color); ++ auto c = convertQColor(color); + + if (d->pdfAnnot->getType() == Annot::typeLine) + { + AnnotLine *lineann = static_cast(d->pdfAnnot); -+ lineann->setInteriorColor(c); ++ lineann->setInteriorColor(std::move(c)); + } + else + { + AnnotPolygon *polyann = static_cast(d->pdfAnnot); -+ polyann->setInteriorColor(c); ++ polyann->setInteriorColor(std::move(c)); + } +} + @@ -10037,9 +10058,7 @@ index 00000000..8a7f60b1 +AnnotQuadrilaterals * HighlightAnnotationPrivate::toQuadrilaterals(const QList< HighlightAnnotation::Quad > &quads) const +{ + const int count = quads.size(); -+ AnnotQuadrilaterals::AnnotQuadrilateral **ac = -+ (AnnotQuadrilaterals::AnnotQuadrilateral**) -+ gmallocn( count, sizeof(AnnotQuadrilaterals::AnnotQuadrilateral*) ); ++ auto ac = std::make_unique(count); + + double MTX[6]; + fillTransformationMTX(MTX); @@ -10053,10 +10072,10 @@ index 00000000..8a7f60b1 + // Swap points 3 and 4 (see HighlightAnnotationPrivate::fromQuadrilaterals) + XPDFReader::invTransform( MTX, q.points[3], x3, y3 ); + XPDFReader::invTransform( MTX, q.points[2], x4, y4 ); -+ ac[pos++] = new AnnotQuadrilaterals::AnnotQuadrilateral(x1, y1, x2, y2, x3, y3, x4, y4); ++ ac[pos++] = AnnotQuadrilaterals::AnnotQuadrilateral(x1, y1, x2, y2, x3, y3, x4, y4); + } + -+ return new AnnotQuadrilaterals(ac, count); ++ return new AnnotQuadrilaterals(std::move(ac), count); +} + +Annot* HighlightAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) @@ -10351,7 +10370,7 @@ index 00000000..8a7f60b1 + return d->stampIconName; + + const AnnotStamp * stampann = static_cast(d->pdfAnnot); -+ return QString::fromLatin1( stampann->getIcon()->getCString() ); ++ return QString::fromLatin1( stampann->getIcon()->c_str() ); +} + +void StampAnnotation::setStampIconName( const QString &name ) @@ -10600,7 +10619,7 @@ index 00000000..8a7f60b1 +}; + +LinkAnnotationPrivate::LinkAnnotationPrivate() -+ : AnnotationPrivate(), linkDestination( 0 ), linkHLMode( LinkAnnotation::Invert ) ++ : AnnotationPrivate(), linkDestination( nullptr ), linkHLMode( LinkAnnotation::Invert ) +{ +} + @@ -10616,7 +10635,7 @@ index 00000000..8a7f60b1 + +Annot* LinkAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) +{ -+ return 0; // Not implemented ++ return nullptr; // Not implemented +} + +LinkAnnotation::LinkAnnotation() @@ -11066,7 +11085,7 @@ index 00000000..8a7f60b1 +}; + +FileAttachmentAnnotationPrivate::FileAttachmentAnnotationPrivate() -+ : AnnotationPrivate(), icon( "PushPin" ), embfile( 0 ) ++ : AnnotationPrivate(), icon( "PushPin" ), embfile( nullptr ) +{ +} + @@ -11082,7 +11101,7 @@ index 00000000..8a7f60b1 + +Annot* FileAttachmentAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) +{ -+ return 0; // Not implemented ++ return nullptr; // Not implemented +} + +FileAttachmentAnnotation::FileAttachmentAnnotation() @@ -11170,7 +11189,7 @@ index 00000000..8a7f60b1 +}; + +SoundAnnotationPrivate::SoundAnnotationPrivate() -+ : AnnotationPrivate(), icon( "Speaker" ), sound( 0 ) ++ : AnnotationPrivate(), icon( "Speaker" ), sound( nullptr ) +{ +} + @@ -11186,7 +11205,7 @@ index 00000000..8a7f60b1 + +Annot* SoundAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) +{ -+ return 0; // Not implemented ++ return nullptr; // Not implemented +} + +SoundAnnotation::SoundAnnotation() @@ -11274,7 +11293,7 @@ index 00000000..8a7f60b1 +}; + +MovieAnnotationPrivate::MovieAnnotationPrivate() -+ : AnnotationPrivate(), movie( 0 ) ++ : AnnotationPrivate(), movie( nullptr ) +{ +} + @@ -11290,7 +11309,7 @@ index 00000000..8a7f60b1 + +Annot* MovieAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) +{ -+ return 0; // Not implemented ++ return nullptr; // Not implemented +} + +MovieAnnotation::MovieAnnotation() @@ -11378,7 +11397,7 @@ index 00000000..8a7f60b1 +}; + +ScreenAnnotationPrivate::ScreenAnnotationPrivate() -+ : AnnotationPrivate(), action( 0 ) ++ : AnnotationPrivate(), action( nullptr ) +{ +} + @@ -11398,7 +11417,7 @@ index 00000000..8a7f60b1 + +Annot* ScreenAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) +{ -+ return 0; // Not implemented ++ return nullptr; // Not implemented +} + +ScreenAnnotation::ScreenAnnotation() @@ -11470,7 +11489,7 @@ index 00000000..8a7f60b1 + +Annot* WidgetAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) +{ -+ return 0; // Not implemented ++ return nullptr; // Not implemented +} + +WidgetAnnotation::WidgetAnnotation(WidgetAnnotationPrivate &dd) @@ -11540,7 +11559,7 @@ index 00000000..8a7f60b1 +{ + public: + Private() -+ : params( 0 ) ++ : params( nullptr ) + { + } + @@ -11646,7 +11665,7 @@ index 00000000..8a7f60b1 +{ + public: + Private() -+ : embeddedFile( 0 ) ++ : embeddedFile( nullptr ) + { + } + @@ -11809,7 +11828,7 @@ index 00000000..8a7f60b1 +{ + public: + Private() -+ : activation( 0 ), deactivation( 0 ) ++ : activation( nullptr ), deactivation( nullptr ) + { + } + @@ -11853,7 +11872,7 @@ index 00000000..8a7f60b1 +{ + public: + RichMediaAnnotationPrivate() -+ : settings( 0 ), content( 0 ) ++ : settings( nullptr ), content( nullptr ) + { + } + @@ -11873,7 +11892,7 @@ index 00000000..8a7f60b1 + Q_UNUSED( destPage ); + Q_UNUSED( doc ); + -+ return 0; ++ return nullptr; + } + + RichMediaAnnotation::Settings *settings; @@ -11957,7 +11976,7 @@ index 00000000..8a7f60b1 +} + +//BEGIN utility annotation functions -+QColor convertAnnotColor( AnnotColor *color ) ++QColor convertAnnotColor( const AnnotColor *color ) +{ + if ( !color ) + return QColor(); @@ -11982,12 +12001,23 @@ index 00000000..8a7f60b1 + return newcolor; +} + -+AnnotColor* convertQColor( const QColor &c ) ++std::unique_ptr convertQColor( const QColor &c ) +{ -+ if (!c.isValid() || c.alpha() == 0) -+ return new AnnotColor(); // Transparent -+ else -+ return new AnnotColor(c.redF(), c.greenF(), c.blueF()); ++ if ( c.alpha() == 0 ) ++ return {}; // Transparent ++ ++ switch ( c.spec() ) ++ { ++ case QColor::Rgb: ++ case QColor::Hsl: ++ case QColor::Hsv: ++ return std::make_unique( c.redF(), c.greenF(), c.blueF() ); ++ case QColor::Cmyk: ++ return std::make_unique( c.cyanF(), c.magentaF(), c.yellowF(), c.blackF() ); ++ case QColor::Invalid: ++ default: ++ return {}; ++ } +} +//END utility annotation functions + @@ -11997,7 +12027,7 @@ new file mode 100644 index 00000000..ac77c421 --- /dev/null +++ b/qt4/src/poppler-annotation.h -@@ -0,0 +1,1375 @@ +@@ -0,0 +1,1379 @@ +/* poppler-annotation.h: qt interface to poppler + * Copyright (C) 2006-2008, 2012 Albert Astals Cid + * Copyright (C) 2006, 2008 Pino Toscano @@ -12487,6 +12517,10 @@ index 00000000..ac77c421 + + QFont textFont() const; + void setTextFont( const QFont &font ); ++ /// \since 0.69 ++ QColor textColor() const; ++ /// \since 0.69 ++ void setTextColor( const QColor &color ); + + int inplaceAlign() const; + void setInplaceAlign( int align ); @@ -14324,9 +14358,9 @@ index 00000000..d6e2fbf7 + return false; + + if (permanentId) -+ *permanentId = gooPermanentId.getCString(); ++ *permanentId = gooPermanentId.c_str(); + if (updateId) -+ *updateId = gooUpdateId.getCString(); ++ *updateId = gooUpdateId.c_str(); + + return true; + } @@ -14537,25 +14571,25 @@ index 00000000..f70573ac +QDateTime EmbeddedFile::modDate() const +{ + GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : NULL; -+ return goo ? convertDate(goo->getCString()) : QDateTime(); ++ return goo ? convertDate(goo->c_str()) : QDateTime(); +} + +QDateTime EmbeddedFile::createDate() const +{ + GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : NULL; -+ return goo ? convertDate(goo->getCString()) : QDateTime(); ++ return goo ? convertDate(goo->c_str()) : QDateTime(); +} + +QByteArray EmbeddedFile::checksum() const +{ + GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->checksum() : NULL; -+ return goo ? QByteArray::fromRawData(goo->getCString(), goo->getLength()) : QByteArray(); ++ return goo ? QByteArray::fromRawData(goo->c_str(), goo->getLength()) : QByteArray(); +} + +QString EmbeddedFile::mimeType() const +{ + GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->mimeType() : NULL; -+ return goo ? QString(goo->getCString()) : QString(); ++ return goo ? QString(goo->c_str()) : QString(); +} + +QByteArray EmbeddedFile::data() @@ -14751,7 +14785,7 @@ index 00000000..5bb9e3a8 + for ( int i = 0; i < items->getLength(); ++i ) { + fonts.append( FontInfo( FontInfoData( ( ::FontInfo* )items->get( i ) ) ) ); + } -+ deleteGooList( items, ::FontInfo ); ++ deleteGooList<::FontInfo>( items ); + return fonts; +} + @@ -14839,8 +14873,8 @@ index 00000000..57cde574 + double left, top, right, bottom; + m_formData->fm->getRect(&left, &bottom, &right, &top); + // build a normalized transform matrix for this page at 100% scale -+ GfxState gfxState( 72.0, 72.0, m_formData->page->getCropBox(), rotation, gTrue ); -+ double * gfxCTM = gfxState.getCTM(); ++ GfxState gfxState( 72.0, 72.0, m_formData->page->getCropBox(), rotation, true ); ++ const double * gfxCTM = gfxState.getCTM(); + double MTX[6]; + double pageWidth = m_formData->page->getCropWidth(); + double pageHeight = m_formData->page->getCropHeight(); @@ -14878,9 +14912,9 @@ index 00000000..57cde574 +QString FormField::name() const +{ + QString name; -+ if (GooString *goo = m_formData->fm->getPartialName()) ++ if (const GooString *goo = m_formData->fm->getPartialName()) + { -+ name = QString::fromLatin1(goo->getCString()); ++ name = QString::fromLatin1(goo->c_str()); + } + return name; +} @@ -14888,7 +14922,7 @@ index 00000000..57cde574 +QString FormField::fullyQualifiedName() const +{ + QString name; -+ if (GooString *goo = m_formData->fm->getFullyQualifiedName()) ++ if (const GooString *goo = m_formData->fm->getFullyQualifiedName()) + { + name = UnicodeParsedString(goo); + } @@ -14898,9 +14932,9 @@ index 00000000..57cde574 +QString FormField::uiName() const +{ + QString name; -+ if (GooString *goo = m_formData->fm->getAlternateUiName()) ++ if (const GooString *goo = m_formData->fm->getAlternateUiName()) + { -+ name = QString::fromLatin1(goo->getCString()); ++ name = QString::fromLatin1(goo->c_str()); + } + return name; +} @@ -14994,7 +15028,7 @@ index 00000000..57cde574 +void FormFieldButton::setState( bool state ) +{ + FormWidgetButton* fwb = static_cast(m_formData->fm); -+ fwb->setState((GBool)state); ++ fwb->setState((bool)state); +} + +QList FormFieldButton::siblings() const @@ -15045,7 +15079,7 @@ index 00000000..57cde574 + +QString FormFieldText::text() const +{ -+ GooString *goo = static_cast(m_formData->fm)->getContent(); ++ const GooString *goo = static_cast(m_formData->fm)->getContent(); + return UnicodeParsedString(goo); +} + @@ -15582,9 +15616,9 @@ index 00000000..32ddd038 + virtual ~LinkExtractorOutputDev(); + + // inherited from OutputDev -+ virtual GBool upsideDown() { return gFalse; } -+ virtual GBool useDrawChar() { return gFalse; } -+ virtual GBool interpretType3Chars() { return gFalse; } ++ virtual bool upsideDown() { return false; } ++ virtual bool useDrawChar() { return false; } ++ virtual bool interpretType3Chars() { return false; } + virtual void processLink(::AnnotLink *link); + + // our stuff @@ -15648,7 +15682,7 @@ index 00000000..0b1563b6 + m_pageCropHeight = popplerPage->getCropHeight(); + if (popplerPage->getRotate() == 90 || popplerPage->getRotate() == 270) + qSwap(m_pageCropWidth, m_pageCropHeight); -+ GfxState gfxState(72.0, 72.0, popplerPage->getCropBox(), popplerPage->getRotate(), gTrue); ++ GfxState gfxState(72.0, 72.0, popplerPage->getCropBox(), popplerPage->getRotate(), true); + setDefaultCTM(gfxState.getCTM()); +} + @@ -15758,7 +15792,7 @@ new file mode 100644 index 00000000..1e37f5bd --- /dev/null +++ b/qt4/src/poppler-link.cc -@@ -0,0 +1,710 @@ +@@ -0,0 +1,705 @@ +/* poppler-link.cc: qt interface to poppler + * Copyright (C) 2006-2007, 2016, 2017, Albert Astals Cid + * Copyright (C) 2007-2008, Pino Toscano @@ -15795,11 +15829,6 @@ index 00000000..1e37f5bd +#include "Link.h" +#include "Rendition.h" + -+static bool operator==( const Ref &r1, const Ref &r2 ) -+{ -+ return r1.num == r2.num && r1.gen == r2.gen; -+} -+ +namespace Poppler { + +class LinkDestinationPrivate : public QSharedData @@ -15993,7 +16022,7 @@ index 00000000..1e37f5bd + : d( new LinkDestinationPrivate ) + { + bool deleteDest = false; -+ LinkDest *ld = data.ld; ++ const LinkDest *ld = data.ld; + + if ( data.namedDest && !ld && !data.externalDest ) + { @@ -16003,7 +16032,7 @@ index 00000000..1e37f5bd + // in case this destination was named one, and it was not resolved + if ( data.namedDest && !ld ) + { -+ d->name = QString::fromLatin1( data.namedDest->getCString() ); ++ d->name = QString::fromLatin1( data.namedDest->c_str() ); + } + + if (!ld) return; @@ -17223,7 +17252,7 @@ index 00000000..f385f02e + return QByteArray(); + + QBuffer buffer; -+ Guchar data[BUFFER_MAX]; ++ unsigned char data[BUFFER_MAX]; + int bread; + + buffer.open(QIODevice::WriteOnly); @@ -17275,7 +17304,7 @@ index 00000000..f385f02e +MediaRendition::size() const +{ + Q_D( const MediaRendition ); -+ MediaParameters *mp = 0; ++ const MediaParameters *mp = 0; + + if (d->rendition->getBEParameters()) + mp = d->rendition->getBEParameters(); @@ -17478,7 +17507,7 @@ index 00000000..a64847c0 +QString MovieObject::url() const +{ + GooString * goo = m_movieData->m_movieObj->getFileName(); -+ return goo ? QString( goo->getCString() ) : QString(); ++ return goo ? QString( goo->c_str() ) : QString(); +} + +QSize MovieObject::size() const @@ -17503,7 +17532,7 @@ index 00000000..a64847c0 + +bool MovieObject::showPosterImage() const +{ -+ return (m_movieData->m_movieObj->getShowPoster() == gTrue); ++ return (m_movieData->m_movieObj->getShowPoster() == true); +} + +QImage MovieObject::posterImage() const @@ -17647,7 +17676,7 @@ new file mode 100644 index 00000000..0e7b5345 --- /dev/null +++ b/qt4/src/poppler-optcontent.cc -@@ -0,0 +1,456 @@ +@@ -0,0 +1,455 @@ +/* poppler-optcontent.cc: qt interface to poppler + * + * Copyright (C) 2007, Brad Hards @@ -17814,12 +17843,11 @@ index 00000000..0e7b5345 + : q(qq) + { + m_rootNode = new OptContentItem(); -+ GooList *ocgs = optContent->getOCGs(); ++ const auto &ocgs = optContent->getOCGs(); + -+ for (int i = 0; i < ocgs->getLength(); ++i) { -+ OptionalContentGroup *ocg = static_cast(ocgs->get(i)); -+ OptContentItem *node = new OptContentItem( ocg ); -+ m_optContentItems.insert( QString::number(ocg->getRef().num), node); ++ for (const auto& ocg : ocgs) { ++ OptContentItem *node = new OptContentItem( ocg.second.get() ); ++ m_optContentItems.insert( QString::number( ocg.first.num ), node ); + } + + if ( optContent->getOrderArray() == 0 ) { @@ -17863,7 +17891,7 @@ index 00000000..0e7b5345 + } else if ( (orderItem.isArray()) && (orderItem.arrayGetLength() > 0) ) { + parseOrderArray(lastItem, orderItem.getArray()); + } else if ( orderItem.isString() ) { -+ GooString *label = orderItem.getString(); ++ const GooString *label = orderItem.getString(); + OptContentItem *header = new OptContentItem ( UnicodeParsedString ( label ) ); + m_headerOptContentItems.append( header ); + addChild( parentNode, header ); @@ -18046,7 +18074,7 @@ index 00000000..0e7b5345 + + QSet changedItems; + -+ GooList *statesList = popplerLinkOCGState->getStateList(); ++ const GooList *statesList = popplerLinkOCGState->getStateList(); + for (int i = 0; i < statesList->getLength(); ++i) { + ::LinkOCGState::StateList *stateList = (::LinkOCGState::StateList*)statesList->get(i); + @@ -18250,8 +18278,8 @@ index 00000000..1cb63e9f + static Link* convertLinkActionToLink(::LinkAction * a, DocumentData *parentDoc, const QRectF &linkArea); + + TextPage *prepareTextSearch(const QString &text, Page::Rotation rotate, QVector *u); -+ GBool performSingleTextSearch(TextPage* textPage, QVector &u, double &sLeft, double &sTop, double &sRight, double &sBottom, Page::SearchDirection direction, GBool sCase, GBool sWords); -+ QList performMultipleTextSearch(TextPage* textPage, QVector &u, GBool sCase, GBool sWords); ++ bool performSingleTextSearch(TextPage* textPage, QVector &u, double &sLeft, double &sTop, double &sRight, double &sBottom, Page::SearchDirection direction, bool sCase, bool sWords); ++ QList performMultipleTextSearch(TextPage* textPage, QVector &u, bool sCase, bool sWords); +}; + +} @@ -18673,14 +18701,14 @@ index 00000000..ffe6e99c + case actionLaunch: + { + LinkLaunch * e = (LinkLaunch *)a; -+ GooString * p = e->getParams(); -+ popplerLink = new LinkExecute( linkArea, e->getFileName()->getCString(), p ? p->getCString() : 0 ); ++ const GooString * p = e->getParams(); ++ popplerLink = new LinkExecute( linkArea, e->getFileName()->c_str(), p ? p->c_str() : 0 ); + } + break; + + case actionNamed: + { -+ const char * name = ((LinkNamed *)a)->getName()->getCString(); ++ const char * name = ((LinkNamed *)a)->getName()->c_str(); + if ( !strcmp( name, "NextPage" ) ) + popplerLink = new LinkAction( linkArea, LinkAction::PageNext ); + else if ( !strcmp( name, "PrevPage" ) ) @@ -18719,7 +18747,7 @@ index 00000000..ffe6e99c + + case actionURI: + { -+ popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->getCString() ); ++ popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->c_str() ); + } + break; + @@ -18807,36 +18835,36 @@ index 00000000..ffe6e99c + const int rotation = (int)rotate * 90; + + // fetch ourselves a textpage -+ TextOutputDev td(NULL, gTrue, 0, gFalse, gFalse); ++ TextOutputDev td(NULL, true, 0, false, false); + parentDoc->doc->displayPage( &td, index + 1, 72, 72, rotation, false, true, false, -+ NULL, NULL, NULL, NULL, gTrue); ++ NULL, NULL, NULL, NULL, true); + TextPage *textPage=td.takeText(); + + return textPage; +} + -+inline GBool PageData::performSingleTextSearch(TextPage* textPage, QVector &u, double &sLeft, double &sTop, double &sRight, double &sBottom, Page::SearchDirection direction, GBool sCase, GBool sWords) ++inline bool PageData::performSingleTextSearch(TextPage* textPage, QVector &u, double &sLeft, double &sTop, double &sRight, double &sBottom, Page::SearchDirection direction, bool sCase, bool sWords) +{ + if (direction == Page::FromTop) + return textPage->findText( u.data(), u.size(), -+ gTrue, gTrue, gFalse, gFalse, sCase, gFalse, sWords, &sLeft, &sTop, &sRight, &sBottom ); ++ true, true, false, false, sCase, false, sWords, &sLeft, &sTop, &sRight, &sBottom ); + else if ( direction == Page::NextResult ) + return textPage->findText( u.data(), u.size(), -+ gFalse, gTrue, gTrue, gFalse, sCase, gFalse, sWords, &sLeft, &sTop, &sRight, &sBottom ); ++ false, true, true, false, sCase, false, sWords, &sLeft, &sTop, &sRight, &sBottom ); + else if ( direction == Page::PreviousResult ) + return textPage->findText( u.data(), u.size(), -+ gFalse, gTrue, gTrue, gFalse, sCase, gTrue, sWords, &sLeft, &sTop, &sRight, &sBottom ); ++ false, true, true, false, sCase, true, sWords, &sLeft, &sTop, &sRight, &sBottom ); + -+ return gFalse; ++ return false; +} + -+inline QList PageData::performMultipleTextSearch(TextPage* textPage, QVector &u, GBool sCase, GBool sWords) ++inline QList PageData::performMultipleTextSearch(TextPage* textPage, QVector &u, bool sCase, bool sWords) +{ + QList results; + double sLeft = 0.0, sTop = 0.0, sRight = 0.0, sBottom = 0.0; + + while(textPage->findText( u.data(), u.size(), -+ gFalse, gTrue, gTrue, gFalse, sCase, gFalse, sWords, &sLeft, &sTop, &sRight, &sBottom )) ++ false, true, true, false, sCase, false, sWords, &sLeft, &sTop, &sRight, &sBottom )) + { + QRectF result; + @@ -18875,9 +18903,9 @@ index 00000000..ffe6e99c + { +#if defined(HAVE_SPLASH) + SplashColor bgColor; -+ GBool overprintPreview = gFalse; ++ bool overprintPreview = false; +#ifdef SPLASH_CMYK -+ overprintPreview = m_page->parentDoc->m_hints & Document::OverprintPreview ? gTrue : gFalse; ++ overprintPreview = m_page->parentDoc->m_hints & Document::OverprintPreview ? true : false; + if (overprintPreview) + { + Guchar c, m, y, k; @@ -18921,22 +18949,22 @@ index 00000000..ffe6e99c + + SplashOutputDev splash_output( + colorMode, 4, -+ gFalse, ++ false, + ignorePaperColor ? NULL : bgColor, -+ gTrue, ++ true, + thinLineMode, + overprintPreview); + -+ splash_output.setFontAntialias(m_page->parentDoc->m_hints & Document::TextAntialiasing ? gTrue : gFalse); -+ splash_output.setVectorAntialias(m_page->parentDoc->m_hints & Document::Antialiasing ? gTrue : gFalse); -+ splash_output.setFreeTypeHinting(m_page->parentDoc->m_hints & Document::TextHinting ? gTrue : gFalse, -+ m_page->parentDoc->m_hints & Document::TextSlightHinting ? gTrue : gFalse); ++ splash_output.setFontAntialias(m_page->parentDoc->m_hints & Document::TextAntialiasing ? true : false); ++ splash_output.setVectorAntialias(m_page->parentDoc->m_hints & Document::Antialiasing ? true : false); ++ splash_output.setFreeTypeHinting(m_page->parentDoc->m_hints & Document::TextHinting ? true : false, ++ m_page->parentDoc->m_hints & Document::TextSlightHinting ? true : false); + + splash_output.startDoc(m_page->parentDoc->doc); + + m_page->parentDoc->doc->displayPageSlice(&splash_output, m_page->index + 1, xres, yres, + rotation, false, true, false, x, y, w, h, -+ NULL, NULL, NULL, NULL, gTrue); ++ NULL, NULL, NULL, NULL, true); + + SplashBitmap *bitmap = splash_output.getBitmap(); + @@ -19038,7 +19066,7 @@ index 00000000..ffe6e99c + int w = 0; + int h = 0; + int rowstride = 0; -+ GBool r = m_page->page->loadThumb(&data, &w, &h, &rowstride); ++ bool r = m_page->page->loadThumb(&data, &w, &h, &rowstride); + QImage ret; + if (r) + { @@ -19054,14 +19082,14 @@ index 00000000..ffe6e99c +{ + TextOutputDev *output_dev; + GooString *s; -+ PDFRectangle *rect; ++ const PDFRectangle *rect; + QString result; + -+ const GBool rawOrder = textLayout == RawOrderLayout; -+ output_dev = new TextOutputDev(0, gFalse, 0, rawOrder, gFalse); ++ const bool rawOrder = textLayout == RawOrderLayout; ++ output_dev = new TextOutputDev(0, false, 0, rawOrder, false); + m_page->parentDoc->doc->displayPageSlice(output_dev, m_page->index + 1, 72, 72, + 0, false, true, false, -1, -1, -1, -1, -+ NULL, NULL, NULL, NULL, gTrue); ++ NULL, NULL, NULL, NULL, true); + if (r.isNull()) + { + rect = m_page->page->getCropBox(); @@ -19072,7 +19100,7 @@ index 00000000..ffe6e99c + s = output_dev->getText(r.left(), r.top(), r.right(), r.bottom()); + } + -+ result = QString::fromUtf8(s->getCString()); ++ result = QString::fromUtf8(s->c_str()); + + delete output_dev; + delete s; @@ -19086,12 +19114,12 @@ index 00000000..ffe6e99c + +bool Page::search(const QString &text, double &sLeft, double &sTop, double &sRight, double &sBottom, SearchDirection direction, SearchMode caseSensitive, Rotation rotate) const +{ -+ const GBool sCase = caseSensitive == Page::CaseSensitive ? gTrue : gFalse; ++ const bool sCase = caseSensitive == Page::CaseSensitive ? true : false; + + QVector u; + TextPage *textPage = m_page->prepareTextSearch(text, rotate, &u); + -+ const bool found = m_page->performSingleTextSearch(textPage, u, sLeft, sTop, sRight, sBottom, direction, sCase, gFalse); ++ const bool found = m_page->performSingleTextSearch(textPage, u, sLeft, sTop, sRight, sBottom, direction, sCase, false); + + textPage->decRefCnt(); + @@ -19100,8 +19128,8 @@ index 00000000..ffe6e99c + +bool Page::search(const QString &text, double &sLeft, double &sTop, double &sRight, double &sBottom, SearchDirection direction, SearchFlags flags, Rotation rotate) const +{ -+ const GBool sCase = flags.testFlag(IgnoreCase) ? gFalse : gTrue; -+ const GBool sWords = flags.testFlag(WholeWords) ? gTrue : gFalse; ++ const bool sCase = flags.testFlag(IgnoreCase) ? false : true; ++ const bool sWords = flags.testFlag(WholeWords) ? true : false; + + QVector u; + TextPage *textPage = m_page->prepareTextSearch(text, rotate, &u); @@ -19133,12 +19161,12 @@ index 00000000..ffe6e99c + +QList Page::search(const QString &text, SearchMode caseSensitive, Rotation rotate) const +{ -+ const GBool sCase = caseSensitive == Page::CaseSensitive ? gTrue : gFalse; ++ const bool sCase = caseSensitive == Page::CaseSensitive ? true : false; + + QVector u; + TextPage *textPage = m_page->prepareTextSearch(text, rotate, &u); + -+ const QList results = m_page->performMultipleTextSearch(textPage, u, sCase, gFalse); ++ const QList results = m_page->performMultipleTextSearch(textPage, u, sCase, false); + + textPage->decRefCnt(); + @@ -19147,8 +19175,8 @@ index 00000000..ffe6e99c + +QList Page::search(const QString &text, SearchFlags flags, Rotation rotate) const +{ -+ const GBool sCase = flags.testFlag(IgnoreCase) ? gFalse : gTrue; -+ const GBool sWords = flags.testFlag(WholeWords) ? gTrue : gFalse; ++ const bool sCase = flags.testFlag(IgnoreCase) ? false : true; ++ const bool sWords = flags.testFlag(WholeWords) ? true : false; + + QVector u; + TextPage *textPage = m_page->prepareTextSearch(text, rotate, &u); @@ -19166,13 +19194,13 @@ index 00000000..ffe6e99c + + QList output_list; + -+ output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse); ++ output_dev = new TextOutputDev(0, false, 0, false, false); + + int rotation = (int)rotate * 90; + + m_page->parentDoc->doc->displayPageSlice(output_dev, m_page->index + 1, 72, 72, + rotation, false, false, false, -1, -1, -1, -1, -+ NULL, NULL, NULL, NULL, gTrue); ++ NULL, NULL, NULL, NULL, true); + + TextWordList *word_list = output_dev->makeWordList(); + @@ -19187,13 +19215,13 @@ index 00000000..ffe6e99c + for (int i = 0; i < word_list->getLength(); i++) { + TextWord *word = word_list->get(i); + GooString *gooWord = word->getText(); -+ QString string = QString::fromUtf8(gooWord->getCString()); ++ QString string = QString::fromUtf8(gooWord->c_str()); + delete gooWord; + double xMin, yMin, xMax, yMax; + word->getBBox(&xMin, &yMin, &xMax, &yMax); + + TextBox* text_box = new TextBox(string, QRectF(xMin, yMin, xMax-xMin, yMax-yMin)); -+ text_box->m_data->hasSpaceAfter = word->hasSpaceAfter() == gTrue; ++ text_box->m_data->hasSpaceAfter = word->hasSpaceAfter() == true; + text_box->m_data->charBBoxes.reserve(word->getLength()); + for (int j = 0; j < word->getLength(); ++j) + { @@ -19288,7 +19316,7 @@ index 00000000..ffe6e99c + +void Page::defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool upsideDown) +{ -+ m_page->page->getDefaultCTM(CTM, dpiX, dpiY, rotate, gFalse, upsideDown); ++ m_page->page->getDefaultCTM(CTM, dpiX, dpiY, rotate, false, upsideDown); +} + +QList Page::links() const @@ -19564,7 +19592,7 @@ index 00000000..1338a185 + Debug::debugClosure = closure; + } + -+ static void qt4ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg) ++ static void qt4ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, const char *msg) + { + QString emsg; + @@ -19580,7 +19608,7 @@ index 00000000..1338a185 + (*Debug::debugFunction)(emsg, Debug::debugClosure); + } + -+ QString unicodeToQString(Unicode* u, int len) { ++ QString unicodeToQString(const Unicode* u, int len) { + if (!utf8Map) + { + GooString enc("UTF-8"); @@ -19602,19 +19630,19 @@ index 00000000..1338a185 + convertedStr.append(buf, n); + } + -+ return QString::fromUtf8(convertedStr.getCString(), convertedStr.getLength()); ++ return QString::fromUtf8(convertedStr.c_str(), convertedStr.getLength()); + } + -+ QString UnicodeParsedString(GooString *s1) { ++ QString UnicodeParsedString(const GooString *s1) { + if ( !s1 || s1->getLength() == 0 ) + return QString(); + -+ char *cString; ++ const char *cString; + int stringLength; + bool deleteCString; + if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getLength() > 1 && ( s1->getChar(1) & 0xff ) == 0xff ) ) + { -+ cString = s1->getCString(); ++ cString = s1->c_str(); + stringLength = s1->getLength(); + deleteCString = false; + } @@ -19669,7 +19697,7 @@ index 00000000..1338a185 + return QStringToUnicodeGooString(dt.toUTC().toString("yyyyMMddhhmmss+00'00'")); + } + -+ static void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e ) ++ static void linkActionToTocItem( const ::LinkAction * a, DocumentData * doc, QDomElement * e ) + { + if ( !a || !e ) + return; @@ -19679,16 +19707,16 @@ index 00000000..1338a185 + case actionGoTo: + { + // page number is contained/referenced in a LinkGoTo -+ LinkGoTo * g = static_cast< LinkGoTo * >( a ); -+ LinkDest * destination = g->getDest(); ++ const LinkGoTo * g = static_cast< const LinkGoTo * >( a ); ++ const LinkDest * destination = g->getDest(); + if ( !destination && g->getNamedDest() ) + { + // no 'destination' but an internal 'named reference'. we could + // get the destination for the page now, but it's VERY time consuming, + // so better storing the reference and provide the viewport on demand -+ GooString *s = g->getNamedDest(); ++ const GooString *s = g->getNamedDest(); + QChar *charArray = new QChar[s->getLength()]; -+ for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]); ++ for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->c_str()[i]); + QString aux(charArray, s->getLength()); + e->setAttribute( "DestinationName", aux ); + delete[] charArray; @@ -19703,16 +19731,16 @@ index 00000000..1338a185 + case actionGoToR: + { + // page number is contained/referenced in a LinkGoToR -+ LinkGoToR * g = static_cast< LinkGoToR * >( a ); -+ LinkDest * destination = g->getDest(); ++ const LinkGoToR * g = static_cast< const LinkGoToR * >( a ); ++ const LinkDest * destination = g->getDest(); + if ( !destination && g->getNamedDest() ) + { + // no 'destination' but an internal 'named reference'. we could + // get the destination for the page now, but it's VERY time consuming, + // so better storing the reference and provide the viewport on demand -+ GooString *s = g->getNamedDest(); ++ const GooString *s = g->getNamedDest(); + QChar *charArray = new QChar[s->getLength()]; -+ for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]); ++ for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->c_str()[i]); + QString aux(charArray, s->getLength()); + e->setAttribute( "DestinationName", aux ); + delete[] charArray; @@ -19722,13 +19750,13 @@ index 00000000..1338a185 + LinkDestinationData ldd(destination, NULL, doc, g->getFileName() != 0); + e->setAttribute( "Destination", LinkDestination(ldd).toString() ); + } -+ e->setAttribute( "ExternalFileName", g->getFileName()->getCString() ); ++ e->setAttribute( "ExternalFileName", g->getFileName()->c_str() ); + break; + } + case actionURI: + { -+ LinkURI * u = static_cast< LinkURI * >( a ); -+ e->setAttribute( "DestinationURI", u->getURI()->getCString() ); ++ const LinkURI * u = static_cast< const LinkURI * >( a ); ++ e->setAttribute( "DestinationURI", u->getURI()->c_str() ); + } + default: ; + } @@ -19761,13 +19789,13 @@ index 00000000..1338a185 + { + utf8Map = 0; + globalParams = new GlobalParams(); -+ setErrorCallback(qt4ErrorFunction, NULL); ++ setErrorCallback(qt4ErrorFunction, nullptr); + } + count ++; + } + + -+ void DocumentData::addTocChildren( QDomDocument * docSyn, QDomNode * parent, GooList * items ) ++ void DocumentData::addTocChildren( QDomDocument * docSyn, QDomNode * parent, const GooList * items ) + { + int numItems = items->getLength(); + for ( int i = 0; i < numItems; ++i ) @@ -19777,7 +19805,7 @@ index 00000000..1338a185 + + // 1. create element using outlineItem's title as tagName + QString name; -+ Unicode * uniChar = outlineItem->getTitle(); ++ const Unicode * uniChar = outlineItem->getTitle(); + int titleLength = outlineItem->getTitleLength(); + name = unicodeToQString(uniChar, titleLength); + if ( name.isEmpty() ) @@ -19787,14 +19815,14 @@ index 00000000..1338a185 + parent->appendChild( item ); + + // 2. find the page the link refers to -+ ::LinkAction * a = outlineItem->getAction(); ++ const ::LinkAction * a = outlineItem->getAction(); + linkActionToTocItem( a, this, &item ); + + item.setAttribute( "Open", QVariant( (bool)outlineItem->isOpen() ).toString() ); + + // 3. recursively descend over children + outlineItem->open(); -+ GooList * children = outlineItem->getKids(); ++ const GooList * children = outlineItem->getKids(); + if ( children ) + addTocChildren( docSyn, &item, children ); + } @@ -19981,8 +20009,8 @@ index 00000000..a5ad3f3e + + FontInfoData( ::FontInfo* fi ) + { -+ if (fi->getName()) fontName = fi->getName()->getCString(); -+ if (fi->getFile()) fontFile = fi->getFile()->getCString(); ++ if (fi->getName()) fontName = fi->getName()->c_str(); ++ if (fi->getFile()) fontFile = fi->getFile()->c_str(); + isEmbedded = fi->getEmbedded(); + isSubset = fi->getSubset(); + type = (Poppler::FontInfo::Type)fi->getType(); @@ -20237,12 +20265,12 @@ index 00000000..4b43d8ec + d->pageConvertedPayload = payload; +} + -+static GBool annotDisplayDecideCbk(Annot *annot, void *user_data) ++static bool annotDisplayDecideCbk(Annot *annot, void *user_data) +{ + if (annot->getType() == Annot::typeWidget) -+ return gTrue; // Never hide forms ++ return true; // Never hide forms + else -+ return *(GBool*)user_data; ++ return *(bool*)user_data; +} + +bool PSConverter::convert() @@ -20285,8 +20313,8 @@ index 00000000..4b43d8ec + (d->opts & PrintToEPS) ? psModeEPS : psModePS, + d->paperWidth, + d->paperHeight, -+ gFalse, -+ gFalse, ++ false, ++ false, + d->marginLeft, + d->marginBottom, + d->paperWidth - d->marginRight, @@ -20302,8 +20330,8 @@ index 00000000..4b43d8ec + + if (psOut->isOk()) + { -+ GBool isPrinting = (d->opts & Printing) ? gTrue : gFalse; -+ GBool showAnnotations = (d->opts & HideAnnotations) ? gFalse : gTrue; ++ bool isPrinting = (d->opts & Printing) ? true : false; ++ bool showAnnotations = (d->opts & HideAnnotations) ? false : true; + foreach(int page, d->pageList) + { + d->document->doc->displayPage(psOut, @@ -20311,13 +20339,13 @@ index 00000000..4b43d8ec + d->hDPI, + d->vDPI, + d->rotate, -+ gFalse, -+ gTrue, ++ false, ++ true, + isPrinting, + NULL, + NULL, + annotDisplayDecideCbk, -+ &showAnnotations, gTrue); ++ &showAnnotations, true); + if (d->pageConvertedCallback) + (*d->pageConvertedCallback)(page, d->pageConvertedPayload); + } @@ -22537,7 +22565,7 @@ index 00000000..eb19b9d3 + return QString(); + + GooString * goo = m_soundData->m_soundObj->getFileName(); -+ return goo ? QString( goo->getCString() ) : QString(); ++ return goo ? QString( goo->c_str() ) : QString(); +} + +QByteArray SoundObject::data() const @@ -23450,9 +23478,9 @@ index 00000000..69f7cdc5 + QFETCH(QByteArray, result); + + GooString goo(string.constData()); -+ QCOMPARE(goo.getCString(), string.constData()); ++ QCOMPARE(goo.c_str(), string.constData()); + goo.insert(position, addition.constData()); -+ QCOMPARE(goo.getCString(), result.constData()); ++ QCOMPARE(goo.c_str(), result.constData()); +} + +void TestGooString::testInsert() @@ -23461,13 +23489,13 @@ index 00000000..69f7cdc5 + GooString goo; + goo.insert(0, "."); + goo.insert(0, "This is a very long long test string"); -+ QCOMPARE(goo.getCString(), "This is a very long long test string."); ++ QCOMPARE(goo.c_str(), "This is a very long long test string."); + } + { + GooString goo; + goo.insert(0, "second-part-third-part"); + goo.insert(0, "first-part-"); -+ QCOMPARE(goo.getCString(), "first-part-second-part-third-part"); ++ QCOMPARE(goo.c_str(), "first-part-second-part-third-part"); + } +} + @@ -23475,63 +23503,63 @@ index 00000000..69f7cdc5 +{ + { + const QScopedPointer goo(GooString::format("{0:d},{1:x}", 1, 0xF)); -+ QCOMPARE(goo->getCString(), "1,f"); ++ QCOMPARE(goo->c_str(), "1,f"); + } + { + const QScopedPointer goo(GooString::format("{0:d},{0:x},{0:X},{0:o},{0:b},{0:w}", 0xA)); -+ QCOMPARE(goo->getCString(), "10,a,A,12,1010, "); ++ QCOMPARE(goo->c_str(), "10,a,A,12,1010, "); + } + { + const QScopedPointer goo(GooString::format("{0:d},{0:x},{0:X},{0:o},{0:b}", -0xA)); -+ QCOMPARE(goo->getCString(), "-10,-a,-A,-12,-1010"); ++ QCOMPARE(goo->c_str(), "-10,-a,-A,-12,-1010"); + } + { + const QScopedPointer goo(GooString::format("{0:c}{1:c}{2:c}{3:c}", + 'T', (char)'E', (short)'S', (int)'T')); -+ QCOMPARE(goo->getCString(), "TEST"); ++ QCOMPARE(goo->c_str(), "TEST"); + + const QScopedPointer goo2(GooString::format("{0:s} {1:t}", "TEST", goo.data())); -+ QCOMPARE(goo2->getCString(), "TEST TEST"); ++ QCOMPARE(goo2->c_str(), "TEST TEST"); + } + { + const QScopedPointer goo(GooString::format("{0:ud} {1:d} {2:d}", + UINT_MAX, INT_MAX, INT_MIN)); + const QByteArray expected = QString("%1 %2 %3").arg(UINT_MAX).arg(INT_MAX).arg(INT_MIN).toLatin1(); -+ QCOMPARE(goo->getCString(), expected.constData()); ++ QCOMPARE(goo->c_str(), expected.constData()); + } + { + const QScopedPointer goo(GooString::format("{0:uld} {1:ld} {2:ld}", + ULONG_MAX, LONG_MAX, LONG_MIN)); + const QByteArray expected = QString("%1 %2 %3").arg(ULONG_MAX).arg(LONG_MAX).arg(LONG_MIN).toLatin1(); -+ QCOMPARE(goo->getCString(), expected.constData()); ++ QCOMPARE(goo->c_str(), expected.constData()); + } + { + const QScopedPointer goo(GooString::format("{0:ulld} {1:lld} {2:lld}", + ULLONG_MAX, LLONG_MAX, LLONG_MIN)); + const QByteArray expected = QString("%1 %2 %3").arg(ULLONG_MAX).arg(LLONG_MAX).arg(LLONG_MIN).toLatin1(); -+ QCOMPARE(goo->getCString(), expected.constData()); ++ QCOMPARE(goo->c_str(), expected.constData()); + } + { + const QScopedPointer gooD(GooString::format("{0:.1f} {0:.1g} {0:.1gs} | {1:.1f} {1:.1g} {1:.1gs}", 1., .012)); + const QScopedPointer gooF(GooString::format("{0:.1f} {0:.1g} {0:.1gs} | {1:.1f} {1:.1g} {1:.1gs}", 1.f, .012f)); -+ QCOMPARE(gooD->getCString(), "1.0 1 1 | 0.0 0 0.01"); -+ QCOMPARE(gooF->getCString(), "1.0 1 1 | 0.0 0 0.01"); ++ QCOMPARE(gooD->c_str(), "1.0 1 1 | 0.0 0 0.01"); ++ QCOMPARE(gooF->c_str(), "1.0 1 1 | 0.0 0 0.01"); + } + { + const QScopedPointer goo(GooString::format("{0:.4f} {0:.4g} {0:.4gs}", .012)); -+ QCOMPARE(goo->getCString(), "0.0120 0.012 0.012"); ++ QCOMPARE(goo->c_str(), "0.0120 0.012 0.012"); + } + { + const QScopedPointer goo(GooString::format("{{ SomeText {0:d} }}", 1)); -+ QCOMPARE(goo->getCString(), "{ SomeText 1 }"); ++ QCOMPARE(goo->c_str(), "{ SomeText 1 }"); + } + { + const QScopedPointer goo(GooString::format("{{{{ {{ SomeText {0:d}", 2)); -+ QCOMPARE(goo->getCString(), "{{ { SomeText 2"); ++ QCOMPARE(goo->c_str(), "{{ { SomeText 2"); + } + { + const QScopedPointer goo(GooString::format("SomeText {0:d} }} }}}}", 3)); -+ QCOMPARE(goo->getCString(), "SomeText 3 } }}"); ++ QCOMPARE(goo->c_str(), "SomeText 3 } }}"); + } +} + @@ -24511,27 +24539,27 @@ index 00000000..4eb1ec36 +void TestPageLabelInfo::testToRoman() +{ + GooString str; -+ toRoman(177, &str, gFalse); -+ QCOMPARE (str.getCString(), "clxxvii"); ++ toRoman(177, &str, false); ++ QCOMPARE (str.c_str(), "clxxvii"); +} + +void TestPageLabelInfo::testFromRoman() +{ + GooString roman("clxxvii"); -+ QCOMPARE(fromRoman(roman.getCString()), 177); ++ QCOMPARE(fromRoman(roman.c_str()), 177); +} + +void TestPageLabelInfo::testToLatin() +{ + GooString str; -+ toLatin(54, &str, gFalse); -+ QCOMPARE(str.getCString(), "bbb"); ++ toLatin(54, &str, false); ++ QCOMPARE(str.c_str(), "bbb"); +} + +void TestPageLabelInfo::testFromLatin() +{ + GooString latin("ddd"); -+ QCOMPARE(fromLatin(latin.getCString()), 56); ++ QCOMPARE(fromLatin(latin.c_str()), 56); +} + +QTEST_MAIN(TestPageLabelInfo) @@ -25204,7 +25232,7 @@ index 00000000..700ae9c2 + GooString *goo = Poppler::QStringToUnicodeGooString(string); + QVERIFY(goo->hasUnicodeMarker()); + QCOMPARE(goo->getLength(), string.length() * 2 + 2); -+ QCOMPARE(result, QByteArray::fromRawData(goo->getCString() + 2, goo->getLength() - 2)); ++ QCOMPARE(result, QByteArray::fromRawData(goo->c_str() + 2, goo->getLength() - 2)); + + delete goo; +} @@ -25230,7 +25258,7 @@ index 00000000..700ae9c2 + QFETCH(GooString*, result); + + GooString *goo = Poppler::QStringToGooString(string); -+ QCOMPARE(goo->getCString(), result->getCString()); ++ QCOMPARE(goo->c_str(), result->c_str()); + + delete goo; +} diff --git a/poppler-0.30.0-rotated-words-selection.patch b/poppler-0.30.0-rotated-words-selection.patch index 59524c9..a31a3c1 100644 --- a/poppler-0.30.0-rotated-words-selection.patch +++ b/poppler-0.30.0-rotated-words-selection.patch @@ -24,11 +24,11 @@ index 7c2ca78..e93908c 100644 +// a and b don't need to be sorted. +#define XBetweenAB(x,a,b) (!(((x) > (a) && (x) > (b)) || \ + ((x) < (a) && (x) < (b))) ? \ -+ gTrue : gFalse) ++ true : false) + - static int reorderText(Unicode *text, int len, UnicodeMap *uMap, GBool primaryLR, GooString *s, Unicode* u) { - char lre[8], rle[8], popdf[8], buf[8]; - int lreLen = 0, rleLen = 0, popdfLen = 0, n; + namespace { + + inline bool isAscii7 (Unicode uchar) { @@ -4411,11 +4417,37 @@ void TextSelectionSizer::visitLine (TextLine *line, PDFRectangle *rect; double x1, y1, x2, y2, margin; diff --git a/poppler-0.63.0-tiling-patterns.patch b/poppler-0.63.0-tiling-patterns.patch index ea17a49..316a141 100644 --- a/poppler-0.63.0-tiling-patterns.patch +++ b/poppler-0.63.0-tiling-patterns.patch @@ -19,7 +19,7 @@ index 631ab27b..b2e730bf 100644 +++ b/poppler/CairoOutputDev.cc @@ -915,6 +915,8 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat StrokePathClip *strokePathTmp; - GBool adjusted_stroke_width_tmp; + bool adjusted_stroke_width_tmp; cairo_pattern_t *maskTmp; + double xoffset, yoffset; + double det; @@ -28,11 +28,11 @@ index 631ab27b..b2e730bf 100644 height = bbox[3] - bbox[1]; @@ -976,6 +978,15 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat if (cairo_pattern_status (pattern)) - return gFalse; + return false; + det = pmat[0] * pmat[3] - pmat[1] * pmat[2]; + if (fabs(det) < 0.000001) -+ return gFalse; ++ return false; + + xoffset = round ((pmat[3] * pmat[4] - pmat[2] * pmat[5]) / (xStep * det)); + yoffset = - round ((pmat[1] * pmat[4] - pmat[0] * pmat[5]) / (yStep * det)); diff --git a/poppler-0.67.0-cycles-in-pdf-parsing.patch b/poppler-0.67.0-cycles-in-pdf-parsing.patch deleted file mode 100644 index aad8155..0000000 --- a/poppler-0.67.0-cycles-in-pdf-parsing.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 3d35d209c19c1d3b09b794a0c863ba5de44a9c0a Mon Sep 17 00:00:00 2001 -From: Marek Kasik -Date: Mon, 29 Oct 2018 17:44:47 +0100 -Subject: [PATCH] Avoid cycles in PDF parsing - -Mark objects being processed in Parser::makeStream() as being processed -and check the mark when entering this method to avoid processing -of the same object recursively. ---- - poppler/Parser.cc | 15 +++++++++++++++ - poppler/XRef.h | 1 + - 2 files changed, 16 insertions(+) - -diff --git a/poppler/Parser.cc b/poppler/Parser.cc -index bd4845ab..8f48efbe 100644 ---- a/poppler/Parser.cc -+++ b/poppler/Parser.cc -@@ -197,6 +197,18 @@ Stream *Parser::makeStream(Object &&dict, Guchar *fileKey, - Stream *str; - Goffset length; - Goffset pos, endPos; -+ XRefEntry *entry = nullptr; -+ -+ if (xref && (entry = xref->getEntry(objNum, false))) { -+ if (!entry->getFlag(XRefEntry::Parsing) || -+ (objNum == 0 && objGen == 0)) { -+ entry->setFlag(XRefEntry::Parsing, true); -+ } else { -+ error(errSyntaxError, getPos(), -+ "Object '{0:d} {1:d} obj' is being already parsed", objNum, objGen); -+ return nullptr; -+ } -+ } - - // get stream start position - lexer->skipToNextLine(); -@@ -278,6 +290,9 @@ Stream *Parser::makeStream(Object &&dict, Guchar *fileKey, - // get filters - str = str->addFilters(str->getDict(), recursion); - -+ if (entry) -+ entry->setFlag(XRefEntry::Parsing, false); -+ - return str; - } - -diff --git a/poppler/XRef.h b/poppler/XRef.h -index 11ee5e03..2eb2f9fd 100644 ---- a/poppler/XRef.h -+++ b/poppler/XRef.h -@@ -68,7 +68,10 @@ struct XRefEntry { - - // Special flags -- available only after xref->scanSpecialFlags() is run - Unencrypted, // Entry is stored in unencrypted form (meaningless in unencrypted documents) -- DontRewrite // Entry must not be written back in case of full rewrite -+ DontRewrite, // Entry must not be written back in case of full rewrite -+ -+ // Regular flag (moved here to preserve values of previous flags) -+ Parsing // Entry is currently being parsed - }; - - inline GBool getFlag(Flag flag) const { --- -2.19.1 - diff --git a/poppler-0.67.0-display-profile.patch b/poppler-0.67.0-display-profile.patch deleted file mode 100644 index a9f5c58..0000000 --- a/poppler-0.67.0-display-profile.patch +++ /dev/null @@ -1,63 +0,0 @@ -From e07c8b4784234383cb5ddcf1133ea91a772506e2 Mon Sep 17 00:00:00 2001 -From: Adam Reichold -Date: Tue, 1 Jan 2019 10:54:40 +0100 -Subject: [PATCH] Avoid global display profile state becoming an uncontrolled - memory leak by enforcing single initialization. Closes #654 - ---- - poppler/GfxState.cc | 9 +++++++++ - qt5/src/poppler-qt5.h | 4 ++++ - 2 files changed, 13 insertions(+) - -diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc -index 87b7ce03..4e3ccbfd 100644 ---- a/poppler/GfxState.cc -+++ b/poppler/GfxState.cc -@@ -226,6 +226,10 @@ static unsigned int getCMSNChannels(cmsColorSpaceSignature cs); - static cmsHPROFILE loadColorProfile(const char *fileName); - - void GfxColorSpace::setDisplayProfile(void *displayProfileA) { -+ if (displayProfile != nullptr) { -+ error(errInternal, -1, "The display color profile can only be set once before any rendering is done."); -+ return; -+ } - displayProfile = displayProfileA; - if (displayProfile != nullptr) { - cmsHTRANSFORM transform; -@@ -249,6 +253,11 @@ void GfxColorSpace::setDisplayProfile(void *displayProfileA) { - } - - void GfxColorSpace::setDisplayProfileName(GooString *name) { -+ if (displayProfile != nullptr) { -+ error(errInternal, -1, "The display color profile can only be set before any rendering is done."); -+ return; -+ } -+ delete displayProfileName; - displayProfileName = name->copy(); - } - -diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h -index 4f06c47e..ddac7dfb 100644 ---- a/qt5/src/poppler-qt5.h -+++ b/qt5/src/poppler-qt5.h -@@ -1102,6 +1102,8 @@ delete it; - - \param outputProfileA is a \c cmsHPROFILE of the LCMS library. - -+ \note This should be called before any rendering happens and only once during the lifetime of the current process. -+ - \since 0.12 - */ - void setColorDisplayProfile(void *outputProfileA); -@@ -1110,6 +1112,8 @@ delete it; - - \param name is the name of the display profile to set. - -+ \note This should be called before any rendering happens. -+ - \since 0.12 - */ - void setColorDisplayProfileName(const QString &name); --- -2.20.1 - diff --git a/poppler-0.67.0-dummy-xref-entry.patch b/poppler-0.67.0-dummy-xref-entry.patch deleted file mode 100644 index bc1f5a1..0000000 --- a/poppler-0.67.0-dummy-xref-entry.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 39a251b1b3a3343400a08e2f03c5518a26624626 Mon Sep 17 00:00:00 2001 -From: Adam Reichold -Date: Mon, 24 Dec 2018 15:40:38 +0100 -Subject: [PATCH] Do not try to parse into unallocated XRef entry and return - pointer to dummy entry instead. Closes #692 and oss-fuzz/12330 - ---- - poppler/XRef.cc | 27 +++++++++++++++++++++------ - 1 file changed, 21 insertions(+), 6 deletions(-) - -diff --git a/poppler/XRef.cc b/poppler/XRef.cc -index 0ec66944..d042d1f4 100644 ---- a/poppler/XRef.cc -+++ b/poppler/XRef.cc -@@ -1548,11 +1548,31 @@ void XRef::readXRefUntil(int untilEntryNum, std::vector *xrefStreamObjsNum) - } - } - -+namespace { -+ -+struct DummyXRefEntry : XRefEntry { -+ DummyXRefEntry() { -+ offset = 0; -+ gen = -1; -+ type = xrefEntryNone; -+ flags = 0; -+ } -+}; -+ -+DummyXRefEntry dummyXRefEntry; -+ -+} -+ - XRefEntry *XRef::getEntry(int i, GBool complainIfMissing) - { - if (i >= size || entries[i].type == xrefEntryNone) { - - if ((!xRefStream) && mainXRefEntriesOffset) { -+ if (unlikely(i >= capacity)) { -+ error(errInternal, -1, "Request for out-of-bounds XRef entry [{0:d}]", i); -+ return &dummyXRefEntry; -+ } -+ - if (!parseEntry(mainXRefEntriesOffset + 20*i, &entries[i])) { - error(errSyntaxError, -1, "Failed to parse XRef entry [{0:d}].", i); - } -@@ -1563,12 +1583,7 @@ XRefEntry *XRef::getEntry(int i, bool complainIfMissing) - // We might have reconstructed the xref - // Check again i is in bounds - if (unlikely(i >= size)) { -- static XRefEntry dummy; -- dummy.offset = 0; -- dummy.gen = -1; -- dummy.type = xrefEntryNone; -- dummy.flags = 0; -- return &dummy; -+ return &dummyXRefEntry; - } - - if (entries[i].type == xrefEntryNone) { --- -2.20.1 - diff --git a/poppler-0.67.0-embedded-file-check.patch b/poppler-0.67.0-embedded-file-check.patch deleted file mode 100644 index a32707f..0000000 --- a/poppler-0.67.0-embedded-file-check.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 614514f577bbe676f736afcd8065892df8391315 Mon Sep 17 00:00:00 2001 -From: Marek Kasik -Date: Fri, 20 Apr 2018 11:38:13 +0200 -Subject: [PATCH] Fix crash on missing embedded file - -Check whether an embedded file is actually present in the PDF -and show warning in that case. - -https://bugs.freedesktop.org/show_bug.cgi?id=106137 -https://gitlab.freedesktop.org/poppler/poppler/issues/236 ---- - glib/poppler-attachment.cc | 26 +++++++++++++++++--------- - glib/poppler-document.cc | 3 ++- - 2 files changed, 19 insertions(+), 10 deletions(-) - -diff --git a/glib/poppler-attachment.cc b/glib/poppler-attachment.cc -index c6502e9d..11ba5bb5 100644 ---- a/glib/poppler-attachment.cc -+++ b/glib/poppler-attachment.cc -@@ -111,17 +111,25 @@ _poppler_attachment_new (FileSpec *emb_file) - attachment->description = _poppler_goo_string_to_utf8 (emb_file->getDescription ()); - - embFile = emb_file->getEmbeddedFile(); -- attachment->size = embFile->size (); -+ if (embFile != NULL && embFile->streamObject()->isStream()) -+ { -+ attachment->size = embFile->size (); - -- if (embFile->createDate ()) -- _poppler_convert_pdf_date_to_gtime (embFile->createDate (), (time_t *)&attachment->ctime); -- if (embFile->modDate ()) -- _poppler_convert_pdf_date_to_gtime (embFile->modDate (), (time_t *)&attachment->mtime); -+ if (embFile->createDate ()) -+ _poppler_convert_pdf_date_to_gtime (embFile->createDate (), (time_t *)&attachment->ctime); -+ if (embFile->modDate ()) -+ _poppler_convert_pdf_date_to_gtime (embFile->modDate (), (time_t *)&attachment->mtime); - -- if (embFile->checksum () && embFile->checksum ()->getLength () > 0) -- attachment->checksum = g_string_new_len (embFile->checksum ()->getCString (), -- embFile->checksum ()->getLength ()); -- priv->obj_stream = embFile->streamObject()->copy(); -+ if (embFile->checksum () && embFile->checksum ()->getLength () > 0) -+ attachment->checksum = g_string_new_len (embFile->checksum ()->getCString (), -+ embFile->checksum ()->getLength ()); -+ priv->obj_stream = embFile->streamObject()->copy(); -+ } -+ else -+ { -+ g_warning ("Missing stream object for embedded file"); -+ g_clear_object (&attachment); -+ } - - return attachment; - } -diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc -index b343eb90..df0aa47f 100644 ---- a/glib/poppler-document.cc -+++ b/glib/poppler-document.cc -@@ -666,7 +666,8 @@ poppler_document_get_attachments (PopplerDocument *document) - attachment = _poppler_attachment_new (emb_file); - delete emb_file; - -- retval = g_list_prepend (retval, attachment); -+ if (attachment != NULL) -+ retval = g_list_prepend (retval, attachment); - } - return g_list_reverse (retval); - } --- -2.17.0 - diff --git a/poppler-0.67.0-filespec.patch b/poppler-0.67.0-filespec.patch deleted file mode 100644 index bfaba8f..0000000 --- a/poppler-0.67.0-filespec.patch +++ /dev/null @@ -1,35 +0,0 @@ -From de0c0b8324e776f0b851485e0fc9622fc35695b7 Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Sat, 29 Dec 2018 01:25:17 +0100 -Subject: [PATCH] FileSpec: Move the fileSpec.dictLookup call inside - fileSpec.isDict if - -Fixes #704 ---- - poppler/FileSpec.cc | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc -index 8a8b9e7e..7c12da63 100644 ---- a/poppler/FileSpec.cc -+++ b/poppler/FileSpec.cc -@@ -133,11 +133,12 @@ FileSpec::FileSpec(const Object *fileSpecA) - return; - } - } -- } - -- obj1 = fileSpec.dictLookup("Desc"); -- if (obj1.isString()) -- desc = obj1.getString()->copy(); -+ obj1 = fileSpec.dictLookup("Desc"); -+ if (obj1.isString()) { -+ desc = obj1.getString()->copy(); -+ } -+ } - } - - FileSpec::~FileSpec() --- -2.20.1 - diff --git a/poppler-0.67.0-qt4-const.patch b/poppler-0.67.0-qt4-const.patch index 6033abb..d1a132f 100644 --- a/poppler-0.67.0-qt4-const.patch +++ b/poppler-0.67.0-qt4-const.patch @@ -1,34 +1,3 @@ ---- poppler-0.67.0/qt4/src/ArthurOutputDev.cc.orig 2018-08-08 10:13:17.127028046 +0200 -+++ poppler-0.67.0/qt4/src/ArthurOutputDev.cc 2018-08-08 11:13:37.377483041 +0200 -@@ -68,7 +68,7 @@ - class SplashOutFontFileID: public SplashFontFileID { - public: - -- SplashOutFontFileID(Ref *rA) { r = *rA; } -+ SplashOutFontFileID(const Ref *rA) { r = *rA; } - - ~SplashOutFontFileID() {} - ---- poppler-0.67.0/qt4/src/poppler-annotation.cc.orig 2018-08-08 10:13:17.129028061 +0200 -+++ poppler-0.67.0/qt4/src/poppler-annotation.cc 2018-08-08 10:44:58.038166746 +0200 -@@ -534,7 +534,7 @@ QList AnnotationPrivate::fi - MovieObject *movie = new MovieObject( movieann ); - m->setMovie( movie ); - // -> movieTitle -- GooString * movietitle = movieann->getTitle(); -+ const GooString * movietitle = movieann->getTitle(); - if ( movietitle ) - m->setMovieTitle( QString::fromLatin1( movietitle->getCString() ) ); - break; -@@ -554,7 +554,7 @@ QList AnnotationPrivate::fi - s->setAction( static_cast(popplerLink) ); - - // -> screenTitle -- GooString * screentitle = screenann->getTitle(); -+ const GooString * screentitle = screenann->getTitle(); - if ( screentitle ) - s->setScreenTitle( UnicodeParsedString( screentitle ) ); - break; --- poppler-0.67.0/qt4/src/poppler-document.cc.orig 2018-08-08 10:13:17.130028069 +0200 +++ poppler-0.67.0/qt4/src/poppler-document.cc 2018-08-08 11:14:58.301690615 +0200 @@ -605,7 +605,7 @@ namespace Poppler { @@ -86,90 +55,30 @@ { - GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : NULL; + const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : NULL; - return goo ? convertDate(goo->getCString()) : QDateTime(); + return goo ? convertDate(goo->c_str()) : QDateTime(); } QDateTime EmbeddedFile::createDate() const { - GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : NULL; + const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : NULL; - return goo ? convertDate(goo->getCString()) : QDateTime(); + return goo ? convertDate(goo->c_str()) : QDateTime(); } QByteArray EmbeddedFile::checksum() const { - GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->checksum() : NULL; + const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->checksum() : NULL; - return goo ? QByteArray::fromRawData(goo->getCString(), goo->getLength()) : QByteArray(); + return goo ? QByteArray::fromRawData(goo->c_str(), goo->getLength()) : QByteArray(); } QString EmbeddedFile::mimeType() const { - GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->mimeType() : NULL; + const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->mimeType() : NULL; - return goo ? QString(goo->getCString()) : QString(); + return goo ? QString(goo->c_str()) : QString(); } ---- poppler-0.67.0/qt4/src/poppler-form.cc.orig 2018-08-08 10:13:17.130028069 +0200 -+++ poppler-0.67.0/qt4/src/poppler-form.cc 2018-08-08 10:51:46.240825862 +0200 -@@ -104,7 +104,7 @@ int FormField::id() const - QString FormField::name() const - { - QString name; -- if (GooString *goo = m_formData->fm->getPartialName()) -+ if (const GooString *goo = m_formData->fm->getPartialName()) - { - name = QString::fromLatin1(goo->getCString()); - } -@@ -114,7 +114,7 @@ QString FormField::name() const - QString FormField::fullyQualifiedName() const - { - QString name; -- if (GooString *goo = m_formData->fm->getFullyQualifiedName()) -+ if (const GooString *goo = m_formData->fm->getFullyQualifiedName()) - { - name = UnicodeParsedString(goo); - } -@@ -124,7 +124,7 @@ QString FormField::fullyQualifiedName() - QString FormField::uiName() const - { - QString name; -- if (GooString *goo = m_formData->fm->getAlternateUiName()) -+ if (const GooString *goo = m_formData->fm->getAlternateUiName()) - { - name = QString::fromLatin1(goo->getCString()); - } -@@ -271,7 +271,7 @@ FormFieldText::TextType FormFieldText::t - - QString FormFieldText::text() const - { -- GooString *goo = static_cast(m_formData->fm)->getContent(); -+ const GooString *goo = static_cast(m_formData->fm)->getContent(); - return UnicodeParsedString(goo); - } - ---- poppler-0.67.0/qt4/src/poppler-link.cc.orig 2018-08-08 10:13:17.131028077 +0200 -+++ poppler-0.67.0/qt4/src/poppler-link.cc 2018-08-08 10:59:12.395546232 +0200 -@@ -232,7 +232,7 @@ class LinkMoviePrivate : public LinkPriv - : d( new LinkDestinationPrivate ) - { - bool deleteDest = false; -- LinkDest *ld = data.ld; -+ const LinkDest *ld = data.ld; - - if ( data.namedDest && !ld && !data.externalDest ) - { ---- poppler-0.67.0/qt4/src/poppler-media.cc.orig 2018-08-08 10:13:17.131028077 +0200 -+++ poppler-0.67.0/qt4/src/poppler-media.cc 2018-08-08 11:10:51.802056415 +0200 -@@ -151,7 +151,7 @@ QSize - MediaRendition::size() const - { - Q_D( const MediaRendition ); -- MediaParameters *mp = 0; -+ const MediaParameters *mp = 0; - - if (d->rendition->getBEParameters()) - mp = d->rendition->getBEParameters(); --- poppler-0.67.0/qt4/src/poppler-movie.cc.orig 2018-08-08 10:13:17.131028077 +0200 +++ poppler-0.67.0/qt4/src/poppler-movie.cc 2018-08-08 10:52:41.284914743 +0200 @@ -57,7 +57,7 @@ MovieObject::MovieObject( AnnotMovie *an @@ -187,154 +96,9 @@ { - GooString * goo = m_movieData->m_movieObj->getFileName(); + const GooString * goo = m_movieData->m_movieObj->getFileName(); - return goo ? QString( goo->getCString() ) : QString(); + return goo ? QString( goo->c_str() ) : QString(); } ---- poppler-0.67.0/qt4/src/poppler-optcontent.cc.orig 2018-08-08 10:13:17.131028077 +0200 -+++ poppler-0.67.0/qt4/src/poppler-optcontent.cc 2018-08-08 10:53:34.222000220 +0200 -@@ -213,7 +213,7 @@ namespace Poppler - } else if ( (orderItem.isArray()) && (orderItem.arrayGetLength() > 0) ) { - parseOrderArray(lastItem, orderItem.getArray()); - } else if ( orderItem.isString() ) { -- GooString *label = orderItem.getString(); -+ const GooString *label = orderItem.getString(); - OptContentItem *header = new OptContentItem ( UnicodeParsedString ( label ) ); - m_headerOptContentItems.append( header ); - addChild( parentNode, header ); -@@ -396,7 +396,7 @@ namespace Poppler - - QSet changedItems; - -- GooList *statesList = popplerLinkOCGState->getStateList(); -+ const GooList *statesList = popplerLinkOCGState->getStateList(); - for (int i = 0; i < statesList->getLength(); ++i) { - ::LinkOCGState::StateList *stateList = (::LinkOCGState::StateList*)statesList->get(i); - ---- poppler-0.67.0/qt4/src/poppler-page.cc.orig 2018-08-08 10:13:17.132028085 +0200 -+++ poppler-0.67.0/qt4/src/poppler-page.cc 2018-08-08 10:54:22.980078936 +0200 -@@ -103,7 +103,7 @@ Link* PageData::convertLinkActionToLink( - case actionLaunch: - { - LinkLaunch * e = (LinkLaunch *)a; -- GooString * p = e->getParams(); -+ const GooString * p = e->getParams(); - popplerLink = new LinkExecute( linkArea, e->getFileName()->getCString(), p ? p->getCString() : 0 ); - } - break; ---- poppler-0.67.0/qt4/src/poppler-private.cc.orig 2018-08-08 10:13:17.132028085 +0200 -+++ poppler-0.67.0/qt4/src/poppler-private.cc 2018-08-08 11:03:25.964955666 +0200 -@@ -73,7 +73,7 @@ namespace Debug { - (*Debug::debugFunction)(emsg, Debug::debugClosure); - } - -- QString unicodeToQString(Unicode* u, int len) { -+ QString unicodeToQString(const Unicode* u, int len) { - if (!utf8Map) - { - GooString enc("UTF-8"); -@@ -98,11 +98,11 @@ namespace Debug { - return QString::fromUtf8(convertedStr.getCString(), convertedStr.getLength()); - } - -- QString UnicodeParsedString(GooString *s1) { -+ QString UnicodeParsedString(const GooString *s1) { - if ( !s1 || s1->getLength() == 0 ) - return QString(); - -- char *cString; -+ const char *cString; - int stringLength; - bool deleteCString; - if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getLength() > 1 && ( s1->getChar(1) & 0xff ) == 0xff ) ) -@@ -162,7 +162,7 @@ namespace Debug { - return QStringToUnicodeGooString(dt.toUTC().toString("yyyyMMddhhmmss+00'00'")); - } - -- static void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e ) -+ static void linkActionToTocItem( const ::LinkAction * a, DocumentData * doc, QDomElement * e ) - { - if ( !a || !e ) - return; -@@ -172,14 +172,14 @@ namespace Debug { - case actionGoTo: - { - // page number is contained/referenced in a LinkGoTo -- LinkGoTo * g = static_cast< LinkGoTo * >( a ); -- LinkDest * destination = g->getDest(); -+ const LinkGoTo * g = static_cast< const LinkGoTo * >( a ); -+ const LinkDest * destination = g->getDest(); - if ( !destination && g->getNamedDest() ) - { - // no 'destination' but an internal 'named reference'. we could - // get the destination for the page now, but it's VERY time consuming, - // so better storing the reference and provide the viewport on demand -- GooString *s = g->getNamedDest(); -+ const GooString *s = g->getNamedDest(); - QChar *charArray = new QChar[s->getLength()]; - for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]); - QString aux(charArray, s->getLength()); -@@ -196,14 +196,14 @@ namespace Debug { - case actionGoToR: - { - // page number is contained/referenced in a LinkGoToR -- LinkGoToR * g = static_cast< LinkGoToR * >( a ); -- LinkDest * destination = g->getDest(); -+ const LinkGoToR * g = static_cast< const LinkGoToR * >( a ); -+ const LinkDest * destination = g->getDest(); - if ( !destination && g->getNamedDest() ) - { - // no 'destination' but an internal 'named reference'. we could - // get the destination for the page now, but it's VERY time consuming, - // so better storing the reference and provide the viewport on demand -- GooString *s = g->getNamedDest(); -+ const GooString *s = g->getNamedDest(); - QChar *charArray = new QChar[s->getLength()]; - for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]); - QString aux(charArray, s->getLength()); -@@ -220,7 +220,7 @@ namespace Debug { - } - case actionURI: - { -- LinkURI * u = static_cast< LinkURI * >( a ); -+ const LinkURI * u = static_cast< const LinkURI * >( a ); - e->setAttribute( "DestinationURI", u->getURI()->getCString() ); - } - default: ; -@@ -260,7 +260,7 @@ namespace Debug { - } - - -- void DocumentData::addTocChildren( QDomDocument * docSyn, QDomNode * parent, GooList * items ) -+ void DocumentData::addTocChildren( QDomDocument * docSyn, QDomNode * parent, const GooList * items ) - { - int numItems = items->getLength(); - for ( int i = 0; i < numItems; ++i ) -@@ -270,7 +270,7 @@ namespace Debug { - - // 1. create element using outlineItem's title as tagName - QString name; -- Unicode * uniChar = outlineItem->getTitle(); -+ const Unicode * uniChar = outlineItem->getTitle(); - int titleLength = outlineItem->getTitleLength(); - name = unicodeToQString(uniChar, titleLength); - if ( name.isEmpty() ) -@@ -280,14 +280,14 @@ namespace Debug { - parent->appendChild( item ); - - // 2. find the page the link refers to -- ::LinkAction * a = outlineItem->getAction(); -+ const ::LinkAction * a = outlineItem->getAction(); - linkActionToTocItem( a, this, &item ); - - item.setAttribute( "Open", QVariant( (bool)outlineItem->isOpen() ).toString() ); - - // 3. recursively descend over children - outlineItem->open(); -- GooList * children = outlineItem->getKids(); -+ const GooList * children = outlineItem->getKids(); - if ( children ) - addTocChildren( docSyn, &item, children ); - } --- poppler-0.67.0/qt4/src/poppler-private.h.orig 2018-08-08 10:13:17.132028085 +0200 +++ poppler-0.67.0/qt4/src/poppler-private.h 2018-08-08 11:00:30.836672893 +0200 @@ -54,9 +54,9 @@ class FormWidget; @@ -399,6 +163,6 @@ - GooString * goo = m_soundData->m_soundObj->getFileName(); + const GooString * goo = m_soundData->m_soundObj->getFileName(); - return goo ? QString( goo->getCString() ) : QString(); + return goo ? QString( goo->c_str() ) : QString(); } diff --git a/poppler-0.67.0-rich-media-annotation.patch b/poppler-0.67.0-rich-media-annotation.patch deleted file mode 100644 index 3730e3e..0000000 --- a/poppler-0.67.0-rich-media-annotation.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 7f87dc10b6adccd6d1b977a28b064add254aa2da Mon Sep 17 00:00:00 2001 -From: Adam Reichold -Date: Thu, 27 Dec 2018 11:54:53 +0100 -Subject: [PATCH] Do not try to construct invalid rich media annotation assets. - Closes #703 - ---- - poppler/Annot.cc | 24 +++++++++++++----------- - 1 file changed, 13 insertions(+), 11 deletions(-) - -diff --git a/poppler/Annot.cc b/poppler/Annot.cc -index 2e4770ab..1750dc70 100644 ---- a/poppler/Annot.cc -+++ b/poppler/Annot.cc -@@ -6418,20 +6418,22 @@ AnnotRichMedia::Content::Content(Dict *dict) { - if (obj1.isDict()) { - Object obj2 = obj1.getDict()->lookup("Names"); - if (obj2.isArray()) { -- nAssets = obj2.arrayGetLength() / 2; -+ const int length = obj2.arrayGetLength() / 2; - -- assets = (Asset **)gmallocn(nAssets, sizeof(Asset *)); -+ assets = (Asset **)gmallocn(length, sizeof(Asset *)); -+ for (int i = 0; i < length; ++i) { -+ Object objKey = obj2.arrayGet(2 * i); -+ Object objVal = obj2.arrayGet(2 * i + 1); - -- int counter = 0; -- for (int i = 0; i < nAssets; ++i) { -- assets[counter] = new AnnotRichMedia::Asset; -- -- Object objKey = obj2.arrayGet(i * 2); -- assets[counter]->fileSpec = obj2.arrayGet(i * 2 + 1); -- -- assets[counter]->name = new GooString( objKey.getString() ); -- ++counter; -+ if (!objKey.isString() || objVal.isNull()) { -+ error(errSyntaxError, -1, "Bad Annot Asset"); -+ continue; -+ } - -+ assets[nAssets] = new AnnotRichMedia::Asset; -+ assets[nAssets]->name = new GooString( objKey.getString() ); -+ assets[nAssets]->fileSpec = std::move(objVal); -+ ++nAssets; - } - } - } --- -2.20.1 - diff --git a/poppler-0.67.0-stream-check.patch b/poppler-0.67.0-stream-check.patch deleted file mode 100644 index 3a4ba07..0000000 --- a/poppler-0.67.0-stream-check.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 6912e06d9ab19ba28991b5cab3319d61d856bd6d Mon Sep 17 00:00:00 2001 -From: Adam Reichold -Date: Tue, 6 Nov 2018 09:00:02 +0100 -Subject: [PATCH] Check for stream before calling stream methods when saving an - embedded file. - -Closes #659 ---- - poppler/FileSpec.cc | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc -index 7479c2d2..d5543041 100644 ---- a/poppler/FileSpec.cc -+++ b/poppler/FileSpec.cc -@@ -93,6 +93,9 @@ bool EmbFile::save(const char *path) { - GBool EmbFile::save2(FILE *f) { - int c; - -+ if (unlikely(!m_objStr.isStream())) -+ return false; -+ - m_objStr.streamReset(); - while ((c = m_objStr.streamGetChar()) != EOF) { - fputc(c, f); --- -2.19.1 - diff --git a/poppler-0.67.0-valid-embedded-file-name.patch b/poppler-0.67.0-valid-embedded-file-name.patch deleted file mode 100644 index 6f0a841..0000000 --- a/poppler-0.67.0-valid-embedded-file-name.patch +++ /dev/null @@ -1,81 +0,0 @@ -From d2f5d424ba8752f9a9e9dad410546ec1b46caa0a Mon Sep 17 00:00:00 2001 -From: Adam Reichold -Date: Tue, 6 Nov 2018 09:08:06 +0100 -Subject: [PATCH] pdfdetach: Check for valid file name of embedded file before - using it to determine save path. - -Closes #660 ---- - utils/pdfdetach.cc | 24 ++++++++++++++++++------ - 1 file changed, 18 insertions(+), 6 deletions(-) - -diff --git a/utils/pdfdetach.cc b/utils/pdfdetach.cc -index a8720c64..71fa8608 100644 ---- a/utils/pdfdetach.cc -+++ b/utils/pdfdetach.cc -@@ -191,14 +191,18 @@ int main(int argc, char *argv[]) { - fileSpec = static_cast(embeddedFiles->get(i)); - printf("%d: ", i+1); - s1 = fileSpec->getFileName(); -- if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getChar(1) & 0xff) == 0xff) { -+ if (!s1) { -+ exitCode = 3; -+ goto err2; -+ } -+ if (s1->hasUnicodeMarker()) { - isUnicode = gTrue; - j = 2; - } else { - isUnicode = gFalse; - j = 0; - } -- while (j < fileSpec->getFileName()->getLength()) { -+ while (j < s1->getLength()) { - if (isUnicode) { - u = ((s1->getChar(j) & 0xff) << 8) | (s1->getChar(j+1) & 0xff); - j += 2; -@@ -228,14 +232,18 @@ int main(int argc, char *argv[]) { - p = path; - } - s1 = fileSpec->getFileName(); -- if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getChar(1) & 0xff) == 0xff) { -+ if (!s1) { -+ exitCode = 3; -+ goto err2; -+ } -+ if (s1->hasUnicodeMarker()) { - isUnicode = gTrue; - j = 2; - } else { - isUnicode = gFalse; - j = 0; - } -- while (j < fileSpec->getFileName()->getLength()) { -+ while (j < s1->getLength()) { - if (isUnicode) { - u = ((s1->getChar(j) & 0xff) << 8) | (s1->getChar(j+1) & 0xff); - j += 2; -@@ -276,14 +284,18 @@ int main(int argc, char *argv[]) { - } else { - p = path; - s1 = fileSpec->getFileName(); -- if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getChar(1) & 0xff) == 0xff) { -+ if (!s1) { -+ exitCode = 3; -+ goto err2; -+ } -+ if (s1->hasUnicodeMarker()) { - isUnicode = gTrue; - j = 2; - } else { - isUnicode = gFalse; - j = 0; - } -- while (j < fileSpec->getFileName()->getLength()) { -+ while (j < s1->getLength()) { - if (isUnicode) { - u = ((s1->getChar(j) & 0xff) << 8) | (s1->getChar(j+1) & 0xff); - j += 2; --- -2.19.1 - diff --git a/poppler-0.67.0-valid-embedded-file.patch b/poppler-0.67.0-valid-embedded-file.patch deleted file mode 100644 index 1880a0d..0000000 --- a/poppler-0.67.0-valid-embedded-file.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 77a30e94d96220d7e22dff5b3f0a7f296f01b118 Mon Sep 17 00:00:00 2001 -From: Adam Reichold -Date: Tue, 6 Nov 2018 09:13:41 +0100 -Subject: [PATCH] pdfdetach: Check for valid embedded file before trying to - save it. - -Closes #661 ---- - utils/pdfdetach.cc | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/utils/pdfdetach.cc b/utils/pdfdetach.cc -index 846584a4..a8720c64 100644 ---- a/utils/pdfdetach.cc -+++ b/utils/pdfdetach.cc -@@ -251,7 +251,12 @@ int main(int argc, char *argv[]) { - } - *p = '\0'; - -- if (!fileSpec->getEmbeddedFile()->save(path)) { -+ auto *embFile = fileSpec->getEmbeddedFile(); -+ if (!embFile || !embFile->isOk()) { -+ exitCode = 3; -+ goto err2; -+ } -+ if (!embFile->save(path)) { - error(errIO, -1, "Error saving embedded file as '{0:s}'", p); - exitCode = 2; - goto err2; -@@ -296,7 +301,12 @@ int main(int argc, char *argv[]) { - p = path; - } - -- if (!fileSpec->getEmbeddedFile()->save(p)) { -+ auto *embFile = fileSpec->getEmbeddedFile(); -+ if (!embFile || !embFile->isOk()) { -+ exitCode = 3; -+ goto err2; -+ } -+ if (!embFile->save(p)) { - error(errIO, -1, "Error saving embedded file as '{0:s}'", p); - exitCode = 2; - goto err2; --- -2.19.1 - diff --git a/poppler.spec b/poppler.spec index 38fda39..4096e60 100644 --- a/poppler.spec +++ b/poppler.spec @@ -1,15 +1,15 @@ -%global test_sha 0d2bfd4af4c76a3bac27ccaff793d9129df7b57a -%global test_date 2009-05-13 +%global test_sha 45f55f1e03b9bf3fbd334c31776b6f5e472889ec +%global test_date 2018-12-18 Summary: PDF rendering library Name: poppler -Version: 0.67.0 -Release: 10%{?dist} +Version: 0.73.0 +Release: 1%{?dist} License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT URL: http://poppler.freedesktop.org/ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz # git archive --prefix test/ -Source1: %{name}-test-%{test_date}_%{test_sha}.tar.xz +Source1: %{name}-test-%{test_date}-%{test_sha}.tar.xz # https://bugzilla.redhat.com/show_bug.cgi?id=1185007 Patch0: poppler-0.30.0-rotated-words-selection.patch @@ -22,33 +22,6 @@ Patch6: poppler-0.63.0-tiling-patterns.patch Patch7: poppler-0.67.0-qt4-const.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1569334 -Patch8: poppler-0.67.0-embedded-file-check.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1626618 -Patch9: poppler-0.67.0-cycles-in-pdf-parsing.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1649435 -Patch10: poppler-0.67.0-stream-check.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1649440 -Patch11: poppler-0.67.0-valid-embedded-file.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1649450 -Patch12: poppler-0.67.0-valid-embedded-file-name.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1665259 -Patch13: poppler-0.67.0-rich-media-annotation.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1665263 -Patch14: poppler-0.67.0-filespec.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1665266 -Patch15: poppler-0.67.0-dummy-xref-entry.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1646546 -Patch16: poppler-0.67.0-display-profile.patch - BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: gettext-devel @@ -187,7 +160,7 @@ export CC="gcc -fPIC" # hack to make the cmake call pass -DENABLE_DCTDECODER=libjpeg \ -DENABLE_GTK_DOC=ON \ -DENABLE_LIBOPENJPEG=openjpeg2 \ - -DENABLE_XPDF_HEADERS=ON \ + -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \ -DENABLE_ZLIB=OFF \ .. unset CC @@ -222,7 +195,7 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %files %doc README %license COPYING -%{_libdir}/libpoppler.so.78* +%{_libdir}/libpoppler.so.84* %files devel %{_libdir}/pkgconfig/poppler.pc @@ -279,6 +252,9 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_mandir}/man1/* %changelog +* Fri Jan 25 2019 Marek Kasik - 0.73.0-1 +- Update to 0.73.0 + * Tue Jan 22 2019 Marek Kasik - 0.67.0-10 - Avoid global display profile state becoming an uncontrolled - memory leak diff --git a/sources b/sources index 5124e97..a8c07b5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (poppler-0.67.0.tar.xz) = 36584c62970ae0ae7807687f9c0523560ae92ac323949be8916a0e8dc6e691633e55cdd76c6026253c337aed8a4b43a7759a3de74c9ec606654f65379fb0f206 -SHA512 (poppler-test-2009-05-13_0d2bfd4af4c76a3bac27ccaff793d9129df7b57a.tar.xz) = f8ce114357043a893100de2d52ada8bd850148d19f0e8c889988ea97e9a92313f0545c0b88ef32a1ce7f0e9e58edc1a8c9066278c20b7718ca619913fd4bfb3c +SHA512 (poppler-0.73.0.tar.xz) = 6924a343032573504a0039c56a6263cd1183fa6aca75966fe1f084bd19da78553e455e541a3693896c1ed0c3865f11c11758a0f5a66b2f6cd48ac8a7eccf891a +SHA512 (poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz) = fa1d8c92ca5bc9ebd7453dfb78f34fb44d014621fe698aa4a3fa9bd17bd0d302ca6ba36f4dd46a1ef030c0b7a30729d4bacb6d01c5c67d429c897e4f5ab331e8