diff -up xpdf-3.03/xpdf/PDFCore.cc.permissions xpdf-3.03/xpdf/PDFCore.cc
--- xpdf-3.03/xpdf/PDFCore.cc.permissions 2011-08-15 17:08:53.000000000 -0400
+++ xpdf-3.03/xpdf/PDFCore.cc 2011-08-22 13:54:13.553262082 -0400
@@ -4,6 +4,8 @@
//
// Copyright 2004 Glyph & Cog, LLC
//
+// Modified for Debian by Hamish Moffatt, 18 August 2005.
+//
//========================================================================
#include <aconf.h>
@@ -1619,9 +1621,11 @@ GString *PDFCore::extractText(int pg, do
int x0, y0, x1, y1, t;
GString *s;
+#ifdef ENFORCE_PERMISSIONS
if (!doc->okToCopy()) {
return NULL;
}
+#endif
if ((page = findPage(pg))) {
cvtUserToDev(pg, xMin, yMin, &x0, &y0);
cvtUserToDev(pg, xMax, yMax, &x1, &y1);
diff -up xpdf-3.03/xpdf/pdfimages.cc.permissions xpdf-3.03/xpdf/pdfimages.cc
--- xpdf-3.03/xpdf/pdfimages.cc.permissions 2011-08-15 17:08:53.000000000 -0400
+++ xpdf-3.03/xpdf/pdfimages.cc 2011-08-22 13:58:49.976195545 -0400
@@ -4,6 +4,8 @@
//
// Copyright 1998-2003 Glyph & Cog, LLC
//
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
//========================================================================
#include <aconf.h>
@@ -119,12 +121,14 @@ int main(int argc, char *argv[]) {
}
// check for copy permission
+#ifdef ENFORCE_PERMISSIONS
if (!doc->okToCopy()) {
error(errNotAllowed, -1,
"Copying of images from this document is not allowed.");
exitCode = 3;
goto err1;
}
+#endif
// get page range
if (firstPage < 1)
diff -up xpdf-3.03/xpdf/pdftops.cc.permissions xpdf-3.03/xpdf/pdftops.cc
--- xpdf-3.03/xpdf/pdftops.cc.permissions 2011-08-15 17:08:53.000000000 -0400
+++ xpdf-3.03/xpdf/pdftops.cc 2011-08-22 13:59:33.638714938 -0400
@@ -4,6 +4,8 @@
//
// Copyright 1996-2003 Glyph & Cog, LLC
//
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
//========================================================================
#include <aconf.h>
@@ -278,12 +280,14 @@ int main(int argc, char *argv[]) {
goto err1;
}
+#ifdef ENFORCE_PERMISSIONS
// check for print permission
if (!doc->okToPrint()) {
error(errNotAllowed, -1, "Printing this document is not allowed.");
exitCode = 3;
goto err1;
}
+#endif
// construct PostScript file name
if (argc == 3) {
diff -up xpdf-3.03/xpdf/pdftotext.cc.permissions xpdf-3.03/xpdf/pdftotext.cc
--- xpdf-3.03/xpdf/pdftotext.cc.permissions 2011-08-15 17:08:53.000000000 -0400
+++ xpdf-3.03/xpdf/pdftotext.cc 2011-08-22 14:00:05.227367840 -0400
@@ -4,6 +4,8 @@
//
// Copyright 1997-2003 Glyph & Cog, LLC
//
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
//========================================================================
#include <aconf.h>
@@ -168,6 +170,7 @@ int main(int argc, char *argv[]) {
goto err2;
}
+#ifdef ENFORCE_PERMISSIONS
// check for copy permission
if (!doc->okToCopy()) {
error(errNotAllowed, -1,
@@ -175,6 +178,7 @@ int main(int argc, char *argv[]) {
exitCode = 3;
goto err2;
}
+#endif
// construct text file name
if (argc == 3) {
diff -up xpdf-3.03/xpdf/XPDFCore.cc.permissions xpdf-3.03/xpdf/XPDFCore.cc
--- xpdf-3.03/xpdf/XPDFCore.cc.permissions 2011-08-22 13:54:13.488262809 -0400
+++ xpdf-3.03/xpdf/XPDFCore.cc 2011-08-22 13:57:21.556171863 -0400
@@ -4,6 +4,8 @@
//
// Copyright 2002-2003 Glyph & Cog, LLC
//
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
//========================================================================
#include <aconf.h>
@@ -384,12 +386,16 @@ void XPDFCore::endSelection(int wx, int
#ifndef NO_TEXT_SELECT
if (selectULX != selectLRX &&
selectULY != selectLRY) {
+#ifdef ENFORCE_PERMISSIONS
if (doc->okToCopy()) {
copySelection();
} else {
error(errNotAllowed, -1,
"Copying of text from this document is not allowed.");
}
+#else
+ copySelection();
+#endif
}
#endif
}
@@ -408,9 +414,11 @@ void XPDFCore::copySelection() {
int pg;
double ulx, uly, lrx, lry;
+#ifdef ENFORCE_PERMISSIONS
if (!doc->okToCopy()) {
return;
}
+#endif
if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
//~ for multithreading: need a mutex here
if (currentSelection) {
diff -up xpdf-3.03/xpdf/XPDFViewer.cc.permissions xpdf-3.03/xpdf/XPDFViewer.cc
--- xpdf-3.03/xpdf/XPDFViewer.cc.permissions 2011-08-22 13:54:13.540262229 -0400
+++ xpdf-3.03/xpdf/XPDFViewer.cc 2011-08-22 13:58:15.021581012 -0400
@@ -4,6 +4,8 @@
//
// Copyright 2002-2003 Glyph & Cog, LLC
//
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
//========================================================================
#include <aconf.h>
@@ -3494,10 +3496,12 @@ void XPDFViewer::printPrintCbk(Widget wi
PSOutputDev *psOut;
doc = viewer->core->getDoc();
+#ifdef ENFORCE_PERMISSIONS
if (!doc->okToPrint()) {
error(errNotAllowed, -1, "Printing this document is not allowed.");
return;
}
+#endif
viewer->core->setBusyCursor(gTrue);