From 26303c87da58c532f578a89d3c07c774babf6317 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 27 Jan 2013 15:50:26 +1030 Subject: [PATCH] A few more missing Goffsets --- glib/poppler-input-stream.h | 2 +- poppler/PDFDoc.cc | 16 ++++++++-------- poppler/PDFDoc.h | 6 +++--- poppler/Stream.cc | 4 ++-- poppler/Stream.h | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/glib/poppler-input-stream.h b/glib/poppler-input-stream.h index 251a61b..74c198f 100644 --- a/glib/poppler-input-stream.h +++ b/glib/poppler-input-stream.h @@ -65,7 +65,7 @@ private: char buf[inputStreamBufSize]; char *bufPtr; char *bufEnd; - Guint bufPos; + Goffset bufPos; int savePos; GBool saved; }; diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index 4f2ac57..c184348 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -891,7 +891,7 @@ void PDFDoc::saveIncrementalUpdate (OutStream* outStr) if (xref->getEntry(i)->type != xrefEntryFree) { Object obj1; xref->fetch(ref.num, ref.gen, &obj1, 1); - Guint offset = writeObjectHeader(&ref, outStr); + Goffset offset = writeObjectHeader(&ref, outStr); writeObject(&obj1, outStr, fileKey, encAlgorithm, keyLength, ref.num, ref.gen); writeObjectFooter(outStr); uxref->add(ref.num, ref.gen, offset, gTrue); @@ -970,7 +970,7 @@ void PDFDoc::saveCompleteRewrite (OutStream* outStr) ref.num = i; ref.gen = xref->getEntry(i)->gen; xref->fetch(ref.num, ref.gen, &obj1, 1); - Guint offset = writeObjectHeader(&ref, outStr); + Goffset offset = writeObjectHeader(&ref, outStr); // Write unencrypted objects in unencrypted form if (xref->getEntry(i)->getFlag(XRefEntry::Unencrypted)) { writeObject(&obj1, outStr, NULL, cryptRC4, 0, 0, 0); @@ -984,7 +984,7 @@ void PDFDoc::saveCompleteRewrite (OutStream* outStr) ref.num = i; ref.gen = 0; //compressed entries have gen == 0 xref->fetch(ref.num, ref.gen, &obj1, 1); - Guint offset = writeObjectHeader(&ref, outStr); + Goffset offset = writeObjectHeader(&ref, outStr); writeObject(&obj1, outStr, fileKey, encAlgorithm, keyLength, ref.num, ref.gen); writeObjectFooter(outStr); uxref->add(ref.num, ref.gen, offset, gTrue); @@ -1106,7 +1106,7 @@ void PDFDoc::writeString (GooString* s, OutStream* outStr, Guchar *fileKey, delete sEnc; } -Guint PDFDoc::writeObjectHeader (Ref *ref, OutStream* outStr) +Goffset PDFDoc::writeObjectHeader (Ref *ref, OutStream* outStr) { Goffset offset = outStr->getPos(); outStr->printf("%i %i obj ", ref->num, ref->gen); @@ -1241,7 +1241,7 @@ void PDFDoc::writeObjectFooter (OutStream* outStr) outStr->printf("endobj\r\n"); } -Dict *PDFDoc::createTrailerDict(int uxrefSize, GBool incrUpdate, Guint startxRef, +Dict *PDFDoc::createTrailerDict(int uxrefSize, GBool incrUpdate, Goffset startxRef, Ref *root, XRef *xRef, const char *fileName, Goffset fileSize) { Dict *trailerDict = new Dict(xRef); @@ -1327,7 +1327,7 @@ Dict *PDFDoc::createTrailerDict(int uxrefSize, GBool incrUpdate, Guint startxRef trailerDict->set("Root", &obj1); if (incrUpdate) { - obj1.initInt(startxRef); + obj1.initInt64(startxRef); trailerDict->set("Prev", &obj1); } @@ -1372,7 +1372,7 @@ void PDFDoc::writeXRefStreamTrailer (Dict *trailerDict, XRef *uxref, Ref *uxrefS outStr->printf( "%%%%EOF\r\n"); } -void PDFDoc::writeXRefTableTrailer(Guint uxrefOffset, XRef *uxref, GBool writeAllEntries, +void PDFDoc::writeXRefTableTrailer(Goffset uxrefOffset, XRef *uxref, GBool writeAllEntries, int uxrefSize, OutStream* outStr, GBool incrUpdate) { const char *fileNameA = fileName ? fileName->getCString() : NULL; @@ -1575,7 +1575,7 @@ Guint PDFDoc::writePageObjects(OutStream *outStr, XRef *xRef, Guint numOffset, G ref.gen = xRef->getEntry(n)->gen; objectsCount++; getXRef()->fetch(ref.num - numOffset, ref.gen, &obj); - Guint offset = writeObjectHeader(&ref, outStr); + Goffset offset = writeObjectHeader(&ref, outStr); if (combine) { writeObject(&obj, outStr, getXRef(), numOffset, NULL, cryptRC4, 0, 0, 0); } else if (xRef->getEntry(n)->getFlag(XRefEntry::Unencrypted)) { diff --git a/poppler/PDFDoc.h b/poppler/PDFDoc.h index 8eab095..cc9d2db 100644 --- a/poppler/PDFDoc.h +++ b/poppler/PDFDoc.h @@ -252,7 +252,7 @@ public: static void writeHeader(OutStream *outStr, int major, int minor); // Ownership goes to the caller - static Dict *createTrailerDict (int uxrefSize, GBool incrUpdate, Guint startxRef, + static Dict *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, Goffset uxrefOffset, OutStream* outStr, XRef *xRef); @@ -267,7 +267,7 @@ private: CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen); // Write object header to current file stream and return its offset - static Guint writeObjectHeader (Ref *ref, OutStream* outStr); + static Goffset writeObjectHeader (Ref *ref, OutStream* outStr); static void writeObjectFooter (OutStream* outStr); void writeObject (Object *obj, OutStream* outStr, Guchar *fileKey, CryptAlgorithm encAlgorithm, @@ -278,7 +278,7 @@ private: { writeDictionnary(dict, outStr, getXRef(), 0, fileKey, encAlgorithm, keyLength, objNum, objGen); } static void writeStream (Stream* str, OutStream* outStr); static void writeRawStream (Stream* str, OutStream* outStr); - void writeXRefTableTrailer (Guint uxrefOffset, XRef *uxref, GBool writeAllEntries, + void writeXRefTableTrailer (Goffset uxrefOffset, XRef *uxref, GBool writeAllEntries, int uxrefSize, OutStream* outStr, GBool incrUpdate); static void writeString (GooString* s, OutStream* outStr, Guchar *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen); diff --git a/poppler/Stream.cc b/poppler/Stream.cc index 3deab44..1a23602 100644 --- a/poppler/Stream.cc +++ b/poppler/Stream.cc @@ -757,8 +757,8 @@ GBool StreamPredictor::getNextLine() { // UniqueFileStream //------------------------------------------------------------------------ -UniqueFileStream::UniqueFileStream(FILE *fA, char *fileNameA, Guint startA, GBool limitedA, - Guint lengthA, Object *dictA): +UniqueFileStream::UniqueFileStream(FILE *fA, char *fileNameA, Goffset startA, GBool limitedA, + Goffset lengthA, Object *dictA): FileStream(fA, fileNameA, startA, limitedA, lengthA, dictA) { f = fopen(fileName, "rb"); } diff --git a/poppler/Stream.h b/poppler/Stream.h index f6e85ac..dee0648 100644 --- a/poppler/Stream.h +++ b/poppler/Stream.h @@ -507,8 +507,8 @@ private: class UniqueFileStream: public FileStream { public: - UniqueFileStream(FILE *fA, char *fileNameA, Guint startA, GBool limitedA, - Guint lengthA, Object *dictA); + UniqueFileStream(FILE *fA, char *fileNameA, Goffset startA, GBool limitedA, + Goffset lengthA, Object *dictA); virtual ~UniqueFileStream(); }; -- 1.7.10.4