found 679896 xpdf/3.03-11
retitle 679896 compatibility with poppler 0.20.x
thanks

Hi,

attached there are the changes provided by Andy Whitcroft, updated to 
the latest xpdf/3.03-11 and broken out in single pieces for easier 
review/applying:

* check-system-calls.patch
updated

* track_libpopper25_api_changes.patch
the actual porting patch, updated and refreshed

* debian-poppler0.20.diff
the Debian changes needed, i.e. do not strip anymore

Thanks,
-- 
Pino Toscano
description: check exit codes of system calls 
author: Michael Gilbert <michael.s.gilb...@gmail.com>
Index: xpdf/xpdf/XPDFCore.cc
===================================================================
--- xpdf.orig/xpdf/XPDFCore.cc	2012-02-24 20:21:34.000000000 -0500
+++ xpdf/xpdf/XPDFCore.cc	2012-02-24 20:21:34.000000000 -0500
@@ -480,6 +480,7 @@
   Object movieAnnot, obj1, obj2, obj3;
   GString *msg;
   int i;
+  int errcode;
 
   switch (kind = action->getKind()) {
 
@@ -569,12 +570,18 @@
       if (globalParams->getLaunchCommand()) {
 	fileName->insert(0, ' ');
 	fileName->insert(0, globalParams->getLaunchCommand());
-	system(fileName->getCString());
+	errcode = system(fileName->getCString());
+        if (errcode != 0) {
+          error(errInternal, -1 , "non-zero error code returned by system call");
+        }
       } else {
 	msg = new GString("About to execute the command:\n");
 	msg->append(fileName);
 	if (doQuestionDialog("Launching external application", msg)) {
-	  system(fileName->getCString());
+	  errcode = system(fileName->getCString());
+          if (errcode != 0) {
+            error(errInternal, -1 , "non-zero error code returned by system call");
+          }
 	}
 	delete msg;
       }
@@ -684,6 +691,7 @@
 void XPDFCore::runCommand(GString *cmdFmt, GString *arg) {
   GString *cmd;
   char *s;
+  int errcode;
 
   if ((s = strstr(cmdFmt->getCString(), "%s"))) {
     cmd = mungeURL(arg);
@@ -700,7 +708,10 @@
 #else
   cmd->append(" &");
 #endif
-  system(cmd->getCString());
+  errcode = system(cmd->getCString());
+  if (errcode != 0) {
+      error(errInternal, -1 , "non-zero error code returned by system call");
+  }
   delete cmd;
 }
 
Index: xpdf/xpdf/XPDFViewer.cc
===================================================================
--- xpdf.orig/xpdf/XPDFViewer.cc	2012-02-24 20:21:34.000000000 -0500
+++ xpdf/xpdf/XPDFViewer.cc	2012-02-24 20:22:49.000000000 -0500
@@ -1126,6 +1126,7 @@
   char *p;
   char c0, c1;
   int i;
+  int errcode;
 
   cmd = new GString();
   fmt = args[0];
@@ -1222,7 +1223,10 @@
 #else
   cmd->append(" &");
 #endif
-  system(cmd->getCString());
+  errcode = system(cmd->getCString());
+  if (errcode != 0) {
+      error(errInternal, -1, "non-zero error code return by system call");
+  }
   delete cmd;
 }
 
Description: track changes to libpoppler25 API
 Track changes to the libpoppler25 ABI
 .
 startDoc now takes a PDFDoc rather than and XRef
 TextOutputDev::TextOutputDev has an additional fixedPitch parameter, 0
 triggering previous behaviour.
 TextOutputDev::findText has an additions wholeWord parameter
 PSOutputDev::PSOutputDev no longer takes Xref or Catalog parameters
Author: Andy Whitcroft <a...@ubuntu.com>
Last-Updated: 2012-06-12
--- a/xpdf/PDFCore.cc
+++ b/xpdf/PDFCore.cc
@@ -196,7 +196,7 @@
   }
   doc = newDoc;
   if (out) {
-    out->startDoc(doc->getXRef());
+    out->startDoc(newDoc);
   }
 
   // nothing displayed yet
