updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / xpdf-nodrm / 02-permissions.patch
blobd8f6dbcef024fa791f94dd17337f805304f37917
1 diff -u -Naur xpdf-3.03-old/xpdf/PDFCore.cc xpdf-3.03-new/xpdf/PDFCore.cc
2 --- xpdf-3.03-old/xpdf/PDFCore.cc 2011-08-15 23:08:53.000000000 +0200
3 +++ xpdf-3.03-new/xpdf/PDFCore.cc 2011-08-20 13:47:13.508475137 +0200
4 @@ -4,6 +4,8 @@
5 //
6 // Copyright 2004 Glyph & Cog, LLC
7 //
8 +// Modified for Debian by Hamish Moffatt, 18 August 2005.
9 +//
10 //========================================================================
12 #include <aconf.h>
13 @@ -1619,9 +1621,11 @@
14 int x0, y0, x1, y1, t;
15 GString *s;
17 +#ifdef ENFORCE_PERMISSIONS
18 if (!doc->okToCopy()) {
19 return NULL;
21 +#endif
22 if ((page = findPage(pg))) {
23 cvtUserToDev(pg, xMin, yMin, &x0, &y0);
24 cvtUserToDev(pg, xMax, yMax, &x1, &y1);
25 diff -u -Naur xpdf-3.03-old/xpdf/pdfimages.cc xpdf-3.03-new/xpdf/pdfimages.cc
26 --- xpdf-3.03-old/xpdf/pdfimages.cc 2011-08-15 23:08:53.000000000 +0200
27 +++ xpdf-3.03-new/xpdf/pdfimages.cc 2011-08-20 13:50:39.638162542 +0200
28 @@ -4,6 +4,8 @@
30 // Copyright 1998-2003 Glyph & Cog, LLC
32 +// Modified for Debian by Hamish Moffatt, 22 May 2002.
33 +//
34 //========================================================================
36 #include <aconf.h>
37 @@ -119,12 +121,14 @@
40 // check for copy permission
41 +#ifdef ENFORCE_PERMISSIONS
42 if (!doc->okToCopy()) {
43 error(errNotAllowed, -1,
44 "Copying of images from this document is not allowed.");
45 exitCode = 3;
46 goto err1;
48 +#endif
50 // get page range
51 if (firstPage < 1)
52 diff -u -Naur xpdf-3.03-old/xpdf/pdftops.cc xpdf-3.03-new/xpdf/pdftops.cc
53 --- xpdf-3.03-old/xpdf/pdftops.cc 2011-08-15 23:08:53.000000000 +0200
54 +++ xpdf-3.03-new/xpdf/pdftops.cc 2011-08-20 13:51:03.830253411 +0200
55 @@ -4,6 +4,8 @@
57 // Copyright 1996-2003 Glyph & Cog, LLC
59 +// Modified for Debian by Hamish Moffatt, 22 May 2002.
60 +//
61 //========================================================================
63 #include <aconf.h>
64 @@ -278,12 +280,14 @@
65 goto err1;
68 +#ifdef ENFORCE_PERMISSIONS
69 // check for print permission
70 if (!doc->okToPrint()) {
71 error(errNotAllowed, -1, "Printing this document is not allowed.");
72 exitCode = 3;
73 goto err1;
75 +#endif
77 // construct PostScript file name
78 if (argc == 3) {
79 diff -u -Naur xpdf-3.03-old/xpdf/pdftotext.cc xpdf-3.03-new/xpdf/pdftotext.cc
80 --- xpdf-3.03-old/xpdf/pdftotext.cc 2011-08-15 23:08:53.000000000 +0200
81 +++ xpdf-3.03-new/xpdf/pdftotext.cc 2011-08-20 13:51:24.367184150 +0200
82 @@ -4,6 +4,8 @@
84 // Copyright 1997-2003 Glyph & Cog, LLC
86 +// Modified for Debian by Hamish Moffatt, 22 May 2002.
87 +//
88 //========================================================================
90 #include <aconf.h>
91 @@ -168,6 +170,7 @@
92 goto err2;
95 +#ifdef ENFORCE_PERMISSIONS
96 // check for copy permission
97 if (!doc->okToCopy()) {
98 error(errNotAllowed, -1,
99 @@ -175,6 +178,7 @@
100 exitCode = 3;
101 goto err2;
103 +#endif
105 // construct text file name
106 if (argc == 3) {
107 diff -u -Naur xpdf-3.03-old/xpdf/XPDFCore.cc xpdf-3.03-new/xpdf/XPDFCore.cc
108 --- xpdf-3.03-old/xpdf/XPDFCore.cc 2011-08-15 23:08:53.000000000 +0200
109 +++ xpdf-3.03-new/xpdf/XPDFCore.cc 2011-08-20 13:48:54.902483779 +0200
110 @@ -4,6 +4,8 @@
112 // Copyright 2002-2003 Glyph & Cog, LLC
114 +// Modified for Debian by Hamish Moffatt, 22 May 2002.
116 //========================================================================
118 #include <aconf.h>
119 @@ -384,12 +386,16 @@
120 #ifndef NO_TEXT_SELECT
121 if (selectULX != selectLRX &&
122 selectULY != selectLRY) {
123 +#ifdef ENFORCE_PERMISSIONS
124 if (doc->okToCopy()) {
125 copySelection();
126 } else {
127 error(errNotAllowed, -1,
128 "Copying of text from this document is not allowed.");
130 +#else
131 + copySelection();
132 +#endif
134 #endif
136 @@ -408,9 +414,11 @@
137 int pg;
138 double ulx, uly, lrx, lry;
140 +#ifdef ENFORCE_PERMISSIONS
141 if (!doc->okToCopy()) {
142 return;
144 +#endif
145 if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
146 //~ for multithreading: need a mutex here
147 if (currentSelection) {
148 diff -u -Naur xpdf-3.03-old/xpdf/XPDFViewer.cc xpdf-3.03-new/xpdf/XPDFViewer.cc
149 --- xpdf-3.03-old/xpdf/XPDFViewer.cc 2011-08-15 23:08:53.000000000 +0200
150 +++ xpdf-3.03-new/xpdf/XPDFViewer.cc 2011-08-20 13:49:52.908140863 +0200
151 @@ -4,6 +4,8 @@
153 // Copyright 2002-2003 Glyph & Cog, LLC
155 +// Modified for Debian by Hamish Moffatt, 22 May 2002.
157 //========================================================================
159 #include <aconf.h>
160 @@ -3492,10 +3494,12 @@
161 PSOutputDev *psOut;
163 doc = viewer->core->getDoc();
164 +#ifdef ENFORCE_PERMISSIONS
165 if (!doc->okToPrint()) {
166 error(errNotAllowed, -1, "Printing this document is not allowed.");
167 return;
169 +#endif
171 viewer->core->setBusyCursor(gTrue);