View Issue Details

IDProjectCategoryView StatusLast Update
0016764ScribusPDFpublic2023-05-29 18:56
Reporterfoutrelis Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.6.0.svn 
Fixed in Version1.6.0.svn 
Summary0016764: Build break with poppler 22.03.0
DescriptionI have attached a patch but I'm not too sure of the third hunk, so feel free to commit an improved fix. �

The following poppler commits are relevant here:

https://cgit.freedesktop.org/poppler/poppler/commit/?id=07889cdfd8a261dc5ae6eb72c26a8a3ec2e35930
https://cgit.freedesktop.org/poppler/poppler/commit/?id=4f2abd3efa1ee013d7e672bad5a2fe58610cdc1d
TagsNo tags attached.
PatchYes

Activities

foutrelis

2022-03-02 12:13

reporter  

poppler-22.03.0.patch (1,796 bytes)   
diff -upr scribus-1.5.8.orig/scribus/plugins/import/pdf/importpdf.cpp scribus-1.5.8/scribus/plugins/import/pdf/importpdf.cpp
--- scribus-1.5.8.orig/scribus/plugins/import/pdf/importpdf.cpp	2022-01-23 18:16:01.000000000 +0200
+++ scribus-1.5.8/scribus/plugins/import/pdf/importpdf.cpp	2022-03-02 14:03:29.851352471 +0200
@@ -90,7 +90,11 @@ QImage PdfPlug::readThumbnail(const QStr
 #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 @@ bool PdfPlug::convert(const QString& fn)
 	globalParams->setErrQuiet(gTrue);
 //	globalParams->setPrintCommands(gTrue);
 	QList<OptionalContentGroup*> ocgGroups;
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+	auto pdfDoc = std::unique_ptr<PDFDoc>(new 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)
@@ -363,7 +371,11 @@ bool PdfPlug::convert(const QString& fn)
 				auto fname = new GooString(QFile::encodeName(fn).data());
 #endif
 				auto userPW = new GooString(text.toLocal8Bit().data());
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), GooString(userPW), GooString(userPW)));
+#else
 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
+#endif
 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 			}
 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
poppler-22.03.0.patch (1,796 bytes)   

jghali

2022-03-02 23:07

administrator   ~0049574

Fixed! Thanks!

Issue History

Date Modified Username Field Change
2022-03-02 12:13 foutrelis New Issue
2022-03-02 12:13 foutrelis File Added: poppler-22.03.0.patch
2022-03-02 23:07 jghali Assigned To => jghali
2022-03-02 23:07 jghali Status new => resolved
2022-03-02 23:07 jghali Resolution open => fixed
2022-03-02 23:07 jghali Note Added: 0049574
2022-03-02 23:07 jghali Fixed in Version => 1.6.0.svn
2022-03-02 23:08 jghali Product Version => 1.6.0.svn
2023-05-29 18:56 cbradney Status resolved => closed