diff -ru ./xpdf/GlobalParams.cc /home/ports/xpdf-3.03-patched/xpdf/GlobalParams.cc --- ./xpdf/GlobalParams.cc 2014-12-18 17:18:04.014778623 +0100 +++ /home/ports/xpdf-3.03-patched/xpdf/GlobalParams.cc 2014-11-30 18:16:58.400255215 +0100 @@ -634,7 +634,7 @@ #endif initBuiltinFontTables(); - +#if 0 // scan the encoding in reverse because we want the lowest-numbered // index for each char name ('space' is encoded twice) macRomanReverseMap = new NameToCharCode(); @@ -643,7 +643,8 @@ macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i); } } - +#endif + #ifdef WIN32 // baseDir will be set by a call to setBaseDir baseDir = new GString(); @@ -774,7 +775,7 @@ residentUnicodeMaps->add(map->getEncodingName(), map); map = new UnicodeMap("UCS-2", gTrue, &mapUCS2); residentUnicodeMaps->add(map->getEncodingName(), map); - + return; // look for a user config file, then a system-wide config file f = NULL; fileName = NULL; diff -ru ./xpdf/NameToCharCode.cc /home/ports/xpdf-3.03-patched/xpdf/NameToCharCode.cc --- ./xpdf/NameToCharCode.cc 2011-08-15 23:08:53.000000000 +0200 +++ /home/ports/xpdf-3.03-patched/xpdf/NameToCharCode.cc 2014-11-30 18:16:58.149255227 +0100 @@ -50,7 +50,7 @@ void NameToCharCode::add(const char *name, CharCode c) { NameToCharCodeEntry *oldTab; int h, i, oldSize; - + return; // expand the table if necessary if (len >= size / 2) { oldSize = size; diff -ru ./xpdf/XPDFApp.cc /home/ports/xpdf-3.03-patched/xpdf/XPDFApp.cc --- ./xpdf/XPDFApp.cc 2011-08-15 23:08:53.000000000 +0200 +++ /home/ports/xpdf-3.03-patched/xpdf/XPDFApp.cc 2014-11-30 18:16:58.386256787 +0100 @@ -125,6 +125,7 @@ #endif XPDFApp::XPDFApp(int *argc, char *argv[]) { +#if 0 appShell = XtAppInitialize(&appContext, xpdfAppName, xOpts, nXOpts, argc, argv, fallbackResources, NULL, 0); display = XtDisplay(appShell); @@ -147,14 +148,15 @@ XSynchronize(display, True); XSetErrorHandler(&xErrorHandler); #endif +#endif fullScreen = gFalse; remoteAtom = None; remoteViewer = NULL; remoteWin = None; - +#if 0 getResources(); - +#endif viewers = new GList(); } diff -ru ./xpdf/XPDFCore.cc /home/ports/xpdf-3.03-patched/xpdf/XPDFCore.cc --- ./xpdf/XPDFCore.cc 2011-08-15 23:08:53.000000000 +0200 +++ /home/ports/xpdf-3.03-patched/xpdf/XPDFCore.cc 2014-11-30 18:16:58.382256209 +0100 @@ -91,6 +91,12 @@ { GString *initialZoom; + new PDFDoc(new GString("./fuzzed.pdf"), NULL, NULL, + this); +exit(1); +/* + exit(!!XPDFCore::loadFile(new GString("./fuzzed.pdf"), NULL, NULL)); +*/ shell = shellA; parentWidget = parentWidgetA; display = XtDisplay(parentWidget); diff -ru ./xpdf/XPDFViewer.cc /home/ports/xpdf-3.03-patched/xpdf/XPDFViewer.cc --- ./xpdf/XPDFViewer.cc 2014-12-18 17:18:04.048777218 +0100 +++ /home/ports/xpdf-3.03-patched/xpdf/XPDFViewer.cc 2014-11-30 18:16:58.386256787 +0100 @@ -262,9 +262,11 @@ // do Motif-specific initialization and create the window; // this also creates the core object initWindow(fullScreen); +#if 0 initAboutDialog(); initFindDialog(); initPrintDialog(); +#endif openDialog = NULL; saveAsDialog = NULL; @@ -439,7 +441,7 @@ GBool XPDFViewer::loadFile(GString *fileName, GString *ownerPassword, GString *userPassword) { - return core->loadFile(fileName, ownerPassword, userPassword) == errNone; + exit (core->loadFile(fileName, ownerPassword, userPassword) == errNone); } void XPDFViewer::reloadFile() { @@ -1482,6 +1484,8 @@ int n; char *title; + initCore(win, gTrue); + return; display = XtDisplay(app->getAppShell()); screenNum = XScreenNumberOfScreen(XtScreen(app->getAppShell())); diff -ru ./xpdf/xpdf.cc /home/ports/xpdf-3.03-patched/xpdf/xpdf.cc --- ./xpdf/xpdf.cc 2011-08-15 23:08:53.000000000 +0200 +++ /home/ports/xpdf-3.03-patched/xpdf/xpdf.cc 2014-11-30 18:16:58.405254942 +0100 @@ -16,6 +16,7 @@ #include "Object.h" #include "XPDFApp.h" #include "config.h" +#include "XPDFCore.h" //------------------------------------------------------------------------ // command line options @@ -152,9 +153,9 @@ exitCode = 99; goto done0; } - // read config file globalParams = new GlobalParams(cfgFileName); +#if 0 globalParams->setupBaseFonts(NULL); if (contView) { globalParams->setContinuousView(contView); @@ -211,10 +212,13 @@ if (quiet) { globalParams->setErrQuiet(quiet); } - +#endif + // create the XPDFApp object app = new XPDFApp(&argc, argv); +#if 0 + // the initialZoom parameter can be set in either the config file or // as an X resource (or command line arg) if (app->getInitialZoom()) { @@ -293,13 +297,34 @@ // set options app->setFullScreen(fullScreen); - +#endif // check for password string(s) ownerPasswordStr = ownerPassword[0] != '\001' ? new GString(ownerPassword) : (GString *)NULL; userPasswordStr = userPassword[0] != '\001' ? new GString(userPassword) : (GString *)NULL; +#if 0 + /* + PDFCore *core; + + core = new PDFCore(SplashColorMode colorModeA, int bitmapRowPadA, + GBool reverseVideoA, SplashColorPtr paperColorA, + GBool incrementalUpdate); + */ + XPDFCore *core; + + core = new XPDFCore(NULL, NULL, + NULL, NULL, + NULL, + NULL, NULL, + NULL, NULL); + + if (destName) { + exit(core::loadFile(fileName, ownerPassword, userPasswordStr)); + } +#endif + exit(!!app->openAtDest(fileName, destName, ownerPasswordStr, userPasswordStr)); // open the file and run the main loop if (destName) { if (!app->openAtDest(fileName, destName,