File: 0006-qpdf-12.patch

package info (click to toggle)
cups-filters 1.28.17-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,592 kB
  • sloc: ansic: 54,531; cpp: 7,037; sh: 1,911; makefile: 964; xml: 127; perl: 73; php: 28; python: 8
file content (106 lines) | stat: -rw-r--r-- 3,880 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
From: Sébastien Noel <sebastien@twolife.be>
Subject: fix build against qpdf 12
--- a/filter/pdf.cxx
+++ b/filter/pdf.cxx
@@ -21,6 +21,8 @@
 #include <vector>
 #include <string>
 #include <cstring>
+#define POINTERHOLDER_TRANSITION 3
+#include <qpdf/PointerHolder.hh>
 #include <qpdf/QPDF.hh>
 #include <qpdf/QPDFObjectHandle.hh>
 #include <qpdf/QPDFWriter.hh>
--- a/filter/pdftopdf/qpdf_xobject.cc
+++ b/filter/pdftopdf/qpdf_xobject.cc
@@ -1,5 +1,7 @@
 #include "qpdf_xobject.h"
 //#include <qpdf/Types.h>
+#define POINTERHOLDER_TRANSITION 3
+#include <qpdf/PointerHolder.hh>
 #include <qpdf/QPDF.hh>
 #include <qpdf/Pl_Discard.hh>
 #include <qpdf/Pl_Count.hh>
--- a/filter/rastertopdf.cpp
+++ b/filter/rastertopdf.cpp
@@ -39,6 +39,8 @@
 #include <arpa/inet.h>   // ntohl
 
 #include <vector>
+#define POINTERHOLDER_TRANSITION 3
+#include <qpdf/PointerHolder.hh>
 #include <qpdf/QPDF.hh>
 #include <qpdf/QPDFWriter.hh>
 #include <qpdf/QUtil.hh>
@@ -481,7 +483,7 @@ QPDFObjectHandle embedIccProfile(QPDF &p
     cmsSaveProfileToMem(colorProfile, buff, &profile_size);
 
     // Write ICC profile buffer into PDF
-    ph = new Buffer(buff, profile_size);  
+    ph = (PointerHolder<Buffer>) new Buffer(buff, profile_size);  
     iccstream = QPDFObjectHandle::newStream(&pdf, ph);
     iccstream.replaceDict(QPDFObjectHandle::newDictionary(streamdict));
 
--- a/filter/pdftopdf/qpdf_pdftopdf_processor.cc
+++ b/filter/pdftopdf/qpdf_pdftopdf_processor.cc
@@ -83,10 +83,10 @@
     page.getKey("/Resources").replaceKey("/XObject",QPDFObjectHandle::newDictionary(xobjs));
     content.append("Q\n");
     page.getKey("/Contents").replaceStreamData(content,QPDFObjectHandle::newNull(),QPDFObjectHandle::newNull());
-    page.replaceOrRemoveKey("/Rotate",makeRotate(rotation));
+    page.replaceKey("/Rotate",makeRotate(rotation));
   } else {
     Rotation rot=getRotate(page)+rotation;
-    page.replaceOrRemoveKey("/Rotate",makeRotate(rot));
+    page.replaceKey("/Rotate",makeRotate(rot));
   }
   page=QPDFObjectHandle(); // i.e. uninitialized
   return ret;
@@ -181,9 +181,9 @@
   page.assertInitialized();
   Rotation save_rotate = getRotate(page);
   if(orientation==ROT_0||orientation==ROT_180)
-    page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_90));
+    page.replaceKey("/Rotate",makeRotate(ROT_90));
   else
-    page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_0));
+    page.replaceKey("/Rotate",makeRotate(ROT_0));
 
   PageRect currpage= getBoxAsRect(getTrimBox(page));
   double width = currpage.right-currpage.left;
@@ -242,7 +242,7 @@
   //Cropping.
   // TODO: Borders are covered by the image. buffer space?
   page.replaceKey("/TrimBox",makeBox(currpage.left,currpage.bottom,currpage.right,currpage.top));
-  page.replaceOrRemoveKey("/Rotate",makeRotate(save_rotate));
+  page.replaceKey("/Rotate",makeRotate(save_rotate));
   return getRotate(page);
 }
 
@@ -251,14 +251,14 @@
   page.assertInitialized();
   Rotation save_rotate = getRotate(page);
   if(orientation==ROT_0||orientation==ROT_180)
-    page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_90));
+    page.replaceKey("/Rotate",makeRotate(ROT_90));
   else
-    page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_0));
+    page.replaceKey("/Rotate",makeRotate(ROT_0));
 
   PageRect currpage= getBoxAsRect(getTrimBox(page));
   double width = currpage.right-currpage.left;
   double height = currpage.top-currpage.bottom;
-  page.replaceOrRemoveKey("/Rotate",makeRotate(save_rotate));
+  page.replaceKey("/Rotate",makeRotate(save_rotate));
   if(width>height)
     return true;
   return false;
@@ -662,7 +662,7 @@
       // TODO? other rotation direction, e.g. if (src_rot==ROT_0)&&(param.orientation==ROT_270) ... etc.
       // rotation=ROT_270;
 
-      page.replaceOrRemoveKey("/Rotate",makeRotate(src_rot+rotation));
+      page.replaceKey("/Rotate",makeRotate(src_rot+rotation));
     }
   }
 }