Package: scribus / 1.5.8+dfsg-4

24981.patch Patch series | download
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
Description: Build break with poppler 22.03.0
Origin: upstream, https://www.scribus.net/websvn/revision.php?repname=Scribus&path=%2F&isdir=1&rev=24981
Bug: https://bugs.scribus.net/view.php?id=16764
Bug-Debian: https://bugs.debian.org/1012850

Index: scribus/plugins/import/pdf/importpdf.cpp
===================================================================
--- a/scribus/plugins/import/pdf/importpdf.cpp	(revision 24980)
+++ b/scribus/plugins/import/pdf/importpdf.cpp	(revision 24981)
@@ -90,7 +90,11 @@
 #endif
 	globalParams->setErrQuiet(gTrue);
 
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
+#else
 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
+#endif
 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
 		return QImage();
 
@@ -343,7 +347,11 @@
 	globalParams->setErrQuiet(gTrue);
 //	globalParams->setPrintCommands(gTrue);
 	QList<OptionalContentGroup*> ocgGroups;
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
+#else
 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
+#endif
 	if (pdfDoc)
 	{
 		if (pdfDoc->getErrorCode() == errEncrypted)
@@ -362,8 +370,13 @@
 #else
 				auto fname = new GooString(QFile::encodeName(fn).data());
 #endif
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
+				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
+#else
 				auto userPW = new GooString(text.toLocal8Bit().data());
 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
+#endif
 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 			}
 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))