@@ -901,7 +901,7 @@
     page->links = doc->getLinks(page->page);
   }
   if (!page->text) {
-    if ((textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse))) {
+    if ((textOut = new TextOutputDev(NULL, gTrue, 0, gFalse, gFalse))) {
       doc->displayPage(textOut, page->page, dpi, dpi, rotate,
 		       gFalse, gTrue, gFalse);
       page->text = textOut->takeText();
@@ -1661,7 +1661,7 @@
     }
     s = page->text->getText(x0, y0, x1, y1);
   } else {
-    textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse);
+    textOut = new TextOutputDev(NULL, gTrue, 0, gFalse, gFalse);
     if (textOut->isOk()) {
       doc->displayPage(textOut, pg, dpi, dpi, rotate, gFalse, gTrue, gFalse);
       textOut->cvtUserToDev(xMin, yMin, &x0, &y0);
@@ -1741,7 +1741,7 @@
     page = findPage(pg);
   }
   if (page->text->findText(u, len, startAtTop, gTrue, startAtLast, gFalse,
-			   caseSensitive, backward,
+			   caseSensitive, backward, gFalse,
 			   &xMin, &yMin, &xMax, &yMax)) {
     goto found;
   }
@@ -1749,7 +1749,7 @@
   if (!onePageOnly) {
 
     // search following/previous pages
-    textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse);
+    textOut = new TextOutputDev(NULL, gTrue, 0, gFalse, gFalse);
     if (!textOut->isOk()) {
       delete textOut;
       goto notFound;
@@ -1759,7 +1759,7 @@
 	 pg += backward ? -1 : 1) {
       doc->displayPage(textOut, pg, 72, 72, 0, gFalse, gTrue, gFalse);
       if (textOut->findText(u, len, gTrue, gTrue, gFalse, gFalse,
-			    caseSensitive, backward,
+			    caseSensitive, backward, gFalse,
 			    &xMin, &yMin, &xMax, &yMax)) {
 	delete textOut;
 	goto foundPage;
@@ -1772,7 +1772,7 @@
 	 pg += backward ? -1 : 1) {
       doc->displayPage(textOut, pg, 72, 72, 0, gFalse, gTrue, gFalse);
       if (textOut->findText(u, len, gTrue, gTrue, gFalse, gFalse,
-			    caseSensitive, backward,
+			    caseSensitive, backward, gFalse,
 			    &xMin, &yMin, &xMax, &yMax)) {
 	delete textOut;
 	goto foundPage;
@@ -1794,7 +1794,7 @@
       yMax = selectLRY;
     }
     if (page->text->findText(u, len, gTrue, gFalse, gFalse, stopAtLast,
-			     caseSensitive, backward,
+			     caseSensitive, backward, gFalse,
 			     &xMin, &yMin, &xMax, &yMax)) {
       goto found;
     }
@@ -1811,7 +1811,7 @@
 	 gTrue);
   page = findPage(pg);
   if (!page->text->findText(u, len, gTrue, gTrue, gFalse, gFalse,
-			    caseSensitive, backward,
+			    caseSensitive, backward, gFalse,
 			    &xMin, &yMin, &xMax, &yMax)) {
     // this can happen if coalescing is bad
     goto notFound;
--- a/xpdf/XPDFViewer.cc
+++ b/xpdf/XPDFViewer.cc
@@ -3711,8 +3711,8 @@
   // Normal print mode
   if (printAll && !printBack)
   {
-    psOut = new PSOutputDev(psFileName->getCString(), doc, doc->getXRef(),
-          doc->getCatalog(), NULL, firstPage, lastPage,
+    psOut = new PSOutputDev(psFileName->getCString(), doc,
+          NULL, firstPage, lastPage,
           psModePS, globalParams->getPSPaperWidth(),
           globalParams->getPSPaperHeight(), globalParams->getPSDuplex());
     if (psOut->isOk()) {
@@ -3758,8 +3758,8 @@
     {
       for (i=beginPage;; i+=step)
       {
-        psOut = new PSOutputDev(psFileName->getCString(), doc, doc->getXRef(),
-              doc->getCatalog(), NULL, i, i, psModePS,
+        psOut = new PSOutputDev(psFileName->getCString(), doc,
+              NULL, i, i, psModePS,
 	      globalParams->getPSPaperWidth(),
               globalParams->getPSPaperHeight(), globalParams->getPSDuplex());
         if (psOut->isOk()) {
diff -Nru xpdf-3.03/debian/rules xpdf-3.03/debian/rules
--- xpdf-3.03/debian/rules	2013-05-31 19:53:57.000000000 +0000
+++ xpdf-3.03/debian/rules	2013-08-09 12:34:32.000000000 +0000
@@ -24,7 +24,7 @@
 	cp $(sources) $(headers) build
 	sed -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/errConfig,//g -e s/errSyntaxError,//g -e s/errIO,//g -i build/*
+	    -i build/*
 	mv build/parseargs.c build/parseargs.cc
 
 override_dh_auto_build: $(objects)

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to