summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-3.02-PATCHES
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-3.02-PATCHES')
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog66
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY28
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-exclude-body-of-Page::getDefaultCTM21
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex534
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-skip-reading-config-file72
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-22-exclude-openTempFile24
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-23-exclude-keyBindings156
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-40-objectStream-support-for-pdftosrc165
8 files changed, 504 insertions, 562 deletions
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog
new file mode 100644
index 00000000000..58a9e24fa1e
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog
@@ -0,0 +1,66 @@
+2009-05-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Reorganize and simplify pdftex patches.
+
+ * patch-10-PDF_PARSER_ONLY (removed): replaced by ...
+ * patch-10-exclude-body-of-Page::getDefaultCTM (new): ... this.
+
+ from Derek B. Noonburg <derek@foolabs.com>
+
+ * patch-20-pdftex (removed): split into several pieces.
+ * patch-20-skip-reading-config-file (new): simplified version
+ of previous code.
+ * patch-22-exclude-openTempFile: new file.
+ * patch-23-exclude-keyBindings: new file.
+ * patch-40-objectStream-support-for-pdftosrc: new file.
+
+ from Han The Thanh <thanh@pdftex.org>
+
+2009-05-05 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-15-fix-pow-arg (new): Three ...
+ * patch-16-size-of-struct (new): ... small patches ...
+ * patch-17-strCrypt (new): ... split of from ...
+ * patch-20-pdftex: ... this one.
+
+2009-04-30 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-02-pl3 (new): Official 3.02pl3 patch plus change of
+ xpdfVersion "3.02pl2" -> "3.02pl3"
+ * patch-[12]?-*: adapted to presence of patch-01-pl3.
+
+2009-04-02 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-12-mingw32 (new): Buld fix for mingw32.
+
+ from Derek B. Noonburg <derek@foolabs.com>
+
+2009-03-05 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-11-time_h (new): Buld fix for djgpp.
+
+ from Derek B. Noonburg <derek@foolabs.com>
+
+2009-02-08 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-10-PDF_PARSER_ONLY (new): required build with
+ PDF_PARSER_ONLY defined.
+
+ * patch-20-pdftex (new): To restore former tree for pdfTeX.
+
+2007-11-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-02-pl2 (new): Official 3.02pl2 patch plus change of
+ xpdfVersion "3.02pl1" -> "3.02pl2"
+
+2007-08-01 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-01-pl1 (new): Official 3.02pl1 patch plus change of
+ xpdfVersion "3.02" -> "3.02pl1" in ../xpdf/config.h.
+
+2007-02-29 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Imported xpdf-3.02 source tree:
+ ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02.tar.gz
+ http://www.foolabs.com/xpdf/xpdf-3.02.tar.gz
+
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY
deleted file mode 100644
index 55e16622d93..00000000000
--- a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY
+++ /dev/null
@@ -1,28 +0,0 @@
- Enable compilation with -DPDF_PARSER_ONLY
-
-diff -ur -N xpdf-3.02.orig/xpdf/Page.cc xpdf-3.02/xpdf/Page.cc
---- xpdf-3.02.orig/xpdf/Page.cc 2007-02-27 23:05:52.000000000 +0100
-+++ xpdf-3.02/xpdf/Page.cc 2009-02-08 03:15:12.000000000 +0100
-@@ -5,6 +5,9 @@
- // Copyright 1996-2007 Glyph & Cog, LLC
- //
- //========================================================================
-+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
-+// See top-level ChangeLog for a list of all modifications
-+//========================================================================
-
- #include <aconf.h>
-
-@@ -420,6 +423,7 @@
- delete links;
- }
-
-+#ifndef PDF_PARSER_ONLY
- void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI,
- int rotate, GBool useMediaBox, GBool upsideDown) {
- GfxState *state;
-@@ -439,3 +443,4 @@
- }
- delete state;
- }
-+#endif
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-exclude-body-of-Page::getDefaultCTM b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-exclude-body-of-Page::getDefaultCTM
new file mode 100644
index 00000000000..5037bf1ba02
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-exclude-body-of-Page::getDefaultCTM
@@ -0,0 +1,21 @@
+ Enable compilation with -DPDF_PARSER_ONLY
+
+ from:
+ Derek B. Noonburg <derek@foolabs.com>
+
+--- xpdf-3.02.orig/xpdf/Page.cc 2007-02-27 23:05:52.000000000 +0100
++++ xpdf-3.02/xpdf/Page.cc 2009-05-07 00:22:58.085044699 +0200
+@@ -422,6 +422,7 @@
+
+ void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI,
+ int rotate, GBool useMediaBox, GBool upsideDown) {
++#ifndef PDF_PARSER_ONLY
+ GfxState *state;
+ int i;
+
+@@ -438,4 +439,5 @@
+ ctm[i] = state->getCTM()[i];
+ }
+ delete state;
++#endif
+ }
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex
deleted file mode 100644
index b4d71a8748b..00000000000
--- a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex
+++ /dev/null
@@ -1,534 +0,0 @@
- Patches for pdfTeX / luaTeX / XeTeX
-
- from:
- Han The Thanh <thanh@pdftex.org>
- Martin Schroeder <martin@pdftex.org>
-
-diff -ur -N xpdf-3.02.orig/goo/gfile.cc xpdf-3.02/goo/gfile.cc
---- xpdf-3.02.orig/goo/gfile.cc 2009-03-05 23:36:46.000000000 +0100
-+++ xpdf-3.02/goo/gfile.cc 2009-04-30 21:29:39.000000000 +0200
-@@ -443,6 +443,7 @@
- #endif
- }
-
-+#ifndef PDF_PARSER_ONLY
- GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
- #if defined(WIN32)
- //---------- Win32 ----------
-@@ -551,6 +552,7 @@
- return gTrue;
- #endif
- }
-+#endif
-
- GBool executeCommand(char *cmd) {
- #ifdef VMS
-diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.cc xpdf-3.02/xpdf/GlobalParams.cc
---- xpdf-3.02.orig/xpdf/GlobalParams.cc 2009-04-02 10:22:18.000000000 +0200
-+++ xpdf-3.02/xpdf/GlobalParams.cc 2009-04-30 21:35:00.000000000 +0200
-@@ -429,6 +429,7 @@
- }
- }
-
-+#ifndef PDF_PARSER_ONLY
- //------------------------------------------------------------------------
- // KeyBinding
- //------------------------------------------------------------------------
-@@ -461,6 +462,7 @@
- KeyBinding::~KeyBinding() {
- deleteGList(cmds, GString);
- }
-+#endif
-
- #ifdef ENABLE_PLUGINS
- //------------------------------------------------------------------------
-@@ -608,6 +610,138 @@
- // parsing
- //------------------------------------------------------------------------
-
-+GlobalParams::GlobalParams() {
-+ UnicodeMap *map;
-+ int i;
-+
-+#if MULTITHREADED
-+ gInitMutex(&mutex);
-+ gInitMutex(&unicodeMapCacheMutex);
-+ gInitMutex(&cMapCacheMutex);
-+#endif
-+
-+ initBuiltinFontTables();
-+
-+ // scan the encoding in reverse because we want the lowest-numbered
-+ // index for each char name ('space' is encoded twice)
-+ macRomanReverseMap = new NameToCharCode();
-+ for (i = 255; i >= 0; --i) {
-+ if (macRomanEncoding[i]) {
-+ macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i);
-+ }
-+ }
-+
-+#ifdef WIN32
-+ // baseDir will be set by a call to setBaseDir
-+ baseDir = new GString();
-+#else
-+ baseDir = appendToPath(getHomeDir(), ".xpdf");
-+#endif
-+ nameToUnicode = new NameToCharCode();
-+ cidToUnicodes = new GHash(gTrue);
-+ unicodeToUnicodes = new GHash(gTrue);
-+ residentUnicodeMaps = new GHash();
-+ unicodeMaps = new GHash(gTrue);
-+ cMapDirs = new GHash(gTrue);
-+ toUnicodeDirs = new GList();
-+ displayFonts = new GHash();
-+ displayCIDFonts = new GHash();
-+ displayNamedCIDFonts = new GHash();
-+#if HAVE_PAPER_H
-+ char *paperName;
-+ const struct paper *paperType;
-+ paperinit();
-+ if ((paperName = systempapername())) {
-+ paperType = paperinfo(paperName);
-+ psPaperWidth = (int)paperpswidth(paperType);
-+ psPaperHeight = (int)paperpsheight(paperType);
-+ } else {
-+ error(-1, "No paper information available - using defaults");
-+ psPaperWidth = defPaperWidth;
-+ psPaperHeight = defPaperHeight;
-+ }
-+ paperdone();
-+#else
-+ psPaperWidth = defPaperWidth;
-+ psPaperHeight = defPaperHeight;
-+#endif
-+ psImageableLLX = psImageableLLY = 0;
-+ psImageableURX = psPaperWidth;
-+ psImageableURY = psPaperHeight;
-+ psCrop = gTrue;
-+ psExpandSmaller = gFalse;
-+ psShrinkLarger = gTrue;
-+ psCenter = gTrue;
-+ psDuplex = gFalse;
-+ psLevel = psLevel2;
-+ psFile = NULL;
-+ psFonts = new GHash();
-+ psNamedFonts16 = new GList();
-+ psFonts16 = new GList();
-+ psEmbedType1 = gTrue;
-+ psEmbedTrueType = gTrue;
-+ psEmbedCIDPostScript = gTrue;
-+ psEmbedCIDTrueType = gTrue;
-+ psOPI = gFalse;
-+ psASCIIHex = gFalse;
-+ textEncoding = new GString("Latin1");
-+#if defined(WIN32)
-+ textEOL = eolDOS;
-+#elif defined(MACOS)
-+ textEOL = eolMac;
-+#else
-+ textEOL = eolUnix;
-+#endif
-+ textPageBreaks = gTrue;
-+ textKeepTinyChars = gFalse;
-+ fontDirs = new GList();
-+ initialZoom = new GString("125");
-+ continuousView = gFalse;
-+ enableT1lib = gTrue;
-+ enableFreeType = gTrue;
-+ antialias = gTrue;
-+ urlCommand = NULL;
-+ movieCommand = NULL;
-+ mapNumericCharNames = gTrue;
-+ printCommands = gFalse;
-+ errQuiet = gFalse;
-+
-+ cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
-+ unicodeToUnicodeCache =
-+ new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize);
-+ unicodeMapCache = new UnicodeMapCache();
-+ cMapCache = new CMapCache();
-+
-+#ifdef ENABLE_PLUGINS
-+ plugins = new GList();
-+ securityHandlers = new GList();
-+#endif
-+
-+ // set up the initial nameToUnicode table
-+ for (i = 0; nameToUnicodeTab[i].name; ++i) {
-+ nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u);
-+ }
-+
-+ // set up the residentUnicodeMaps table
-+ map = new UnicodeMap("Latin1", gFalse,
-+ latin1UnicodeMapRanges, latin1UnicodeMapLen);
-+ residentUnicodeMaps->add(map->getEncodingName(), map);
-+ map = new UnicodeMap("ASCII7", gFalse,
-+ ascii7UnicodeMapRanges, ascii7UnicodeMapLen);
-+ residentUnicodeMaps->add(map->getEncodingName(), map);
-+ map = new UnicodeMap("Symbol", gFalse,
-+ symbolUnicodeMapRanges, symbolUnicodeMapLen);
-+ residentUnicodeMaps->add(map->getEncodingName(), map);
-+ map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges,
-+ zapfDingbatsUnicodeMapLen);
-+ residentUnicodeMaps->add(map->getEncodingName(), map);
-+ map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
-+ residentUnicodeMaps->add(map->getEncodingName(), map);
-+ map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
-+ residentUnicodeMaps->add(map->getEncodingName(), map);
-+
-+}
-+
- GlobalParams::GlobalParams(char *cfgFileName) {
- UnicodeMap *map;
- GString *fileName;
-@@ -713,7 +847,9 @@
- movieCommand = NULL;
- mapNumericCharNames = gTrue;
- mapUnknownCharNames = gFalse;
-+#ifndef PDF_PARSER_ONLY
- createDefaultKeyBindings();
-+#endif
- printCommands = gFalse;
- errQuiet = gFalse;
-
-@@ -788,12 +924,15 @@
- }
- }
- if (f) {
-+#ifndef PDF_PARSER_ONLY
- parseFile(fileName, f);
-+#endif
- delete fileName;
- fclose(f);
- }
- }
-
-+#ifndef PDF_PARSER_ONLY
- void GlobalParams::createDefaultKeyBindings() {
- keyBindings = new GList();
-
-@@ -1120,6 +1259,7 @@
-
- deleteGList(tokens, GString);
- }
-+#endif
-
- void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
- int line) {
-@@ -1464,6 +1604,7 @@
- }
- }
-
-+#ifndef PDF_PARSER_ONLY
- void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) {
- KeyBinding *binding;
- GList *cmds;
-@@ -1649,6 +1790,7 @@
-
- return gTrue;
- }
-+#endif
-
- void GlobalParams::parseCommand(char *cmdName, GString **val,
- GList *tokens, GString *fileName, int line) {
-@@ -1792,7 +1934,9 @@
- if (movieCommand) {
- delete movieCommand;
- }
-+#ifndef PDF_PARSER_ONLY
- deleteGList(keyBindings, KeyBinding);
-+#endif
-
- cMapDirs->startIter(&iter);
- while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
-@@ -2443,6 +2587,7 @@
- return map;
- }
-
-+#ifndef PDF_PARSER_ONLY
- GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
- KeyBinding *binding;
- GList *cmds;
-@@ -2468,6 +2613,7 @@
- unlockGlobalParams;
- return cmds;
- }
-+#endif
-
- GBool GlobalParams::getPrintCommands() {
- GBool p;
-diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.h xpdf-3.02/xpdf/GlobalParams.h
---- xpdf-3.02.orig/xpdf/GlobalParams.h 2007-02-27 23:05:52.000000000 +0100
-+++ xpdf-3.02/xpdf/GlobalParams.h 2008-05-08 15:40:41.000000000 +0200
-@@ -5,6 +5,9 @@
- // Copyright 2001-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
-+// See top-level ChangeLog for a list of all modifications
-+//========================================================================
-
- #ifndef GLOBALPARAMS_H
- #define GLOBALPARAMS_H
-@@ -123,6 +126,7 @@
-
- //------------------------------------------------------------------------
-
-+#ifndef PDF_PARSER_ONLY
- class KeyBinding {
- public:
-
-@@ -186,6 +190,7 @@
- #define xpdfKeyContextMainWin (2 << 6)
- #define xpdfKeyContextScrLockOn (1 << 8)
- #define xpdfKeyContextScrLockOff (2 << 8)
-+#endif
-
- //------------------------------------------------------------------------
-
-@@ -196,12 +201,17 @@
- // file.
- GlobalParams(char *cfgFileName);
-
-+ // Initialize it without reading the config
-+ GlobalParams();
-+
- ~GlobalParams();
-
- void setBaseDir(char *dir);
- void setupBaseFonts(char *dir);
-
-+#ifndef PDF_PARSER_ONLY
- void parseLine(char *buf, GString *fileName, int line);
-+#endif
-
- //----- accessors
-
-@@ -256,7 +266,9 @@
- GString *getMovieCommand() { return movieCommand; }
- GBool getMapNumericCharNames();
- GBool getMapUnknownCharNames();
-+#ifndef PDF_PARSER_ONLY
- GList *getKeyBinding(int code, int mods, int context);
-+#endif
- GBool getPrintCommands();
- GBool getErrQuiet();
-
-@@ -315,7 +327,9 @@
-
- private:
-
-+#ifndef PDF_PARSER_ONLY
- void createDefaultKeyBindings();
-+#endif
- void parseFile(GString *fileName, FILE *f);
- void parseNameToUnicode(GList *tokens, GString *fileName, int line);
- void parseCIDToUnicode(GList *tokens, GString *fileName, int line);
-@@ -338,12 +352,14 @@
- void parseFontDir(GList *tokens, GString *fileName, int line);
- void parseInitialZoom(GList *tokens, GString *fileName, int line);
- void parseScreenType(GList *tokens, GString *fileName, int line);
-+#ifndef PDF_PARSER_ONLY
- void parseBind(GList *tokens, GString *fileName, int line);
- void parseUnbind(GList *tokens, GString *fileName, int line);
- GBool parseKey(GString *modKeyStr, GString *contextStr,
- int *code, int *mods, int *context,
- char *cmdName,
- GList *tokens, GString *fileName, int line);
-+#endif
- void parseCommand(char *cmdName, GString **val,
- GList *tokens, GString *fileName, int line);
- void parseYesNo(char *cmdName, GBool *flag,
-@@ -438,7 +454,9 @@
- GString *movieCommand; // command executed for movie annotations
- GBool mapNumericCharNames; // map numeric char names (from font subsets)?
- GBool mapUnknownCharNames; // map unknown char names?
-+#ifndef PDF_PARSER_ONLY
- GList *keyBindings; // key & mouse button bindings [KeyBinding]
-+#endif
- GBool printCommands; // print the drawing commands
- GBool errQuiet; // suppress error messages?
-
-diff -ur -N xpdf-3.02.orig/xpdf/Page.h xpdf-3.02/xpdf/Page.h
---- xpdf-3.02.orig/xpdf/Page.h 2007-02-27 23:05:52.000000000 +0100
-+++ xpdf-3.02/xpdf/Page.h 2008-05-08 15:40:41.000000000 +0200
-@@ -5,6 +5,9 @@
- // Copyright 1996-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
-+// See top-level ChangeLog for a list of all modifications
-+//========================================================================
-
- #ifndef PAGE_H
- #define PAGE_H
-@@ -170,9 +173,11 @@
-
- void processLinks(OutputDev *out, Catalog *catalog);
-
-+#ifndef PDF_PARSER_ONLY
- // Get the page's default CTM.
- void getDefaultCTM(double *ctm, double hDPI, double vDPI,
- int rotate, GBool useMediaBox, GBool upsideDown);
-+#endif
-
- private:
-
-diff -ur -N xpdf-3.02.orig/xpdf/XRef.cc xpdf-3.02/xpdf/XRef.cc
---- xpdf-3.02.orig/xpdf/XRef.cc 2007-02-27 23:05:52.000000000 +0100
-+++ xpdf-3.02/xpdf/XRef.cc 2008-05-08 15:40:41.000000000 +0200
-@@ -5,6 +5,9 @@
- // Copyright 1996-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
-+// See top-level ChangeLog for a list of all modifications
-+//========================================================================
-
- #include <aconf.h>
-
-@@ -45,34 +48,9 @@
- // ObjectStream
- //------------------------------------------------------------------------
-
--class ObjectStream {
--public:
--
-- // Create an object stream, using object number <objStrNum>,
-- // generation 0.
-- ObjectStream(XRef *xref, int objStrNumA);
--
-- ~ObjectStream();
--
-- // Return the object number of this object stream.
-- int getObjStrNum() { return objStrNum; }
--
-- // Get the <objIdx>th object from this stream, which should be
-- // object number <objNum>, generation 0.
-- Object *getObject(int objIdx, int objNum, Object *obj);
--
--private:
--
-- int objStrNum; // object number of the object stream
-- int nObjects; // number of objects in the stream
-- Object *objs; // the objects (length = nObjects)
-- int *objNums; // the object numbers (length = nObjects)
--};
--
- ObjectStream::ObjectStream(XRef *xref, int objStrNumA) {
- Stream *str;
- Parser *parser;
-- int *offsets;
- Object objStr, obj1, obj2;
- int first, i;
-
-@@ -80,6 +58,7 @@
- nObjects = 0;
- objs = NULL;
- objNums = NULL;
-+ offsets = NULL;
-
- if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) {
- goto err1;
-@@ -100,6 +79,7 @@
- goto err1;
- }
- first = obj1.getInt();
-+ firstOffset = objStr.getStream()->getBaseStream()->getStart() + first;
- obj1.free();
- if (first < 0) {
- goto err1;
-@@ -121,7 +101,7 @@
- obj1.free();
- obj2.free();
- delete parser;
-- gfree(offsets);
-+// gfree(offsets);
- goto err1;
- }
- objNums[i] = obj1.getInt();
-@@ -131,7 +111,7 @@
- if (objNums[i] < 0 || offsets[i] < 0 ||
- (i > 0 && offsets[i] < offsets[i-1])) {
- delete parser;
-- gfree(offsets);
-+// gfree(offsets);
- goto err1;
- }
- }
-@@ -160,7 +140,7 @@
- delete parser;
- }
-
-- gfree(offsets);
-+// gfree(offsets);
-
- err1:
- objStr.free();
-@@ -177,6 +157,7 @@
- delete[] objs;
- }
- gfree(objNums);
-+ gfree(offsets);
- }
-
- Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {
-diff -ur -N xpdf-3.02.orig/xpdf/XRef.h xpdf-3.02/xpdf/XRef.h
---- xpdf-3.02.orig/xpdf/XRef.h 2007-02-27 23:05:52.000000000 +0100
-+++ xpdf-3.02/xpdf/XRef.h 2008-05-08 15:40:41.000000000 +0200
-@@ -5,6 +5,9 @@
- // Copyright 1996-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
-+// See top-level ChangeLog for a list of all modifications
-+//========================================================================
-
- #ifndef XREF_H
- #define XREF_H
-@@ -21,7 +24,36 @@
- class Dict;
- class Stream;
- class Parser;
--class ObjectStream;
-+
-+class ObjectStream {
-+public:
-+
-+ // Create an object stream, using object number <objStrNum>,
-+ // generation 0.
-+ ObjectStream(XRef *xref, int objStrNumA);
-+
-+ ~ObjectStream();
-+
-+ // Return the object number of this object stream.
-+ int getObjStrNum() { return objStrNum; }
-+
-+ // Get the <objIdx>th object from this stream, which should be
-+ // object number <objNum>, generation 0.
-+ Object *getObject(int objIdx, int objNum, Object *obj);
-+
-+ int *getOffsets() { return offsets; }
-+ Guint getFirstOffset() { return firstOffset; }
-+
-+private:
-+
-+ int objStrNum; // object number of the object stream
-+ int nObjects; // number of objects in the stream
-+ Object *objs; // the objects (length = nObjects)
-+ int *objNums; // the object numbers (length = nObjects)
-+ int *offsets; // the object offsets (length = nObjects)
-+ Guint firstOffset;
-+};
-+
-
- //------------------------------------------------------------------------
- // XRef
-@@ -96,6 +128,7 @@
- int getSize() { return size; }
- XRefEntry *getEntry(int i) { return &entries[i]; }
- Object *getTrailerDict() { return &trailerDict; }
-+ ObjectStream *getObjStr() { return objStr; }
-
- private:
-
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-skip-reading-config-file b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-skip-reading-config-file
new file mode 100644
index 00000000000..c00527abb3b
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-skip-reading-config-file
@@ -0,0 +1,72 @@
+ Patches for pdfTeX / luaTeX / XeTeX
+
+ Declare GlobalParams constructor without config file argument
+ and skip reading a config file.
+
+ from:
+ Han The Thanh <thanh@pdftex.org>
+ Peter Breitenlohner <tex-live@tug.org>
+
+diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.cc xpdf-3.02/xpdf/GlobalParams.cc
+--- xpdf-3.02.orig/xpdf/GlobalParams.cc 2009-04-02 10:22:18.000000000 +0200
++++ xpdf-3.02/xpdf/GlobalParams.cc 2009-05-10 13:01:34.000000000 +0200
+@@ -608,10 +608,15 @@
+ // parsing
+ //------------------------------------------------------------------------
+
++#ifdef PDF_PARSER_ONLY
++GlobalParams::GlobalParams() {
++ UnicodeMap *map;
++#else
+ GlobalParams::GlobalParams(char *cfgFileName) {
+ UnicodeMap *map;
+ GString *fileName;
+ FILE *f;
++#endif
+ int i;
+
+ #if MULTITHREADED
+@@ -755,6 +760,7 @@
+ map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
+ residentUnicodeMaps->add(map->getEncodingName(), map);
+
++#ifndef PDF_PARSER_ONLY
+ // look for a user config file, then a system-wide config file
+ f = NULL;
+ fileName = NULL;
+@@ -792,6 +798,7 @@
+ delete fileName;
+ fclose(f);
+ }
++#endif /* !PDF_PARSER_ONLY */
+ }
+
+ void GlobalParams::createDefaultKeyBindings() {
+diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.h xpdf-3.02/xpdf/GlobalParams.h
+--- xpdf-3.02.orig/xpdf/GlobalParams.h 2007-02-27 23:05:52.000000000 +0100
++++ xpdf-3.02/xpdf/GlobalParams.h 2009-05-10 13:01:46.000000000 +0200
+@@ -5,6 +5,9 @@
+ // Copyright 2001-2003 Glyph & Cog, LLC
+ //
+ //========================================================================
++// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
++// See top-level ChangeLog for a list of all modifications
++//========================================================================
+
+ #ifndef GLOBALPARAMS_H
+ #define GLOBALPARAMS_H
+@@ -192,9 +195,14 @@
+ class GlobalParams {
+ public:
+
++#ifdef PDF_PARSER_ONLY
++ // Initialize the global parameters without reading a config file.
++ GlobalParams();
++#else
+ // Initialize the global parameters by attempting to read a config
+ // file.
+ GlobalParams(char *cfgFileName);
++#endif
+
+ ~GlobalParams();
+
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-22-exclude-openTempFile b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-22-exclude-openTempFile
new file mode 100644
index 00000000000..31dbce834a8
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-22-exclude-openTempFile
@@ -0,0 +1,24 @@
+ Patches for pdfTeX / luaTeX / XeTeX
+
+ from:
+ Han The Thanh <thanh@pdftex.org>
+
+diff -ur -N xpdf-3.02.orig/goo/gfile.cc xpdf-3.02/goo/gfile.cc
+--- xpdf-3.02.orig/goo/gfile.cc 2009-03-05 23:36:46.000000000 +0100
++++ xpdf-3.02/goo/gfile.cc 2009-05-08 21:14:18.000000000 +0200
+@@ -443,6 +443,7 @@
+ #endif
+ }
+
++#ifndef PDF_PARSER_ONLY
+ GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
+ #if defined(WIN32)
+ //---------- Win32 ----------
+@@ -551,6 +552,7 @@
+ return gTrue;
+ #endif
+ }
++#endif
+
+ GBool executeCommand(char *cmd) {
+ #ifdef VMS
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-23-exclude-keyBindings b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-23-exclude-keyBindings
new file mode 100644
index 00000000000..c1de3c7837c
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-23-exclude-keyBindings
@@ -0,0 +1,156 @@
+ Patches for pdfTeX / luaTeX / XeTeX
+
+ from:
+ Han The Thanh <thanh@pdftex.org>
+
+diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.cc xpdf-3.02/xpdf/GlobalParams.cc
+--- xpdf-3.02.orig/xpdf/GlobalParams.cc 2009-05-10 13:01:34.000000000 +0200
++++ xpdf-3.02/xpdf/GlobalParams.cc 2009-05-10 13:16:03.000000000 +0200
+@@ -429,6 +429,7 @@
+ }
+ }
+
++#ifndef PDF_PARSER_ONLY
+ //------------------------------------------------------------------------
+ // KeyBinding
+ //------------------------------------------------------------------------
+@@ -461,6 +462,7 @@
+ KeyBinding::~KeyBinding() {
+ deleteGList(cmds, GString);
+ }
++#endif /* !PDF_PARSER_ONLY */
+
+ #ifdef ENABLE_PLUGINS
+ //------------------------------------------------------------------------
+@@ -718,7 +720,9 @@
+ movieCommand = NULL;
+ mapNumericCharNames = gTrue;
+ mapUnknownCharNames = gFalse;
++#ifndef PDF_PARSER_ONLY
+ createDefaultKeyBindings();
++#endif
+ printCommands = gFalse;
+ errQuiet = gFalse;
+
+@@ -801,6 +805,7 @@
+ #endif /* !PDF_PARSER_ONLY */
+ }
+
++#ifndef PDF_PARSER_ONLY
+ void GlobalParams::createDefaultKeyBindings() {
+ keyBindings = new GList();
+
+@@ -1127,6 +1132,7 @@
+
+ deleteGList(tokens, GString);
+ }
++#endif /* !PDF_PARSER_ONLY */
+
+ void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
+ int line) {
+@@ -1471,6 +1477,7 @@
+ }
+ }
+
++#ifndef PDF_PARSER_ONLY
+ void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) {
+ KeyBinding *binding;
+ GList *cmds;
+@@ -1656,6 +1663,7 @@
+
+ return gTrue;
+ }
++#endif /* !PDF_PARSER_ONLY */
+
+ void GlobalParams::parseCommand(char *cmdName, GString **val,
+ GList *tokens, GString *fileName, int line) {
+@@ -1799,7 +1807,9 @@
+ if (movieCommand) {
+ delete movieCommand;
+ }
++#ifndef PDF_PARSER_ONLY
+ deleteGList(keyBindings, KeyBinding);
++#endif
+
+ cMapDirs->startIter(&iter);
+ while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
+@@ -2450,6 +2460,7 @@
+ return map;
+ }
+
++#ifndef PDF_PARSER_ONLY
+ GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
+ KeyBinding *binding;
+ GList *cmds;
+@@ -2475,6 +2486,7 @@
+ unlockGlobalParams;
+ return cmds;
+ }
++#endif /* !PDF_PARSER_ONLY */
+
+ GBool GlobalParams::getPrintCommands() {
+ GBool p;
+diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.h xpdf-3.02/xpdf/GlobalParams.h
+--- xpdf-3.02.orig/xpdf/GlobalParams.h 2009-05-10 13:01:46.000000000 +0200
++++ xpdf-3.02/xpdf/GlobalParams.h 2009-05-10 13:16:03.000000000 +0200
+@@ -126,6 +126,7 @@
+
+ //------------------------------------------------------------------------
+
++#ifndef PDF_PARSER_ONLY
+ class KeyBinding {
+ public:
+
+@@ -189,6 +190,7 @@
+ #define xpdfKeyContextMainWin (2 << 6)
+ #define xpdfKeyContextScrLockOn (1 << 8)
+ #define xpdfKeyContextScrLockOff (2 << 8)
++#endif /* !PDF_PARSER_ONLY */
+
+ //------------------------------------------------------------------------
+
+@@ -264,7 +266,9 @@
+ GString *getMovieCommand() { return movieCommand; }
+ GBool getMapNumericCharNames();
+ GBool getMapUnknownCharNames();
++#ifndef PDF_PARSER_ONLY
+ GList *getKeyBinding(int code, int mods, int context);
++#endif
+ GBool getPrintCommands();
+ GBool getErrQuiet();
+
+@@ -323,7 +327,9 @@
+
+ private:
+
++#ifndef PDF_PARSER_ONLY
+ void createDefaultKeyBindings();
++#endif
+ void parseFile(GString *fileName, FILE *f);
+ void parseNameToUnicode(GList *tokens, GString *fileName, int line);
+ void parseCIDToUnicode(GList *tokens, GString *fileName, int line);
+@@ -346,12 +352,14 @@
+ void parseFontDir(GList *tokens, GString *fileName, int line);
+ void parseInitialZoom(GList *tokens, GString *fileName, int line);
+ void parseScreenType(GList *tokens, GString *fileName, int line);
++#ifndef PDF_PARSER_ONLY
+ void parseBind(GList *tokens, GString *fileName, int line);
+ void parseUnbind(GList *tokens, GString *fileName, int line);
+ GBool parseKey(GString *modKeyStr, GString *contextStr,
+ int *code, int *mods, int *context,
+ char *cmdName,
+ GList *tokens, GString *fileName, int line);
++#endif
+ void parseCommand(char *cmdName, GString **val,
+ GList *tokens, GString *fileName, int line);
+ void parseYesNo(char *cmdName, GBool *flag,
+@@ -446,7 +454,9 @@
+ GString *movieCommand; // command executed for movie annotations
+ GBool mapNumericCharNames; // map numeric char names (from font subsets)?
+ GBool mapUnknownCharNames; // map unknown char names?
++#ifndef PDF_PARSER_ONLY
+ GList *keyBindings; // key & mouse button bindings [KeyBinding]
++#endif
+ GBool printCommands; // print the drawing commands
+ GBool errQuiet; // suppress error messages?
+
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-40-objectStream-support-for-pdftosrc b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-40-objectStream-support-for-pdftosrc
new file mode 100644
index 00000000000..03d11926eaa
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-40-objectStream-support-for-pdftosrc
@@ -0,0 +1,165 @@
+ Patches for pdfTeX / luaTeX / XeTeX
+
+ Object stream support for pdftosrc
+
+ from:
+ Han The Thanh <thanh@pdftex.org>
+
+diff -ur -N xpdf-3.02.orig/xpdf/XRef.cc xpdf-3.02/xpdf/XRef.cc
+--- xpdf-3.02.orig/xpdf/XRef.cc 2007-02-27 23:05:52.000000000 +0100
++++ xpdf-3.02/xpdf/XRef.cc 2009-05-08 21:39:44.000000000 +0200
+@@ -5,6 +5,9 @@
+ // Copyright 1996-2003 Glyph & Cog, LLC
+ //
+ //========================================================================
++// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
++// See top-level ChangeLog for a list of all modifications
++//========================================================================
+
+ #include <aconf.h>
+
+@@ -45,34 +48,9 @@
+ // ObjectStream
+ //------------------------------------------------------------------------
+
+-class ObjectStream {
+-public:
+-
+- // Create an object stream, using object number <objStrNum>,
+- // generation 0.
+- ObjectStream(XRef *xref, int objStrNumA);
+-
+- ~ObjectStream();
+-
+- // Return the object number of this object stream.
+- int getObjStrNum() { return objStrNum; }
+-
+- // Get the <objIdx>th object from this stream, which should be
+- // object number <objNum>, generation 0.
+- Object *getObject(int objIdx, int objNum, Object *obj);
+-
+-private:
+-
+- int objStrNum; // object number of the object stream
+- int nObjects; // number of objects in the stream
+- Object *objs; // the objects (length = nObjects)
+- int *objNums; // the object numbers (length = nObjects)
+-};
+-
+ ObjectStream::ObjectStream(XRef *xref, int objStrNumA) {
+ Stream *str;
+ Parser *parser;
+- int *offsets;
+ Object objStr, obj1, obj2;
+ int first, i;
+
+@@ -80,6 +58,7 @@
+ nObjects = 0;
+ objs = NULL;
+ objNums = NULL;
++ offsets = NULL;
+
+ if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) {
+ goto err1;
+@@ -100,6 +79,7 @@
+ goto err1;
+ }
+ first = obj1.getInt();
++ firstOffset = objStr.getStream()->getBaseStream()->getStart() + first;
+ obj1.free();
+ if (first < 0) {
+ goto err1;
+@@ -121,7 +101,7 @@
+ obj1.free();
+ obj2.free();
+ delete parser;
+- gfree(offsets);
++// gfree(offsets);
+ goto err1;
+ }
+ objNums[i] = obj1.getInt();
+@@ -131,7 +111,7 @@
+ if (objNums[i] < 0 || offsets[i] < 0 ||
+ (i > 0 && offsets[i] < offsets[i-1])) {
+ delete parser;
+- gfree(offsets);
++// gfree(offsets);
+ goto err1;
+ }
+ }
+@@ -160,7 +140,7 @@
+ delete parser;
+ }
+
+- gfree(offsets);
++// gfree(offsets);
+
+ err1:
+ objStr.free();
+@@ -177,6 +157,7 @@
+ delete[] objs;
+ }
+ gfree(objNums);
++ gfree(offsets);
+ }
+
+ Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {
+diff -ur -N xpdf-3.02.orig/xpdf/XRef.h xpdf-3.02/xpdf/XRef.h
+--- xpdf-3.02.orig/xpdf/XRef.h 2007-02-27 23:05:52.000000000 +0100
++++ xpdf-3.02/xpdf/XRef.h 2009-05-08 21:39:41.000000000 +0200
+@@ -5,6 +5,9 @@
+ // Copyright 1996-2003 Glyph & Cog, LLC
+ //
+ //========================================================================
++// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
++// See top-level ChangeLog for a list of all modifications
++//========================================================================
+
+ #ifndef XREF_H
+ #define XREF_H
+@@ -21,7 +24,36 @@
+ class Dict;
+ class Stream;
+ class Parser;
+-class ObjectStream;
++
++class ObjectStream {
++public:
++
++ // Create an object stream, using object number <objStrNum>,
++ // generation 0.
++ ObjectStream(XRef *xref, int objStrNumA);
++
++ ~ObjectStream();
++
++ // Return the object number of this object stream.
++ int getObjStrNum() { return objStrNum; }
++
++ // Get the <objIdx>th object from this stream, which should be
++ // object number <objNum>, generation 0.
++ Object *getObject(int objIdx, int objNum, Object *obj);
++
++ int *getOffsets() { return offsets; }
++ Guint getFirstOffset() { return firstOffset; }
++
++private:
++
++ int objStrNum; // object number of the object stream
++ int nObjects; // number of objects in the stream
++ Object *objs; // the objects (length = nObjects)
++ int *objNums; // the object numbers (length = nObjects)
++ int *offsets; // the object offsets (length = nObjects)
++ Guint firstOffset;
++};
++
+
+ //------------------------------------------------------------------------
+ // XRef
+@@ -96,6 +128,7 @@
+ int getSize() { return size; }
+ XRefEntry *getEntry(int i) { return &entries[i]; }
+ Object *getTrailerDict() { return &trailerDict; }
++ ObjectStream *getObjStr() { return objStr; }
+
+ private:
+