1 --- cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplashClip.cxx.orig 2018-12-17 17:50:48.000000000 +0100
2 +++ cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplashClip.cxx 2018-12-20 21:00:31.188863926 +0100
5 /* dummy call to clear state */
6 scanners[0]->getBBox(&tsxMin,&tsyMin,&tsxMax,&tsyMax);
7 - scanners[0]->getNextSpan(tsyMin-2,&x0,&x1);
8 + SplashXPathScanIterator(*scanners[0], tsyMin-2).getNextSpan(&x0,&x1);
10 for (y = tyMin;y <= tyMax;y++) {
12 for (i = 0;i < blen;i++) {
15 - while (scanners[0]->getNextSpan(y,&x0,&x1)) {
16 + SplashXPathScanIterator iter(*scanners[0], y);
17 + while (iter.getNextSpan(&x0,&x1)) {
18 if (x0 < txMin) x0 = txMin;
19 if (x1 > txMax) x1 = txMax;
20 for (i = x0;i < x1;i++) {
22 for (i = 0;i < blen;i++) {
25 - while (scanners[j]->getNextSpan(y,&x0,&x1)) {
26 + SplashXPathScanIterator iter2(*scanners[j], y);
27 + while (iter2.getNextSpan(&x0,&x1)) {
28 if (x0 < txMin) x0 = txMin;
29 if (x1 > txMax) x1 = txMax;
30 for (i = x0;i < x1;i++) {
31 --- cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplash.cxx.orig 2018-12-17 17:50:48.000000000 +0100
32 +++ cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplash.cxx 2018-12-20 21:02:03.895529536 +0100
34 setStrokePattern(state->fillPattern->copy());
36 for (y = yMinI; y < yMaxI; ++y) {
37 - while (scanner->getNextSpan(y, &x0, &x1)) {
38 + SplashXPathScanIterator iter(*scanner, y);
39 + while (iter.getNextSpan(&x0, &x1)) {
40 if (x0 == x1) continue;
41 if (clipRes == splashClipAllInside) {
42 drawSpan(x0, x1-1, y, true);
43 --- cups-filters-1.21.6/filter/pdftoopvp/OPVPOutputDev.cxx.orig 2018-12-17 17:50:48.000000000 +0100
44 +++ cups-filters-1.21.6/filter/pdftoopvp/OPVPOutputDev.cxx 2018-12-20 21:05:04.392194142 +0100
48 if (scaleWidth > 0 && scaleHeight > 0) {
49 - double *ctm = state->getCTM();
50 + const double *ctm = state->getCTM();
57 opvpError(-1, "Couldn't find a font for '%s'",
58 - gfxFont->getName() ? gfxFont->getName()->getCString()
59 + gfxFont->getName() ? gfxFont->getName()->c_str()
66 opvpError(-1, "Couldn't find a font for '%s'",
67 - gfxFont->getName() ? gfxFont->getName()->getCString()
68 + gfxFont->getName() ? gfxFont->getName()->c_str()
74 ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
75 opvpError(-1, "Couldn't create a font for '%s'",
76 - gfxFont->getName() ? gfxFont->getName()->getCString()
77 + gfxFont->getName() ? gfxFont->getName()->c_str()
83 ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
84 opvpError(-1, "Couldn't create a font for '%s'",
85 - gfxFont->getName() ? gfxFont->getName()->getCString()
86 + gfxFont->getName() ? gfxFont->getName()->c_str()
92 ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
93 opvpError(-1, "Couldn't create a font for '%s'",
94 - gfxFont->getName() ? gfxFont->getName()->getCString()
95 + gfxFont->getName() ? gfxFont->getName()->c_str()
103 - ff = FoFiTrueType::load(fileName->getCString());
104 + ff = FoFiTrueType::load(fileName->c_str());
106 ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
111 opvpError(-1, "Couldn't create a font for '%s'",
112 - gfxFont->getName() ? gfxFont->getName()->getCString()
113 + gfxFont->getName() ? gfxFont->getName()->c_str()
120 opvpError(-1, "Couldn't create a font for '%s'",
121 - gfxFont->getName() ? gfxFont->getName()->getCString()
122 + gfxFont->getName() ? gfxFont->getName()->c_str()
129 opvpError(-1, "Couldn't create a font for '%s'",
130 - gfxFont->getName() ? gfxFont->getName()->getCString()
131 + gfxFont->getName() ? gfxFont->getName()->c_str()
139 - ff = FoFiTrueType::load(fileName->getCString());
140 + ff = FoFiTrueType::load(fileName->c_str());
142 ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
146 codeToGID, n, faceIndex))) {
147 opvpError(-1, "Couldn't create a font for '%s'",
148 - gfxFont->getName() ? gfxFont->getName()->getCString()
149 + gfxFont->getName() ? gfxFont->getName()->c_str()
154 if (fontFile->doAdjustMatrix && !gfxFont->isCIDFont()) {
159 for (code = 0; code < 256; ++code) {
160 if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) &&
161 name[0] == 'm' && name[1] == '\0') {
162 @@ -1115,7 +1115,7 @@
163 int width, int height, bool invert,
169 SplashOutImageMaskData imgMaskData;
171 @@ -1379,7 +1379,7 @@
172 GfxImageColorMap *colorMap,
174 int *maskColors, bool inlineImg) {
178 SplashOutImageData imgData;
179 SplashColorMode srcMode;
180 @@ -1604,7 +1604,7 @@
181 Stream *maskStr, int maskWidth,
182 int maskHeight, bool maskInvert,
183 bool maskInterpolate) {
187 SplashOutMaskedImageData imgData;
188 SplashOutImageMaskData imgMaskData;
189 @@ -1759,7 +1759,7 @@
190 int maskWidth, int maskHeight,
191 GfxImageColorMap *maskColorMap,
192 bool maskInterpolate) {
196 SplashOutImageData imgData;
197 SplashOutImageData imgMaskData;
198 --- cups-filters-1.21.6/filter/pdftoopvp/pdftoopvp.cxx.orig 2018-12-17 17:50:48.000000000 +0100
199 +++ cups-filters-1.21.6/filter/pdftoopvp/pdftoopvp.cxx 2018-12-20 21:09:35.195524381 +0100
200 @@ -482,11 +482,11 @@
201 if (choices != 0) free(choices);
204 - strncpy(jobInfo,jobInfoStr.getCString(),sizeof(jobInfo)-1);
205 + strncpy(jobInfo,jobInfoStr.c_str(),sizeof(jobInfo)-1);
206 jobInfo[sizeof(jobInfo)-1] = '\0';
207 - strncpy(docInfo,docInfoStr.getCString(),sizeof(docInfo)-1);
208 + strncpy(docInfo,docInfoStr.c_str(),sizeof(docInfo)-1);
209 docInfo[sizeof(docInfo)-1] = '\0';
210 - strncpy(pageInfo,pageInfoStr.getCString(),sizeof(pageInfo)-1);
211 + strncpy(pageInfo,pageInfoStr.c_str(),sizeof(pageInfo)-1);
212 pageInfo[sizeof(pageInfo)-1] = '\0';
214 colorProfile = getColorProfilePath(ppd,&colorProfilePath);
218 name.append("/XXXXXX");
219 - fd = mkstemp(name.getCString());
220 + char namebuf[name.getLength()+1];
221 + strcpy(namebuf, name.c_str());
222 + fd = mkstemp(namebuf);
224 opvpError(-1,"Can't create temporary file");
228 doc = new PDFDoc(&name);
230 - unlink(name.getCString());
231 + unlink(name.c_str());
234 doc = new PDFDoc(fileName.copy());