r24981 by jghali - #16764: Build break with poppler 22.03.0

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 2 22:21:05 UTC 2022


Author: jghali
Date: Wed Mar  2 22:21:05 2022
New Revision: 24981

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24981
Log:
#16764: Build break with poppler 22.03.0

Modified:
    branches/Version15x/Scribus/scribus/plugins/import/pdf/importpdf.cpp

Modified: branches/Version15x/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24981&path=/branches/Version15x/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- branches/Version15x/Scribus/scribus/plugins/import/pdf/importpdf.cpp	(original)
+++ branches/Version15x/Scribus/scribus/plugins/import/pdf/importpdf.cpp	Wed Mar  2 22:21:05 2022
@@ -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))




More information about the scribus-commit mailing list