Package: xpdf
Version: 3.04-9
Severity: wishlist
Tags: patch moreinfo
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu disco ubuntu-patch

Hi,

Here's the patch I came up for in Ubuntu, where we've switched to
poppler 0.71 (libpopler82 ABI). This isn't in Debian yet, but it will
presumably be at some point and you might find this useful then.

Cheers,

-- 
Iain Lane                                  [ i...@orangesquash.org.uk ]
Debian Developer                                   [ la...@debian.org ]
Ubuntu Developer                                   [ la...@ubuntu.com ]
diff -Nru xpdf-3.04/debian/control xpdf-3.04/debian/control
--- xpdf-3.04/debian/control    2018-11-26 06:02:49.000000000 +0000
+++ xpdf-3.04/debian/control    2018-12-04 17:35:33.000000000 +0000
@@ -1,8 +1,7 @@
 Source: xpdf
 Section: text
 Priority: optional
-Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
-XSBC-Original-Maintainer: Debian QA Group <packa...@qa.debian.org>
+Maintainer: Debian QA Group <packa...@qa.debian.org>
 Standards-Version: 4.1.3
 Build-Depends:
  debhelper (>= 9),
diff -Nru xpdf-3.04/debian/patches/poppler-0.71.patch 
xpdf-3.04/debian/patches/poppler-0.71.patch
--- xpdf-3.04/debian/patches/poppler-0.71.patch 1970-01-01 01:00:00.000000000 
+0100
+++ xpdf-3.04/debian/patches/poppler-0.71.patch 2018-12-04 17:35:33.000000000 
+0000
@@ -0,0 +1,1072 @@
+Description: poppler 0.71 removed several functions we rely on; update 
accordingly
+Author: Iain Lane <iain.l...@canonical.com>
+Bug-Debian: -1
+
+Index: b/xpdf/PDFCore.cc
+===================================================================
+--- a/xpdf/PDFCore.cc
++++ b/xpdf/PDFCore.cc
+@@ -144,7 +144,7 @@
+   delete out;
+ }
+ 
+-int PDFCore::loadFile(GString *fileName, GString *ownerPassword,
++int PDFCore::loadFile(const GString *fileName, GString *ownerPassword,
+                     GString *userPassword) {
+   int err;
+ 
+@@ -208,9 +208,7 @@
+   // nothing displayed yet
+   topPage = -99;
+   midPage = -99;
+-  while (pages->getLength() > 0) {
+-    delete (PDFCorePage *)pages->del(0);
+-  }
++  pages->clear();
+ 
+   // compute the max unscaled page size
+   maxUnscaledPageW = maxUnscaledPageH = 0;
+@@ -244,9 +242,7 @@
+   // no page displayed
+   topPage = -99;
+   midPage = -99;
+-  while (pages->getLength() > 0) {
+-    delete (PDFCorePage *)pages->del(0);
+-  }
++  pages->clear();
+ 
+   // redraw
+   scrollX = scrollY = 0;
+@@ -269,9 +265,7 @@
+   // no page displayed
+   topPage = -99;
+   midPage = -99;
+-  while (pages->getLength() > 0) {
+-    delete (PDFCorePage *)pages->del(0);
+-  }
++  pages->clear();
+ 
+   // redraw
+   scrollX = scrollY = 0;
+@@ -491,9 +485,7 @@
+       rotateA != rotate) {
+     needUpdate = gTrue;
+     setSelection(0, 0, 0, 0, 0);
+-    while (pages->getLength() > 0) {
+-      delete (PDFCorePage *)pages->del(0);
+-    }
++    pages->clear();
+     zoom = zoomA;
+     rotate = rotateA;
+     dpi = dpiA;
+@@ -613,14 +605,21 @@
+ 
+     // delete pages that are no longer needed and insert new pages
+     // objects that are needed
+-    while (pages->getLength() > 0 &&
+-         ((PDFCorePage *)pages->get(0))->page < pg0) {
+-      delete (PDFCorePage *)pages->del(0);
+-    }
+-    i = pages->getLength() - 1;
+-    while (i > 0 && ((PDFCorePage *)pages->get(i))->page > pg1) {
+-      delete (PDFCorePage *)pages->del(i--);
++    for (auto it = pages->begin(); it != pages->end();) {
++      auto page = static_cast<PDFCorePage *> (*it);
++      if (page->page >= pg0)
++        break;
++      it = pages->erase(it);
+     }
++
++    for (auto it = pages->rbegin(); it != pages->rend();) {
++      auto page = static_cast<PDFCorePage *> (*it);
++      if (page->page <= pg1)
++        break;
++
++      it = decltype(it){ pages->erase(std::next(it).base()) };
++    }
++
+     j = pages->getLength() > 0 ? ((PDFCorePage *)pages->get(0))->page - 1
+                                : pg1;
+     for (i = pg0; i <= j; ++i) {
+@@ -648,11 +647,11 @@
+   }
+ 
+   // delete tiles that are no longer needed
+-  for (i = 0; i < pages->getLength(); ++i) {
+-    page = (PDFCorePage *)pages->get(i);
++  for (auto it = pages->begin(); it != pages->end(); it++) {
++    page = static_cast<PDFCorePage *> (*it);
+     j = 0;
+-    while (j < page->tiles->getLength()) {
+-      tile = (PDFCoreTile *)page->tiles->get(j);
++    for (auto itt = page->tiles->begin(); itt != page->tiles->end();) {
++      tile = static_cast<PDFCoreTile *> (*itt);
+       if (continuousMode) {
+       y0 = pageY[page->page - 1] + tile->yMin;
+       y1 = pageY[page->page - 1] + tile->yMax;
+@@ -664,9 +663,9 @@
+         tile->xMin > scrollX + drawAreaWidth + drawAreaWidth / 2 ||
+         y1 < scrollY - drawAreaHeight / 2 ||
+         y0 > scrollY + drawAreaHeight + drawAreaHeight / 2) {
+-      delete (PDFCoreTile *)page->tiles->del(j);
++        itt = page->tiles->erase(itt);
+       } else {
+-      ++j;
++        itt++;
+       }
+     }
+   }
+@@ -831,10 +830,16 @@
+     tileH = h ? h : 1;
+   }
+   page = new PDFCorePage(pg, w, h, tileW, tileH);
+-  for (i = 0;
+-       i < pages->getLength() && pg > ((PDFCorePage *)pages->get(i))->page;
+-       ++i) ;
+-  pages->insert(i, page);
++
++  for (auto it = pages->begin(); it != pages->end(); it++) {
++    auto curpage = static_cast<PDFCorePage *> (*it);
++    if (pg <= curpage->page) {
++      pages->insert(it, page);
++      return;
++    }
++  }
++
++  pages->insert(pages->begin(), page);
+ }
+ 
+ void PDFCore::needTile(PDFCorePage *page, int x, int y) {
+@@ -932,7 +937,7 @@
+       delete textOut;
+     }
+   }
+-  page->tiles->append(tile);
++  page->tiles->push_back(tile);
+   curTile = NULL;
+   curPage = NULL;
+ 
+Index: b/xpdf/XPDFCore.h
+===================================================================
+--- a/xpdf/XPDFCore.h
++++ b/xpdf/XPDFCore.h
+@@ -36,11 +36,11 @@
+ // callbacks
+ //------------------------------------------------------------------------
+ 
+-typedef void (*XPDFUpdateCbk)(void *data, GString *fileName,
++typedef void (*XPDFUpdateCbk)(void *data, const GString *fileName,
+                             int pageNum, int numPages,
+                             const char *linkLabel);
+ 
+-typedef void (*XPDFActionCbk)(void *data, char *action);
++typedef void (*XPDFActionCbk)(void *data, const char *action);
+ 
+ typedef void (*XPDFKeyPressCbk)(void *data, KeySym key, Guint modifiers,
+                               XEvent *event);
+@@ -65,7 +65,7 @@
+   //----- loadFile / displayPage / displayDest
+ 
+   // Load a new file.  Returns pdfOk or error code.
+-  virtual int loadFile(GString *fileName, GString *ownerPassword = NULL,
++  virtual int loadFile(const GString *fileName, GString *ownerPassword = NULL,
+                      GString *userPassword = NULL);
+ 
+   // Load a new file, via a Stream instead of a file name.  Returns
+Index: b/xpdf/XPDFCore.cc
+===================================================================
+--- a/xpdf/XPDFCore.cc
++++ b/xpdf/XPDFCore.cc
+@@ -35,6 +35,7 @@
+ #include "SplashPattern.h"
+ #include "XPDFApp.h"
+ #include "XPDFCore.h"
++#include "xfile.h"
+ 
+ // these macro defns conflict with xpdf's Object class
+ #ifdef LESSTIF_VERSION
+@@ -184,7 +185,7 @@
+ // loadFile / displayPage / displayDest
+ //------------------------------------------------------------------------
+ 
+-int XPDFCore::loadFile(GString *fileName, GString *ownerPassword,
++int XPDFCore::loadFile(const GString *fileName, GString *ownerPassword,
+                      GString *userPassword) {
+   int err;
+ 
+@@ -475,14 +476,14 @@
+              && (*target == XA_STRING
+                  || *target == textAtom
+                  || *target == compoundtextAtom)) {
+-    char *str = currentSelection->getCString();
++    const char *str = currentSelection->getCString();
+     XICCEncodingStyle style
+       = (*target == XA_STRING  ? XStringStyle
+          : *target == textAtom ? XStdICCTextStyle
+          :                       XCompoundTextStyle);
+     XTextProperty t;
+     int ret = Xutf8TextListToTextProperty(XtDisplay(widget),
+-                                          &str,1, style, &t);
++                                          (char **) &str,1, style, &t);
+     if (ret < 0) {
+       error(errInternal, -1 , "cannot form text property, error {0:d}", ret);
+       return False;
+@@ -528,7 +529,7 @@
+   LinkActionKind kind;
+   LinkDest *dest;
+   GString *namedDest;
+-  char *s;
++  const char *s;
+   GString *fileName, *fileName2;
+   GString *cmd;
+   GString *actionName;
+@@ -558,7 +559,7 @@
+       } else if ((namedDest = (GString*) ((LinkGoToR 
*)action)->getNamedDest())) {
+       namedDest = namedDest->copy();
+       }
+-      s = (char*) ((LinkGoToR *)action)->getFileName()->getCString();
++      s = (const char*) ((LinkGoToR *)action)->getFileName()->getCString();
+       //~ translate path name for VMS (deal with '/')
+       if (isAbsolutePath(s) || !doc->getFileName()) {
+       fileName = new GString(s);
+@@ -755,7 +756,7 @@
+ // <arg> string to insert in place of the '%s'.
+ void XPDFCore::runCommand(GString *cmdFmt, GString *arg) {
+   GString *cmd;
+-  char *s;
++  const char *s;
+   int errcode;
+ 
+   if ((s = strstr(cmdFmt->getCString(), "%s"))) {
+@@ -1540,9 +1541,8 @@
+   XtSetArg(args[n], XmNdialogStyle, XmDIALOG_PRIMARY_APPLICATION_MODAL); ++n;
+   s1 = XmStringCreateLocalized((char *)title);
+   XtSetArg(args[n], XmNdialogTitle, s1); ++n;
+-  s2 = NULL; // make gcc happy
+   if (msg->getLength() <= 80) {
+-    s2 = XmStringCreateLocalized(msg->getCString());
++    s2 = XmStringCreateLocalized((char *) msg->getCString());
+     XtSetArg(args[n], XmNmessageString, s2); ++n;
+   }
+   dialog = XmCreateMessageDialog(drawArea, "questionDialog", args, n);
+Index: b/xpdf/PDFCore.h
+===================================================================
+--- a/xpdf/PDFCore.h
++++ b/xpdf/PDFCore.h
+@@ -127,7 +127,7 @@
+   //----- loadFile / displayPage / displayDest
+ 
+   // Load a new file.  Returns pdfOk or error code.
+-  virtual int loadFile(GString *fileName, GString *ownerPassword = NULL,
++  virtual int loadFile(const GString *fileName, GString *ownerPassword = NULL,
+                      GString *userPassword = NULL);
+ 
+ #ifdef _WIN32
+Index: b/xpdf/XPDFApp.cc
+===================================================================
+--- a/xpdf/XPDFApp.cc
++++ b/xpdf/XPDFApp.cc
+@@ -220,7 +220,7 @@
+   }
+ }
+ 
+-XPDFViewer *XPDFApp::open(GString *fileName, int page,
++XPDFViewer *XPDFApp::open(const GString *fileName, int page,
+                         GString *ownerPassword, GString *userPassword) {
+   XPDFViewer *viewer;
+ 
+@@ -237,7 +237,7 @@
+                     &remoteMsgCbk, this);
+     XSetSelectionOwner(display, remoteAtom, XtWindow(remoteWin), CurrentTime);
+   }
+-  viewers->append(viewer);
++  viewers->push_back(viewer);
+   return viewer;
+ }
+ 
+@@ -259,7 +259,7 @@
+                     &remoteMsgCbk, this);
+     XSetSelectionOwner(display, remoteAtom, XtWindow(remoteWin), CurrentTime);
+   }
+-  viewers->append(viewer);
++  viewers->push_back(viewer);
+   return viewer;
+ }
+ 
+@@ -267,12 +267,8 @@
+                           GBool fullScreenA) {
+   int i;
+ 
+-  for (i = 0; i < viewers->getLength(); ++i) {
+-    if (((XPDFViewer *)viewers->get(i)) == viewer) {
+-      viewers->del(i);
+-      delete viewer;
+-    }
+-  }
++  viewers->erase(std::remove(viewers->begin(), viewers->end(), viewer), 
viewers->end());
++
+   viewer = new XPDFViewer(this, doc, page, NULL, fullScreenA);
+   if (!viewer->isOk()) {
+     delete viewer;
+@@ -285,7 +281,7 @@
+                     &remoteMsgCbk, this);
+     XSetSelectionOwner(display, remoteAtom, XtWindow(remoteWin), CurrentTime);
+   }
+-  viewers->append(viewer);
++  viewers->push_back(viewer);
+   return viewer;
+ }
+ 
+@@ -304,7 +300,7 @@
+   } else {
+     for (i = 0; i < viewers->getLength(); ++i) {
+       if (((XPDFViewer *)viewers->get(i)) == viewer) {
+-      viewers->del(i);
++        viewers->erase(viewers->begin() + i);
+       if (remoteAtom != None && remoteViewer == viewer) {
+         remoteViewer = (XPDFViewer *)viewers->get(viewers->getLength() - 1);
+         remoteWin = remoteViewer->getWindow();
+@@ -322,9 +318,7 @@
+   if (remoteAtom != None) {
+     XSetSelectionOwner(display, remoteAtom, None, CurrentTime);
+   }
+-  while (viewers->getLength() > 0) {
+-    delete (XPDFViewer *)viewers->del(0);
+-  }
++  viewers->clear();
+ #if HAVE_XTAPPSETEXITFLAG
+   XtAppSetExitFlag(appContext);
+ #else
+Index: b/goo/gfile.h
+===================================================================
+--- a/goo/gfile.h
++++ b/goo/gfile.h
+@@ -68,24 +68,24 @@
+ // string, denoting the current directory).  Returns <path>.
+ extern GString *appendToPath(GString *path, const char *fileName);
+ 
++*/
++
+ // Grab the path from the front of the file name.  If there is no
+ // directory component in <fileName>, returns an empty string.
+-extern GString *grabPath(char *fileName);
++extern GString *grabPath(const char *fileName);
+ 
+ // Is this an absolute path or file name?
+-extern GBool isAbsolutePath(char *path);
+-
+-*/
++extern GBool isAbsolutePath(const char *path);
+ 
+ // Make this path absolute by prepending current directory (if path is
+ // relative) or prepending user's directory (if path starts with '~').
+ extern GString *makePathAbsolute(GString *path);
+ 
+-/*
+-
+ // Get the modification time for <fileName>.  Returns 0 if there is an
+ // error.
+-extern time_t getModTime(char *fileName);
++time_t getModTime(const char *fileName);
++
++/*
+ 
+ // Create a temporary file and open it for writing.  If <ext> is not
+ // NULL, it will be used as the file name extension.  Returns both the
+Index: b/goo/gfile.cc
+===================================================================
+--- a/goo/gfile.cc
++++ b/goo/gfile.cc
+@@ -275,7 +275,9 @@
+ #endif
+ }
+ 
+-GString *grabPath(char *fileName) {
++*/
++
++GString *grabPath(const char *fileName) {
+ #ifdef VMS
+   //---------- VMS ----------
+   char *p;
+@@ -316,7 +318,7 @@
+ 
+ #else
+   //---------- Unix ----------
+-  char *p;
++  const char *p;
+ 
+   if ((p = strrchr(fileName, '/')))
+     return new GString(fileName, p - fileName);
+@@ -324,7 +326,7 @@
+ #endif
+ }
+ 
+-GBool isAbsolutePath(char *path) {
++GBool isAbsolutePath(const char *path) {
+ #ifdef VMS
+   //---------- VMS ----------
+   return strchr(path, ':') ||
+@@ -348,8 +350,6 @@
+ #endif
+ }
+ 
+-*/
+-
+ GString *makePathAbsolute(GString *path) {
+ #ifdef VMS
+   //---------- VMS ----------
+@@ -391,7 +391,7 @@
+   struct passwd *pw;
+   char buf[PATH_MAX+1];
+   GString *s;
+-  char *p1, *p2;
++  const char *p1, *p2;
+   int n;
+ 
+   if (path->getChar(0) == '~') {
+@@ -432,9 +432,7 @@
+ #endif
+ }
+ 
+-/*
+-
+-time_t getModTime(char *fileName) {
++time_t getModTime(const char *fileName) {
+ #ifdef _WIN32
+   //~ should implement this, but it's (currently) only used in xpdf
+   return 0;
+@@ -448,6 +446,8 @@
+ #endif
+ }
+ 
++/*
++
+ GBool openTempFile(GString **name, FILE **f,
+                  const char *mode, const char *ext) {
+ #if defined(_WIN32)
+Index: b/xpdf/GlobalParams.cc
+===================================================================
+--- a/xpdf/GlobalParams.cc
++++ b/xpdf/GlobalParams.cc
+@@ -406,7 +406,7 @@
+           } else {
+             p1 = p0 + strlen(p0);
+           }
+-          fonts->append(makeWindowsFont(p0, fontNum,
++          fonts->push_back(makeWindowsFont(p0, fontNum,
+                                         fontPath->getCString()));
+           p0 = p1;
+           ++fontNum;
+@@ -486,7 +486,7 @@
+   mods = modsA;
+   context = contextA;
+   cmds = new GList();
+-  cmds->append(new GString(cmd0));
++  cmds->push_back(new GString(cmd0));
+ }
+ 
+ KeyBinding::KeyBinding(int codeA, int modsA, int contextA,
+@@ -495,8 +495,8 @@
+   mods = modsA;
+   context = contextA;
+   cmds = new GList();
+-  cmds->append(new GString(cmd0));
+-  cmds->append(new GString(cmd1));
++  cmds->push_back(new GString(cmd0));
++  cmds->push_back(new GString(cmd1));
+ }
+ 
+ KeyBinding::KeyBinding(int codeA, int modsA, int contextA, GList *cmdsA) {
+@@ -875,132 +875,132 @@
+   keyBindings = new GList();
+ 
+   //----- mouse buttons
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMousePress1, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny, "startSelection"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMouseRelease1, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny, "endSelection",
+                                    "followLinkNoSel"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress2, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMousePress2, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny, "startPan"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease2, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMouseRelease2, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny, "endPan"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress3, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMousePress3, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny, "postPopupMenu"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMousePress4, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny,
+                                    "scrollUpPrevPage(16)"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMousePress5, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny,
+                                    "scrollDownNextPage(16)"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress6, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMousePress6, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny, "scrollLeft(16)"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress7, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeMousePress7, 
xpdfKeyModNone,
+                                    xpdfKeyContextAny, "scrollRight(16)"));
+ 
+   //----- keys
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
+                                    xpdfKeyContextAny, "gotoPage(1)"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "scrollToTopLeft"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
+                                    xpdfKeyContextAny, "gotoLastPage"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
+                                    xpdfKeyContextAny,
+                                    "scrollToBottomRight"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "pageUp"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeBackspace, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeBackspace, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "pageUp"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeDelete, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeDelete, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "pageUp"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "pageDown"));
+-  keyBindings->append(new KeyBinding(' ', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(' ', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "pageDown"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "scrollLeft(16)"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "scrollRight(16)"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "scrollUp(16)"));
+-  keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
+                                    xpdfKeyContextAny, "scrollDown(16)"));
+-  keyBindings->append(new KeyBinding('o', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('o', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "open"));
+-  keyBindings->append(new KeyBinding('O', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('O', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "open"));
+-  keyBindings->append(new KeyBinding('r', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('r', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "reload"));
+-  keyBindings->append(new KeyBinding('R', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('R', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "reload"));
+-  keyBindings->append(new KeyBinding('s', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('s', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "saveAs"));
+-  keyBindings->append(new KeyBinding('S', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('S', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "saveAs"));
+-  keyBindings->append(new KeyBinding('f', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('f', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "find"));
+-  keyBindings->append(new KeyBinding('F', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('F', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "find"));
+-  keyBindings->append(new KeyBinding('f', xpdfKeyModCtrl,
++  keyBindings->push_back(new KeyBinding('f', xpdfKeyModCtrl,
+                                    xpdfKeyContextAny, "find"));
+-  keyBindings->append(new KeyBinding('g', xpdfKeyModCtrl,
++  keyBindings->push_back(new KeyBinding('g', xpdfKeyModCtrl,
+                                    xpdfKeyContextAny, "findNext"));
+-  keyBindings->append(new KeyBinding('p', xpdfKeyModCtrl,
++  keyBindings->push_back(new KeyBinding('p', xpdfKeyModCtrl,
+                                    xpdfKeyContextAny, "print"));
+-  keyBindings->append(new KeyBinding('n', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('n', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOff, "nextPage"));
+-  keyBindings->append(new KeyBinding('N', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('N', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOff, "nextPage"));
+-  keyBindings->append(new KeyBinding('n', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('n', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOn,
+                                    "nextPageNoScroll"));
+-  keyBindings->append(new KeyBinding('N', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('N', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOn,
+                                    "nextPageNoScroll"));
+-  keyBindings->append(new KeyBinding('p', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('p', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOff, "prevPage"));
+-  keyBindings->append(new KeyBinding('P', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('P', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOff, "prevPage"));
+-  keyBindings->append(new KeyBinding('p', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('p', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOn,
+                                    "prevPageNoScroll"));
+-  keyBindings->append(new KeyBinding('P', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('P', xpdfKeyModNone,
+                                    xpdfKeyContextScrLockOn,
+                                    "prevPageNoScroll"));
+-  keyBindings->append(new KeyBinding('[', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('[', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "rotateCCW"));
+-  keyBindings->append(new KeyBinding(']', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding(']', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "rotateCW"));
+-  keyBindings->append(new KeyBinding('v', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('v', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "goForward"));
+-  keyBindings->append(new KeyBinding('b', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('b', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "goBackward"));
+-  keyBindings->append(new KeyBinding('g', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('g', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "focusToPageNum"));
+-  keyBindings->append(new KeyBinding('0', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('0', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "zoomPercent(125)"));
+-  keyBindings->append(new KeyBinding('+', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('+', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "zoomIn"));
+-  keyBindings->append(new KeyBinding('-', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('-', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "zoomOut"));
+-  keyBindings->append(new KeyBinding('z', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('z', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "zoomFitPage"));
+-  keyBindings->append(new KeyBinding('h', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('h', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "zoomFitHeight"));
+-  keyBindings->append(new KeyBinding('w', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('w', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "zoomFitWidth"));
+-  keyBindings->append(new KeyBinding('f', xpdfKeyModAlt,
++  keyBindings->push_back(new KeyBinding('f', xpdfKeyModAlt,
+                                    xpdfKeyContextAny,
+                                    "toggleFullScreenMode"));
+-  keyBindings->append(new KeyBinding('l', xpdfKeyModCtrl,
++  keyBindings->push_back(new KeyBinding('l', xpdfKeyModCtrl,
+                                    xpdfKeyContextAny, "redraw"));
+-  keyBindings->append(new KeyBinding('w', xpdfKeyModCtrl,
++  keyBindings->push_back(new KeyBinding('w', xpdfKeyModCtrl,
+                                    xpdfKeyContextAny, "closeWindowOrQuit"));
+-  keyBindings->append(new KeyBinding('?', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('?', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "about"));
+-  keyBindings->append(new KeyBinding('q', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('q', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "quit"));
+-  keyBindings->append(new KeyBinding('Q', xpdfKeyModNone,
++  keyBindings->push_back(new KeyBinding('Q', xpdfKeyModNone,
+                                    xpdfKeyContextAny, "quit"));
+ }
+ 
+@@ -1035,7 +1035,7 @@
+     } else {
+       for (p2 = p1 + 1; *p2 && !isspace(*p2); ++p2) ;
+     }
+-    tokens->append(new GString(p1, (int)(p2 - p1)));
++    tokens->push_back(new GString(p1, (int)(p2 - p1)));
+     p1 = *p2 ? p2 + 1 : p2;
+   }
+ 
+@@ -1383,7 +1383,7 @@
+     list = new GList();
+     cMapDirs->add(collection->copy(), list);
+   }
+-  list->append(dir->copy());
++  list->push_back(dir->copy());
+ }
+ 
+ void GlobalParams::parseToUnicodeDir(GList *tokens, GString *fileName,
+@@ -1394,7 +1394,7 @@
+         fileName, line);
+     return;
+   }
+-  toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
++  toUnicodeDirs->push_back(((GString *)tokens->get(1))->copy());
+ }
+ 
+ */
+@@ -1417,7 +1417,7 @@
+         fileName, line);
+     return;
+   }
+-  fontDirs->append(((GString *)tokens->get(1))->copy());
++  fontDirs->push_back(((GString *)tokens->get(1))->copy());
+ }
+ 
+ void GlobalParams::parseFontFileCC(GList *tokens, GString *fileName,
+@@ -1451,7 +1451,7 @@
+ 
+   if (tokens->getLength() == 2) {
+     tok = (GString *)tokens->get(1);
+-    if (!setPSPaperSize(tok->getCString())) {
++    if (!setPSPaperSize((char *) tok->getCString())) {
+       error(errConfig, -1,
+           "Bad 'psPaperSize' config file command ({0:s}:{1:d})",
+           fileName, line);
+@@ -1549,7 +1549,7 @@
+                           wMode,
+                           ((GString *)tokens->get(3))->copy(),
+                           ((GString *)tokens->get(4))->copy());
+-  psResidentFonts16->append(param);
++  psResidentFonts16->push_back(param);
+ }
+ 
+ void GlobalParams::parsePSResidentFontCC(GList *tokens, GString *fileName,
+@@ -1577,7 +1577,7 @@
+                           wMode,
+                           ((GString *)tokens->get(3))->copy(),
+                           ((GString *)tokens->get(4))->copy());
+-  psResidentFontsCC->append(param);
++  psResidentFontsCC->push_back(param);
+ }
+ 
+ void GlobalParams::parseTextEncoding(GList *tokens, GString *fileName,
+@@ -1666,20 +1666,20 @@
+               "bind", tokens, fileName, line)) {
+     return;
+   }
+-  for (i = 0; i < keyBindings->getLength(); ++i) {
+-    binding = (KeyBinding *)keyBindings->get(i);
++  for (auto it = keyBindings->begin(); it != keyBindings->end(); it++) {
++    binding = static_cast<KeyBinding *> (*it);
+     if (binding->code == code &&
+       binding->mods == mods &&
+       binding->context == context) {
+-      delete (KeyBinding *)keyBindings->del(i);
++      keyBindings->erase(it);
+       break;
+     }
+   }
+   cmds = new GList();
+   for (i = 3; i < tokens->getLength(); ++i) {
+-    cmds->append(((GString *)tokens->get(i))->copy());
++    cmds->push_back(((GString *)tokens->get(i))->copy());
+   }
+-  keyBindings->append(new KeyBinding(code, mods, context, cmds));
++  keyBindings->push_back(new KeyBinding(code, mods, context, cmds));
+ }
+ 
+ void GlobalParams::parseUnbind(GList *tokens, GString *fileName, int line) {
+@@ -1696,12 +1696,12 @@
+               "unbind", tokens, fileName, line)) {
+     return;
+   }
+-  for (i = 0; i < keyBindings->getLength(); ++i) {
+-    binding = (KeyBinding *)keyBindings->get(i);
++  for (auto it = keyBindings->begin(); it != keyBindings->end(); it++) {
++    binding = static_cast<KeyBinding *> (*it);
+     if (binding->code == code &&
+       binding->mods == mods &&
+       binding->context == context) {
+-      delete (KeyBinding *)keyBindings->del(i);
++      keyBindings->erase(it);
+       break;
+     }
+   }
+@@ -1711,7 +1711,7 @@
+                            int *code, int *mods, int *context,
+                            const char *cmdName,
+                            GList *tokens, GString *fileName, int line) {
+-  char *p0;
++  const char *p0;
+   int btn;
+ 
+   *mods = xpdfKeyModNone;
+@@ -1867,8 +1867,8 @@
+         cmdName, fileName, line);
+     return;
+   }
+-  tok = (GString *)tokens->get(1);
+-  if (!parseYesNo2(tok->getCString(), flag)) {
++  tok = (GString *) tokens->get(1);
++  if (!parseYesNo2((char *) tok->getCString(), flag)) {
+     error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
+         cmdName, fileName, line);
+   }
+@@ -2538,7 +2538,7 @@
+   lockGlobalParams;
+   psResidentFonts->startIter(&iter);
+   while (psResidentFonts->getNext(&iter, &name, (void **)&psName)) {
+-    names->append(psName->copy());
++    names->push_back(psName->copy());
+   }
+   unlockGlobalParams;
+   return names;
+@@ -2959,7 +2959,7 @@
+       (~binding->context | context) == ~0) {
+       cmds = new GList();
+       for (j = 0; j < binding->cmds->getLength(); ++j) {
+-      cmds->append(((GString *)binding->cmds->get(j))->copy());
++      cmds->push_back(((GString *)binding->cmds->get(j))->copy());
+       }
+       break;
+     }
+@@ -3383,7 +3383,7 @@
+ void GlobalParams::addSecurityHandler(XpdfSecurityHandler *handler) {
+ #ifdef ENABLE_PLUGINS
+   lockGlobalParams;
+-  securityHandlers->append(handler);
++  securityHandlers->push_back(handler);
+   unlockGlobalParams;
+ #endif
+ }
+@@ -3433,7 +3433,7 @@
+     return gFalse;
+   }
+   lockGlobalParams;
+-  plugins->append(plugin);
++  plugins->push_back(plugin);
+   unlockGlobalParams;
+   return gTrue;
+ }
+Index: b/xpdf/XPDFViewer.cc
+===================================================================
+--- a/xpdf/XPDFViewer.cc
++++ b/xpdf/XPDFViewer.cc
+@@ -262,7 +262,7 @@
+ 
+ //------------------------------------------------------------------------
+ 
+-XPDFViewer::XPDFViewer(XPDFApp *appA, GString *fileName,
++XPDFViewer::XPDFViewer(XPDFApp *appA, const GString *fileName,
+                      int pageA, GString *destName, GBool fullScreen,
+                      GString *ownerPassword, GString *userPassword) {
+   LinkDest *dest;
+@@ -422,14 +422,14 @@
+ }
+ 
+ void XPDFViewer::clear() {
+-  char *title;
++  const char *title;
+   XmString s;
+ 
+   core->clear();
+ 
+   // set up title
+   title = app->getTitle() ? app->getTitle()->getCString()
+-                          : (char *)xpdfAppName;
++                          : (const char *)xpdfAppName;
+   XtVaSetValues(win, XmNtitle, title, XmNiconName, title, NULL);
+ 
+   if (toolBar != None) {
+@@ -459,7 +459,7 @@
+ // load / display
+ //------------------------------------------------------------------------
+ 
+-GBool XPDFViewer::loadFile(GString *fileName, GString *ownerPassword,
++GBool XPDFViewer::loadFile(const GString *fileName, GString *ownerPassword,
+                          GString *userPassword) {
+   return core->loadFile(fileName, ownerPassword, userPassword) == errNone;
+ }
+@@ -543,7 +543,7 @@
+   }
+ }
+ 
+-void XPDFViewer::actionCbk(void *data, char *action) {
++void XPDFViewer::actionCbk(void *data, const char *action) {
+   XPDFViewer *viewer = (XPDFViewer *)data;
+ 
+   if (!strcmp(action, "Quit")) {
+@@ -690,7 +690,8 @@
+ void XPDFViewer::execCmd(GString *cmd, XEvent *event) {
+   GString *name;
+   GString *args[cmdMaxArgs];
+-  char *p0, *p1;
++  const char *p0;
++  const char *p1;
+   int nArgs, i;
+   int a, b, m, cmp;
+ 
+@@ -1138,13 +1139,14 @@
+ 
+ void XPDFViewer::cmdRun(GString *args[], int nArgs,
+                       XEvent *event) {
+-  GString *fmt, *cmd, *s;
++  GString *fmt, *cmd;
++  const GString *s;
+   LinkAction *action;
+   double selLRX, selLRY, selURX, selURY, mouseX, mouseY;
+   int selPage, mousePage;
+   GBool gotSel, gotMouse;
+   char buf[64];
+-  char *p;
++  const char *p;
+   char c0, c1;
+   int i;
+   int errcode;
+@@ -1549,7 +1551,7 @@
+ 
+   // top-level window
+   n = 0;
+-  title = app->getTitle() ? app->getTitle()->getCString()
++  title = app->getTitle() ? (char *)app->getTitle()->getCString()
+                           : (char *)xpdfAppName;
+   XtSetArg(args[n], XmNtitle, title); ++n;
+   XtSetArg(args[n], XmNiconName, title); ++n;
+@@ -2690,7 +2692,7 @@
+   XmTextFieldSetString(viewer->pageNumText, buf);
+ }
+ 
+-void XPDFViewer::updateCbk(void *data, GString *fileName,
++void XPDFViewer::updateCbk(void *data, const GString *fileName,
+                          int pageNum, int numPages, const char *linkString) {
+   XPDFViewer *viewer = (XPDFViewer *)data;
+   GString *title;
+@@ -2816,7 +2818,7 @@
+       XtSetArg(args[n], XPDFNentryParent, parent); ++n;
+     }
+     XtSetArg(args[n], XPDFNentryExpanded, item->isOpen()); ++n;
+-    s = XmStringCreateLocalized(title->getCString());
++    s = XmStringCreateLocalized((char *) title->getCString());
+     delete title;
+     XtSetArg(args[n], XmNlabelString, s); ++n;
+     XtSetArg(args[n], XmNuserData, item); ++n;
+@@ -3003,7 +3005,7 @@
+   if (core->getDoc() && core->getDoc()->getFileName()) {
+     dir = makePathAbsolute(grabPath(
+             core->getDoc()->getFileName()->getCString()));
+-    s1 = XmStringCreateLocalized(dir->getCString());
++    s1 = XmStringCreateLocalized((char *) dir->getCString());
+     XtVaSetValues(openDialog, XmNdirectory, s1, NULL);
+     XmStringFree(s1);
+     delete dir;
+@@ -3259,7 +3261,7 @@
+   if (core->getDoc() && core->getDoc()->getFileName()) {
+     dir = makePathAbsolute(grabPath(
+             core->getDoc()->getFileName()->getCString()));
+-    s1 = XmStringCreateLocalized(dir->getCString());
++    s1 = XmStringCreateLocalized((char *) dir->getCString());
+     XtVaSetValues(saveAsDialog, XmNdirectory, s1, NULL);
+     XmStringFree(s1);
+     delete dir;
+@@ -3554,9 +3556,9 @@
+   if ((psFileName = xpdfParams->getPSFile())) {
+     if (psFileName->getChar(0) == '|') {
+       XmTextFieldSetString(printCmdText,
+-                         psFileName->getCString() + 1);
++                         (char *) psFileName->getCString() + 1);
+     } else {
+-      XmTextFieldSetString(printFileText, psFileName->getCString());
++      XmTextFieldSetString(printFileText, (char *) psFileName->getCString());
+     }
+     delete psFileName;
+   }
+@@ -3619,8 +3621,9 @@
+ void XPDFViewer::setupPrintDialog() {
+   PDFDoc *doc;
+   char buf[20];
+-  GString *pdfFileName, *psFileName, *psFileName2;
+-  char *p;
++  const GString *pdfFileName;
++  GString *psFileName, *psFileName2;
++  const char *p;
+ 
+   doc = core->getDoc();
+   psFileName = xpdfParams->getPSFile();
+@@ -3634,7 +3637,7 @@
+       psFileName2 = pdfFileName->copy();
+       }
+       psFileName2->append(".ps");
+-      XmTextFieldSetString(printFileText, psFileName2->getCString());
++      XmTextFieldSetString(printFileText, (char *) psFileName2->getCString());
+       delete psFileName2;
+     }
+   }
+@@ -3863,7 +3866,7 @@
+ }
+ 
+ void XPDFViewer::cmdSearch(GString *args[], int nArgs, XEvent *event) {
+-  char *searchText = args[0]->getCString();
++  char *searchText = (char *) args[0]->getCString();
+   core->find(searchText,
+     gFalse,
+     gFalse,
+Index: b/xpdf/PDFDoc.h
+===================================================================
+--- a/xpdf/PDFDoc.h
++++ b/xpdf/PDFDoc.h
+@@ -54,7 +54,7 @@
+   int getErrorCode() { return errCode; }
+ 
+   // Get file name.
+-  GString *getFileName() { return fileName; }
++  const GString *getFileName() { return fileName; }
+ #ifdef _WIN32
+   wchar_t *getFileNameU() { return fileNameU; }
+ #endif
+Index: b/xpdf/XPDFViewer.h
+===================================================================
+--- a/xpdf/XPDFViewer.h
++++ b/xpdf/XPDFViewer.h
+@@ -57,7 +57,7 @@
+ class XPDFViewer {
+ public:
+ 
+-  XPDFViewer(XPDFApp *appA, GString *fileName,
++  XPDFViewer(XPDFApp *appA, const GString *fileName,
+            int pageA, GString *destName, GBool fullScreen,
+            GString *ownerPassword, GString *userPassword);
+   XPDFViewer(XPDFApp *appA, PDFDoc *doc, int pageA,
+@@ -76,7 +76,7 @@
+ private:
+ 
+   //----- load / display
+-  GBool loadFile(GString *fileName, GString *ownerPassword = NULL,
++  GBool loadFile(const GString *fileName, GString *ownerPassword = NULL,
+                GString *userPassword = NULL);
+   void displayPage(int pageA, double zoomA, int rotateA,
+                    GBool scrollToTop, GBool addToHist);
+@@ -87,7 +87,7 @@
+ 
+   //----- hyperlinks / actions
+   void doLink(int wx, int wy, GBool onlyIfNoSelection, GBool newWin);
+-  static void actionCbk(void *data, char *action);
++  static void actionCbk(void *data, const char *action);
+ 
+   //----- keyboard/mouse input
+   static void keyPressCbk(void *data, KeySym key, Guint modifiers,
+@@ -241,7 +241,7 @@
+                         XtPointer callData);
+   static void pageNumCbk(Widget widget, XtPointer ptr,
+                        XtPointer callData);
+-  static void updateCbk(void *data, GString *fileName,
++  static void updateCbk(void *data, const GString *fileName,
+                       int pageNum, int numPages, const char *linkString);
+ 
+   //----- GUI code: outline
+Index: b/xpdf/XPDFApp.h
+===================================================================
+--- a/xpdf/XPDFApp.h
++++ b/xpdf/XPDFApp.h
+@@ -40,7 +40,7 @@
+   XPDFApp(int *argc, char *argv[]);
+   ~XPDFApp();
+ 
+-  XPDFViewer *open(GString *fileName, int page = 1,
++  XPDFViewer *open(const GString *fileName, int page = 1,
+                  GString *ownerPassword = NULL,
+                  GString *userPassword = NULL);
+   XPDFViewer *openAtDest(GString *fileName, GString *dest,
+Index: b/xpdf/xpdf.cc
+===================================================================
+--- a/xpdf/xpdf.cc
++++ b/xpdf/xpdf.cc
+@@ -212,7 +212,7 @@
+   // the initialZoom parameter can be set in either the config file or
+   // as an X resource (or command line arg)
+   if (app->getInitialZoom()) {
+-    xpdfParams->setInitialZoom(app->getInitialZoom()->getCString());
++    xpdfParams->setInitialZoom((char *) app->getInitialZoom()->getCString());
+   }
+ 
+   // check command line
diff -Nru xpdf-3.04/debian/patches/series xpdf-3.04/debian/patches/series
--- xpdf-3.04/debian/patches/series     2018-10-22 09:34:31.000000000 +0100
+++ xpdf-3.04/debian/patches/series     2018-12-04 17:19:28.000000000 +0000
@@ -38,3 +38,4 @@
 poppler-0.62.patch
 poppler-0.68.patch
 poppler-0.69.patch
+poppler-0.71.patch
diff -Nru xpdf-3.04/debian/rules xpdf-3.04/debian/rules
--- xpdf-3.04/debian/rules      2018-10-22 09:34:31.000000000 +0100
+++ xpdf-3.04/debian/rules      2018-12-04 17:35:33.000000000 +0000
@@ -36,8 +36,10 @@
 override_dh_auto_configure: xpdf/xfile.h xpdf/xfile.cc xpdf/XPDFParams.h 
xpdf/XPDFParams.cc
        mkdir -p build
        cp $(sources) $(headers) build
-       sed -e s/GString/GooString/g -e s/GMutex/GooMutex/g -e 
s/GHash/GooHash/g \
+       sed -E -e s/GString/GooString/g -e s/GMutex/GooMutex/g -e 
s/GHash/GooHash/g \
            -e s/GList/GooList/g -e s/\<aconf\.h\>/\<poppler-config\.h\>/g \
+           -e s/GBool/bool/g -e s/gTrue/true/g -e s/gFalse/false/g \
+           -e 's/deleteGooList\(([^,]+), ([^)]+)\);/deleteGooList<\2> 
\(\1\);/' \
            -i build/*
        mv build/parseargs.c build/parseargs.cc
 

Reply via email to