diff options
Diffstat (limited to 'Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h')
-rw-r--r-- | Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h b/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h index 99de8a21a34..48d8dcf779e 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h +++ b/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h @@ -14,7 +14,7 @@ // under GPL version 2 or later // // Copyright (C) 2005, 2006, 2008 Brad Hards <bradh@frogmouth.net> -// Copyright (C) 2005, 2009, 2014, 2015 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009, 2014, 2015, 2017 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2008 Julien Rebetez <julienr@svn.gnome.org> // Copyright (C) 2008 Pino Toscano <pino@kde.org> // Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org> @@ -24,7 +24,7 @@ // Copyright (C) 2010 Srinivas Adicherla <srinivas.adicherla@geodesic.com> // Copyright (C) 2011, 2013, 2014, 2016 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it> -// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2013, 2017 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com> // Copyright (C) 2013 Adrian Perez de Castro <aperez@igalia.com> // Copyright (C) 2015 André Guerreiro <aguerreiro1985@gmail.com> @@ -229,12 +229,12 @@ public: GBool isLinearized(GBool tryingToReconstruct = gFalse); // Return the document's Info dictionary (if any). - Object *getDocInfo(Object *obj) { return xref->getDocInfo(obj); } - Object *getDocInfoNF(Object *obj) { return xref->getDocInfoNF(obj); } + Object getDocInfo() { return xref->getDocInfo(); } + Object getDocInfoNF() { return xref->getDocInfoNF(); } // Create and return the document's Info dictionary if none exists. // Otherwise return the existing one. - Object *createDocInfoIfNoneExists(Object *obj) { return xref->createDocInfoIfNoneExists(obj); } + Object createDocInfoIfNoneExists() { return xref->createDocInfoIfNoneExists(); } // Remove the document's Info dictionary and update the trailer dictionary. void removeDocInfo() { xref->removeDocInfo(); } @@ -292,40 +292,36 @@ public: // rewrite pageDict with MediaBox, CropBox and new page CTM void replacePageDict(int pageNo, int rotate, PDFRectangle *mediaBox, PDFRectangle *cropBox); - void markPageObjects(Dict *pageDict, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum); - GBool markAnnotations(Object *annots, XRef *xRef, XRef *countRef, Guint numOffset, int oldPageNum, int newPageNum); + void markPageObjects(Dict *pageDict, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum, std::set<Dict*> *alreadyMarkedDicts = nullptr); + GBool markAnnotations(Object *annots, XRef *xRef, XRef *countRef, Guint numOffset, int oldPageNum, int newPageNum, std::set<Dict*> *alreadyMarkedDicts = nullptr); void markAcroForm(Object *acrpForm, XRef *xRef, XRef *countRef, Guint numOffset, int oldPageNum, int newPageNum); // write all objects used by pageDict to outStr Guint writePageObjects(OutStream *outStr, XRef *xRef, Guint numOffset, GBool combine = gFalse); static void writeObject (Object *obj, OutStream* outStr, XRef *xref, Guint numOffset, Guchar *fileKey, - CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen); + CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, std::set<Dict*> *alreadyWrittenDicts = nullptr); static void writeHeader(OutStream *outStr, int major, int minor); - // Ownership goes to the caller - static Dict *createTrailerDict (int uxrefSize, GBool incrUpdate, Goffset startxRef, + static Object createTrailerDict (int uxrefSize, GBool incrUpdate, Goffset startxRef, Ref *root, XRef *xRef, const char *fileName, Goffset fileSize); - static void writeXRefTableTrailer (Dict *trailerDict, XRef *uxref, GBool writeAllEntries, + static void writeXRefTableTrailer (Object &&trailerDict, XRef *uxref, GBool writeAllEntries, Goffset uxrefOffset, OutStream* outStr, XRef *xRef); - static void writeXRefStreamTrailer (Dict *trailerDict, XRef *uxref, Ref *uxrefStreamRef, + static void writeXRefStreamTrailer (Object &&trailerDict, XRef *uxref, Ref *uxrefStreamRef, Goffset uxrefOffset, OutStream* outStr, XRef *xRef); private: // insert referenced objects in XRef - void markDictionnary (Dict* dict, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum); - void markObject (Object *obj, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum); + void markDictionnary (Dict* dict, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum, std::set<Dict*> *alreadyMarkedDicts); + void markObject (Object *obj, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum, std::set<Dict*> *alreadyMarkedDicts = nullptr); static void writeDictionnary (Dict* dict, OutStream* outStr, XRef *xRef, Guint numOffset, Guchar *fileKey, - CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen); + CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, std::set<Dict*> *alreadyWrittenDicts); // Write object header to current file stream and return its offset static Goffset writeObjectHeader (Ref *ref, OutStream* outStr); static void writeObjectFooter (OutStream* outStr); void writeObject (Object *obj, OutStream* outStr, Guchar *fileKey, CryptAlgorithm encAlgorithm, - int keyLength, int objNum, int objGen) - { writeObject(obj, outStr, getXRef(), 0, fileKey, encAlgorithm, keyLength, objNum, objGen); } - void writeDictionnary (Dict* dict, OutStream* outStr, Guchar *fileKey, CryptAlgorithm encAlgorithm, - int keyLength, int objNum, int objGen) - { writeDictionnary(dict, outStr, getXRef(), 0, fileKey, encAlgorithm, keyLength, objNum, objGen); } + int keyLength, int objNum, int objGen, std::set<Dict*> *alreadyWrittenDicts = nullptr) + { writeObject(obj, outStr, getXRef(), 0, fileKey, encAlgorithm, keyLength, objNum, objGen, alreadyWrittenDicts); } static void writeStream (Stream* str, OutStream* outStr); static void writeRawStream (Stream* str, OutStream* outStr); void writeXRefTableTrailer (Goffset uxrefOffset, XRef *uxref, GBool writeAllEntries, @@ -386,7 +382,7 @@ private: int fopenErrno; Goffset startXRefPos; // offset of last xref table -#if MULTITHREADED +#ifdef MULTITHREADED GooMutex mutex; #endif }; |