diff --git a/0001-PDF-import-plugin-support-poppler-0.86.x.patch b/0001-PDF-import-plugin-support-poppler-0.86.x.patch
new file mode 100644
index 0000000..502a361
--- /dev/null
+++ b/0001-PDF-import-plugin-support-poppler-0.86.x.patch
@@ -0,0 +1,506 @@
+From 0413bebe7a8c08d75f6ea290d3ff54cb0df05a4e Mon Sep 17 00:00:00 2001
+From: jghali
+Date: Mon, 2 Mar 2020 14:45:59 +0000
+Subject: [PATCH] PDF import plugin: support poppler 0.86.x
+
+git-svn-id: svn://scribus.net/trunk/Scribus@23478 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 53 ++++++-
+ scribus/plugins/import/pdf/importpdf.h | 19 ++-
+ scribus/plugins/import/pdf/slaoutput.cpp | 180 ++++++++++++++++++++---
+ scribus/plugins/import/pdf/slaoutput.h | 7 +
+ 4 files changed, 226 insertions(+), 33 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 822617a..2c1539a 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -856,11 +856,20 @@ bool PdfPlug::convert(const QString& fn)
+ names = catDict.dictLookup("OpenAction");
+ if (names.isDict())
+ {
+- LinkAction *linkAction = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr linkAction;
+ linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
++#else
++ LinkAction *linkAction = nullptr;
++ linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
++#endif
+ if (linkAction)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)linkAction;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) linkAction.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) linkAction;
++#endif
+ if (jsa->isOk())
+ {
+ QString script = UnicodeParsedString(jsa->getScript());
+@@ -1068,3 +1077,43 @@ QString PdfPlug::UnicodeParsedString(POPPLER_CONST GooString *s1)
+ }
+ return result;
+ }
++
++QString PdfPlug::UnicodeParsedString(const std::string& s1)
++{
++ if (s1.length() == 0)
++ return QString();
++ GBool isUnicode;
++ int i;
++ Unicode u;
++ QString result;
++ if ((s1.at(0) & 0xff) == 0xfe && (s1.length() > 1 && (s1.at(1) & 0xff) == 0xff))
++ {
++ isUnicode = gTrue;
++ i = 2;
++ result.reserve((s1.length() - 2) / 2);
++ }
++ else
++ {
++ isUnicode = gFalse;
++ i = 0;
++ result.reserve(s1.length());
++ }
++ while (i < s1.length())
++ {
++ if (isUnicode)
++ {
++ u = ((s1.at(i) & 0xff) << 8) | (s1.at(i+1) & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = s1.at(i) & 0xff;
++ ++i;
++ }
++ // #15616: imagemagick may write unicode strings incorrectly in PDF
++ if (u == 0)
++ continue;
++ result += QChar( u );
++ }
++ return result;
++}
+diff --git a/scribus/plugins/import/pdf/importpdf.h b/scribus/plugins/import/pdf/importpdf.h
+index 9dbfecc..72cae6b 100644
+--- a/scribus/plugins/import/pdf/importpdf.h
++++ b/scribus/plugins/import/pdf/importpdf.h
+@@ -7,19 +7,21 @@ for which a new license (GPL+exception) is in place.
+ #ifndef IMPORTPDF_H
+ #define IMPORTPDF_H
+
++#include
++#include
++#include
++#include
+ #include
+-#include
+ #include
+-#include
+ #include
++#include
++#include
++#include
+ #include
+ #include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
++#include
++
++#include
+
+ #include "fpointarray.h"
+ #include "importpdfconfig.h"
+@@ -82,6 +84,7 @@ private:
+ bool convert(const QString& fn);
+ QRectF getCBox(int box, int pgNum);
+ QString UnicodeParsedString(POPPLER_CONST GooString *s1);
++ QString UnicodeParsedString(const std::string& s1);
+
+ QList Elements;
+ double baseX, baseY;
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index fa35f51..8d8e9d4 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -308,9 +308,15 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano)
+ }
+
+ /* Replacement for the crippled Poppler function LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type) */
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++std::unique_ptr SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
++{
++ std::unique_ptr linkAction;
++#else
+ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+ {
+ LinkAction *linkAction = nullptr;
++#endif
+ Object obj;
+ Ref refa = ano->getRef();
+
+@@ -455,7 +461,11 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
+- LinkDest *dstn = pdfDoc->findDest(ndst);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -499,7 +509,11 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
+- LinkDest *dstn = pdfDoc->findDest(ndst);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -967,7 +981,11 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
+- LinkDest *dstn = pdfDoc->findDest(ndst);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -1019,7 +1037,11 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
+- LinkDest *dstn = pdfDoc->findDest(ndst);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -1088,96 +1110,148 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ else
+ qDebug() << "Found unsupported Action of type" << Lact->getKind();
+ }
+- LinkAction *Aact = SC_getAdditionalAction("D", ano);
++ auto Aact = SC_getAdditionalAction("D", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("E", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("X", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("Fo", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("Bl", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("C", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("F", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));
+@@ -1185,14 +1259,22 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ ite->annotation().setFormat(5);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("K", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));
+@@ -1200,21 +1282,33 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ ite->annotation().setFormat(5);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("V", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
+- Aact = nullptr;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
+ }
+ }
+
+@@ -3928,6 +4022,46 @@ QString SlaOutputDev::UnicodeParsedString(POPPLER_CONST GooString *s1)
+ return result;
+ }
+
++QString SlaOutputDev::UnicodeParsedString(const std::string& s1)
++{
++ if (s1.length() == 0)
++ return QString();
++ GBool isUnicode;
++ int i;
++ Unicode u;
++ QString result;
++ if ((s1.at(0) & 0xff) == 0xfe && (s1.length() > 1 && (s1.at(1) & 0xff) == 0xff))
++ {
++ isUnicode = gTrue;
++ i = 2;
++ result.reserve((s1.length() - 2) / 2);
++ }
++else
++ {
++ isUnicode = gFalse;
++ i = 0;
++ result.reserve(s1.length());
++ }
++ while (i < s1.length())
++ {
++ if (isUnicode)
++ {
++ u = ((s1.at(i) & 0xff) << 8) | (s1.at(i+1) & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = s1.at(i) & 0xff;
++ ++i;
++ }
++ // #15616: imagemagick may write unicode strings incorrectly in PDF
++ if (u == 0)
++ continue;
++ result += QChar( u );
++ }
++ return result;
++}
++
+ bool SlaOutputDev::checkClip()
+ {
+ bool ret = false;
+diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
+index ce73926..e42447c 100644
+--- a/scribus/plugins/import/pdf/slaoutput.h
++++ b/scribus/plugins/import/pdf/slaoutput.h
+@@ -20,6 +20,8 @@ for which a new license (GPL+exception) is in place.
+ #include
+ #include
+
++#include
++
+ #include "fpointarray.h"
+ #include "importpdfconfig.h"
+ #include "pageitem.h"
+@@ -159,7 +161,11 @@ public:
+ virtual ~SlaOutputDev();
+
+ LinkAction* SC_getAction(AnnotWidget *ano);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr SC_getAdditionalAction(const char *key, AnnotWidget *ano);
++#else
+ LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
++#endif
+ static GBool annotations_callback(Annot *annota, void *user_data);
+ bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+ bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+@@ -287,6 +293,7 @@ private:
+ void applyMask(PageItem *ite);
+ void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
+ QString UnicodeParsedString(POPPLER_CONST GooString *s1);
++ QString UnicodeParsedString(const std::string& s1);
+ bool checkClip();
+ bool pathIsClosed;
+ QString CurrColorFill;
+--
+2.26.0
+
diff --git a/Fix-failure-to-build-against-poppler-0.83.0.patch b/Fix-failure-to-build-against-poppler-0.83.0.patch
index bac0b79..e36558c 100644
--- a/Fix-failure-to-build-against-poppler-0.83.0.patch
+++ b/Fix-failure-to-build-against-poppler-0.83.0.patch
@@ -16,135 +16,135 @@ index 2ab38ac758..427cd66ef2 100644
--- a/scribus/plugins/import/pdf/importpdf.cpp
+++ b/scribus/plugins/import/pdf/importpdf.cpp
@@ -74,7 +74,11 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
- QImage PdfPlug::readThumbnail(const QString& fName)
- {
- QString pdfFile = QDir::toNativeSeparators(fName);
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
-+ globalParams.reset(new GlobalParams());
-+#else
- globalParams = new GlobalParams();
-+#endif
- if (globalParams)
- {
- #if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
+ QImage PdfPlug::readThumbnail(const QString& fName)
+ {
+ QString pdfFile = QDir::toNativeSeparators(fName);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++ globalParams.reset(new GlobalParams());
++#else
+ globalParams = new GlobalParams();
++#endif
+ if (globalParams)
+ {
+ #if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
@@ -89,7 +93,9 @@ QImage PdfPlug::readThumbnail(const QString& fName)
- if (pdfDoc->getErrorCode() == errEncrypted)
- {
- delete pdfDoc;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
- delete globalParams;
-+#endif
- return QImage();
- }
- if (pdfDoc->isOk())
+ if (pdfDoc->getErrorCode() == errEncrypted)
+ {
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return QImage();
+ }
+ if (pdfDoc->isOk())
@@ -133,11 +139,15 @@ QImage PdfPlug::readThumbnail(const QString& fName)
- image.setText("YSize", QString("%1").arg(h));
- delete dev;
- delete pdfDoc;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
- delete globalParams;
-+#endif
- return image;
- }
- delete pdfDoc;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
- delete globalParams;
-+#endif
- }
- }
- return QImage();
+ image.setText("YSize", QString("%1").arg(h));
+ delete dev;
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return image;
+ }
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ }
+ }
+ return QImage();
@@ -343,7 +353,11 @@ bool PdfPlug::convert(const QString& fn)
- qApp->processEvents();
- }
-
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
-+ globalParams.reset(new GlobalParams());
-+#else
- globalParams = new GlobalParams();
-+#endif
- GooString *userPW = nullptr;
- if (globalParams)
- {
+ qApp->processEvents();
+ }
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++ globalParams.reset(new GlobalParams());
++#else
+ globalParams = new GlobalParams();
++#endif
+ GooString *userPW = nullptr;
+ if (globalParams)
+ {
@@ -385,7 +399,9 @@ bool PdfPlug::convert(const QString& fn)
- if (progressDialog)
- progressDialog->close();
- delete pdfDoc;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
- delete globalParams;
-+#endif
- return false;
- }
- if (progressDialog)
+ if (progressDialog)
+ progressDialog->close();
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return false;
+ }
+ if (progressDialog)
@@ -430,7 +446,9 @@ bool PdfPlug::convert(const QString& fn)
- progressDialog->close();
- delete optImp;
- delete pdfDoc;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
- delete globalParams;
-+#endif
- return false;
- }
- pageString = optImp->getPagesString();
+ progressDialog->close();
+ delete optImp;
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return false;
+ }
+ pageString = optImp->getPagesString();
@@ -843,8 +861,12 @@ bool PdfPlug::convert(const QString& fn)
- }
- delete pdfDoc;
- }
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
-+ globalParams.release();
-+#else
- delete globalParams;
- globalParams = nullptr;
-+#endif
-
- // qDebug() << "converting finished";
- // qDebug() << "Imported" << Elements.count() << "Elements";
+ }
+ delete pdfDoc;
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++ globalParams.release();
++#else
+ delete globalParams;
+ globalParams = nullptr;
++#endif
+
+ // qDebug() << "converting finished";
+ // qDebug() << "Imported" << Elements.count() << "Elements";
diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h
index 9913ee382c..5a7e0d2162 100644
--- a/scribus/plugins/import/pdf/importpdfconfig.h
+++ b/scribus/plugins/import/pdf/importpdfconfig.h
@@ -58,4 +58,10 @@ for which a new license (GPL+exception) is in place.
- #define POPPLER_CONST_082
- #endif
-
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
-+#define POPPLER_CONST_083 const
-+#else
-+#define POPPLER_CONST_083
-+#endif
-+
- #endif
+ #define POPPLER_CONST_082
+ #endif
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++#define POPPLER_CONST_083 const
++#else
++#define POPPLER_CONST_083
++#endif
++
+ #endif
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
index 5e4d32a551..ffcfa8450b 100644
--- a/scribus/plugins/import/pdf/slaoutput.cpp
+++ b/scribus/plugins/import/pdf/slaoutput.cpp
@@ -3678,7 +3678,7 @@ QString SlaOutputDev::getAnnotationColor(const AnnotColor *color)
- return fNam;
- }
-
--QString SlaOutputDev::convertPath(GfxPath *path)
-+QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)
- {
- if (! path)
- return QString();
+ return fNam;
+ }
+
+-QString SlaOutputDev::convertPath(GfxPath *path)
++QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)
+ {
+ if (! path)
+ return QString();
@@ -3688,7 +3688,7 @@ QString SlaOutputDev::convertPath(GfxPath *path)
-
- for (int i = 0; i < path->getNumSubpaths(); ++i)
- {
-- GfxSubpath * subpath = path->getSubpath(i);
-+ POPPLER_CONST_083 GfxSubpath * subpath = path->getSubpath(i);
- if (subpath->getNumPoints() > 0)
- {
- output += QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));
+
+ for (int i = 0; i < path->getNumSubpaths(); ++i)
+ {
+- GfxSubpath * subpath = path->getSubpath(i);
++ POPPLER_CONST_083 GfxSubpath * subpath = path->getSubpath(i);
+ if (subpath->getNumPoints() > 0)
+ {
+ output += QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));
diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
index 60fb900618..d928fada81 100644
--- a/scribus/plugins/import/pdf/slaoutput.h
+++ b/scribus/plugins/import/pdf/slaoutput.h
@@ -282,7 +282,7 @@ class SlaOutputDev : public OutputDev
- void getPenState(GfxState *state);
- QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);
- QString getAnnotationColor(const AnnotColor *color);
-- QString convertPath(GfxPath *path);
-+ QString convertPath(POPPLER_CONST_083 GfxPath *path);
- int getBlendMode(GfxState *state);
- void applyMask(PageItem *ite);
- void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
+ void getPenState(GfxState *state);
+ QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);
+ QString getAnnotationColor(const AnnotColor *color);
+- QString convertPath(GfxPath *path);
++ QString convertPath(POPPLER_CONST_083 GfxPath *path);
+ int getBlendMode(GfxState *state);
+ void applyMask(PageItem *ite);
+ void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
diff --git a/Fix-failure-to-build-with-poppler-0.84.0.patch b/Fix-failure-to-build-with-poppler-0.84.0.patch
index 6f9bf6f..46865f5 100644
--- a/Fix-failure-to-build-with-poppler-0.84.0.patch
+++ b/Fix-failure-to-build-with-poppler-0.84.0.patch
@@ -13,22 +13,22 @@ index ffcfa8450b..d788f9f06c 100644
--- a/scribus/plugins/import/pdf/slaoutput.cpp
+++ b/scribus/plugins/import/pdf/slaoutput.cpp
@@ -1189,6 +1189,11 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
- catalog = catA;
- pdfDoc = doc;
- updateGUICounter = 0;
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
-+ m_fontEngine = new SplashFontEngine(true, true, true, true);
-+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 61, 0)
-+ m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), true, true, true);
-+#else
- m_fontEngine = new SplashFontEngine(
- #if HAVE_T1LIB_H
- globalParams->getEnableT1lib(),
+ catalog = catA;
+ pdfDoc = doc;
+ updateGUICounter = 0;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
++ m_fontEngine = new SplashFontEngine(true, true, true, true);
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 61, 0)
++ m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), true, true, true);
++#else
+ m_fontEngine = new SplashFontEngine(
+ #if HAVE_T1LIB_H
+ globalParams->getEnableT1lib(),
@@ -1199,6 +1204,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
- true,
- #endif
- true);
-+#endif
- }
-
- void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
+ true,
+ #endif
+ true);
++#endif
+ }
+
+ void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
diff --git a/Use-same-mechanism-as-with-previous-poppler-versions.patch b/Use-same-mechanism-as-with-previous-poppler-versions.patch
index 435fd3b..9cdcb73 100644
--- a/Use-same-mechanism-as-with-previous-poppler-versions.patch
+++ b/Use-same-mechanism-as-with-previous-poppler-versions.patch
@@ -16,125 +16,125 @@ index 2a13b0d109..9913ee382c 100644
--- a/scribus/plugins/import/pdf/importpdfconfig.h
+++ b/scribus/plugins/import/pdf/importpdfconfig.h
@@ -52,4 +52,10 @@ for which a new license (GPL+exception) is in place.
- #define POPPLER_REF
- #endif
-
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 82, 0)
-+#define POPPLER_CONST_082 const
-+#else
-+#define POPPLER_CONST_082
-+#endif
-+
- #endif
+ #define POPPLER_REF
+ #endif
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 82, 0)
++#define POPPLER_CONST_082 const
++#else
++#define POPPLER_CONST_082
++#endif
++
+ #endif
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
index f3d6446880..bb7b184272 100644
--- a/scribus/plugins/import/pdf/slaoutput.cpp
+++ b/scribus/plugins/import/pdf/slaoutput.cpp
@@ -1606,7 +1606,7 @@ void SlaOutputDev::stroke(GfxState *state)
- ite->PoLine = out.copy();
- ite->ClipEdited = true;
- ite->FrameType = 3;
-- ite->setWidthHeight(wh.x(),wh.y());
-+ ite->setWidthHeight(wh.x(), wh.y());
- m_doc->adjustItemSize(ite);
- if (m_Elements->count() != 0)
- {
+ ite->PoLine = out.copy();
+ ite->ClipEdited = true;
+ ite->FrameType = 3;
+- ite->setWidthHeight(wh.x(),wh.y());
++ ite->setWidthHeight(wh.x(), wh.y());
+ m_doc->adjustItemSize(ite);
+ if (m_Elements->count() != 0)
+ {
@@ -2471,7 +2471,7 @@ void SlaOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int
- out.translate(-ite->xPos(), -ite->yPos());
- ite->PoLine = out.copy();
- FPoint wh = getMaxClipF(&ite->PoLine);
-- ite->setWidthHeight(wh.x(),wh.y());
-+ ite->setWidthHeight(wh.x(), wh.y());
- ite->setTextFlowMode(PageItem::TextFlowDisabled);
- ite->ScaleType = true;
- m_doc->adjustItemSize(ite);
+ out.translate(-ite->xPos(), -ite->yPos());
+ ite->PoLine = out.copy();
+ FPoint wh = getMaxClipF(&ite->PoLine);
+- ite->setWidthHeight(wh.x(),wh.y());
++ ite->setWidthHeight(wh.x(), wh.y());
+ ite->setTextFlowMode(PageItem::TextFlowDisabled);
+ ite->ScaleType = true;
+ m_doc->adjustItemSize(ite);
@@ -2613,7 +2613,7 @@ void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str
- out.translate(-ite->xPos(), -ite->yPos());
- ite->PoLine = out.copy();
- FPoint wh = getMaxClipF(&ite->PoLine);
-- ite->setWidthHeight(wh.x(),wh.y());
-+ ite->setWidthHeight(wh.x(), wh.y());
- ite->setTextFlowMode(PageItem::TextFlowDisabled);
- ite->ScaleType = true;
- m_doc->adjustItemSize(ite);
+ out.translate(-ite->xPos(), -ite->yPos());
+ ite->PoLine = out.copy();
+ FPoint wh = getMaxClipF(&ite->PoLine);
+- ite->setWidthHeight(wh.x(),wh.y());
++ ite->setWidthHeight(wh.x(), wh.y());
+ ite->setTextFlowMode(PageItem::TextFlowDisabled);
+ ite->ScaleType = true;
+ m_doc->adjustItemSize(ite);
@@ -2762,7 +2762,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i
- out.translate(-ite->xPos(), -ite->yPos());
- ite->PoLine = out.copy();
- FPoint wh = getMaxClipF(&ite->PoLine);
-- ite->setWidthHeight(wh.x(),wh.y());
-+ ite->setWidthHeight(wh.x(), wh.y());
- ite->setTextFlowMode(PageItem::TextFlowDisabled);
- ite->ScaleType = true;
- m_doc->adjustItemSize(ite);
+ out.translate(-ite->xPos(), -ite->yPos());
+ ite->PoLine = out.copy();
+ FPoint wh = getMaxClipF(&ite->PoLine);
+- ite->setWidthHeight(wh.x(),wh.y());
++ ite->setWidthHeight(wh.x(), wh.y());
+ ite->setTextFlowMode(PageItem::TextFlowDisabled);
+ ite->ScaleType = true;
+ m_doc->adjustItemSize(ite);
@@ -2784,11 +2784,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i
- delete[] mbuffer;
- }
-
--#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
--void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int* maskColors, GBool inlineImg)
--#else
--void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int* maskColors, GBool inlineImg)
--#endif
-+void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int* maskColors, GBool inlineImg)
- {
- ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
- // qDebug() << "Image Components" << colorMap->getNumPixelComps() << "Mask" << maskColors;
+ delete[] mbuffer;
+ }
+
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+-void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int* maskColors, GBool inlineImg)
+-#else
+-void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int* maskColors, GBool inlineImg)
+-#endif
++void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int* maskColors, GBool inlineImg)
+ {
+ ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
+ // qDebug() << "Image Components" << colorMap->getNumPixelComps() << "Mask" << maskColors;
@@ -3369,11 +3365,7 @@ void SlaOutputDev::updateFont(GfxState *state)
- fontsrc->unref();
- }
-
--#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
--void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen)
--#else
--void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode *u, int uLen)
--#endif
-+void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, POPPLER_CONST_082 Unicode *u, int uLen)
- {
- double x1, y1, x2, y2;
- int render;
+ fontsrc->unref();
+ }
+
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+-void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen)
+-#else
+-void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode *u, int uLen)
+-#endif
++void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ double x1, y1, x2, y2;
+ int render;
@@ -3460,11 +3452,7 @@ void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, doub
- }
- }
-
--#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
--GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen)
--#else
--GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen)
--#endif
-+GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
- {
- // qDebug() << "beginType3Char";
- GfxFont *gfxFont;
+ }
+ }
+
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+-GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen)
+-#else
+-GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen)
+-#endif
++GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ // qDebug() << "beginType3Char";
+ GfxFont *gfxFont;
diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
index b5905184e5..14a590d55e 100644
--- a/scribus/plugins/import/pdf/slaoutput.h
+++ b/scribus/plugins/import/pdf/slaoutput.h
@@ -229,11 +229,7 @@ class SlaOutputDev : public OutputDev
-
- //----- image drawing
- void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) override;
--#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
-- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) override;
--#else
-- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int *maskColors, GBool inlineImg) override;
--#endif
-+ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int *maskColors, GBool inlineImg) override;
- void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
- int width, int height,
- GfxImageColorMap *colorMap,
+
+ //----- image drawing
+ void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) override;
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) override;
+-#else
+- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int *maskColors, GBool inlineImg) override;
+-#endif
++ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int *maskColors, GBool inlineImg) override;
+ void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
@@ -265,13 +261,8 @@ class SlaOutputDev : public OutputDev
- //----- text drawing
- void beginTextObject(GfxState *state) override;
- void endTextObject(GfxState *state) override;
--#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
-- void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) override;
-- GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) override;
--#else
-- void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, const Unicode * /*u*/, int /*uLen*/) override;
-- GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, const Unicode * /*u*/, int /*uLen*/) override;
--#endif
-+ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
-+ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
- void endType3Char(GfxState * /*state*/) override;
- void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) override;
- void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;
+ //----- text drawing
+ void beginTextObject(GfxState *state) override;
+ void endTextObject(GfxState *state) override;
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+- void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) override;
+- GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) override;
+-#else
+- void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, const Unicode * /*u*/, int /*uLen*/) override;
+- GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, const Unicode * /*u*/, int /*uLen*/) override;
+-#endif
++ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
++ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
+ void endType3Char(GfxState * /*state*/) override;
+ void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) override;
+ void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;
diff --git a/Work-around-poppler-0.82-signature-changes.patch b/Work-around-poppler-0.82-signature-changes.patch
index af07b40..f77fb51 100644
--- a/Work-around-poppler-0.82-signature-changes.patch
+++ b/Work-around-poppler-0.82-signature-changes.patch
@@ -14,69 +14,69 @@ index 6094f3d9eb..f3d6446880 100644
--- a/scribus/plugins/import/pdf/slaoutput.cpp
+++ b/scribus/plugins/import/pdf/slaoutput.cpp
@@ -2784,7 +2784,11 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i
- delete[] mbuffer;
- }
-
--void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg)
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
-+void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int* maskColors, GBool inlineImg)
-+#else
-+void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int* maskColors, GBool inlineImg)
-+#endif
- {
- ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
- // qDebug() << "Image Components" << colorMap->getNumPixelComps() << "Mask" << maskColors;
+ delete[] mbuffer;
+ }
+
+-void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg)
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
++void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int* maskColors, GBool inlineImg)
++#else
++void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int* maskColors, GBool inlineImg)
++#endif
+ {
+ ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
+ // qDebug() << "Image Components" << colorMap->getNumPixelComps() << "Mask" << maskColors;
@@ -3365,7 +3369,11 @@ void SlaOutputDev::updateFont(GfxState *state)
- fontsrc->unref();
- }
-
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
- void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen)
-+#else
-+void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode *u, int uLen)
-+#endif
- {
- double x1, y1, x2, y2;
- int render;
+ fontsrc->unref();
+ }
+
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+ void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen)
++#else
++void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode *u, int uLen)
++#endif
+ {
+ double x1, y1, x2, y2;
+ int render;
@@ -3452,7 +3460,11 @@ void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, doub
- }
- }
-
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
- GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen)
-+#else
-+GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen)
-+#endif
- {
- // qDebug() << "beginType3Char";
- GfxFont *gfxFont;
+ }
+ }
+
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen)
++#else
++GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen)
++#endif
+ {
+ // qDebug() << "beginType3Char";
+ GfxFont *gfxFont;
diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
index bc4350a034..b5905184e5 100644
--- a/scribus/plugins/import/pdf/slaoutput.h
+++ b/scribus/plugins/import/pdf/slaoutput.h
@@ -229,7 +229,11 @@ class SlaOutputDev : public OutputDev
-
- //----- image drawing
- void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) override;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) override;
-+#else
-+ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int *maskColors, GBool inlineImg) override;
-+#endif
- void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
- int width, int height,
- GfxImageColorMap *colorMap,
+
+ //----- image drawing
+ void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) override;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) override;
++#else
++ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int *maskColors, GBool inlineImg) override;
++#endif
+ void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
@@ -261,8 +265,13 @@ class SlaOutputDev : public OutputDev
- //----- text drawing
- void beginTextObject(GfxState *state) override;
- void endTextObject(GfxState *state) override;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
- void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) override;
- GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) override;
-+#else
-+ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, const Unicode * /*u*/, int /*uLen*/) override;
-+ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, const Unicode * /*u*/, int /*uLen*/) override;
-+#endif
- void endType3Char(GfxState * /*state*/) override;
- void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) override;
- void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;
+ //----- text drawing
+ void beginTextObject(GfxState *state) override;
+ void endTextObject(GfxState *state) override;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0)
+ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) override;
+ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) override;
++#else
++ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, const Unicode * /*u*/, int /*uLen*/) override;
++ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, const Unicode * /*u*/, int /*uLen*/) override;
++#endif
+ void endType3Char(GfxState * /*state*/) override;
+ void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) override;
+ void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;
diff --git a/port-scripter-to-Python-3.patch b/port-scripter-to-Python-3.patch
index 1ea992f..33b811c 100644
--- a/port-scripter-to-Python-3.patch
+++ b/port-scripter-to-Python-3.patch
@@ -1,12 +1,71 @@
-From 3d1fe747ea7dd23cb099f5e93976f6de146cd250 Mon Sep 17 00:00:00 2001
+From 5d6944bb95ea60bbe6ba611b85e3bee3547139c4 Mon Sep 17 00:00:00 2001
From: Jean Ghali
Date: Sun, 27 Oct 2019 13:01:32 +0000
Subject: [PATCH] #15030 : port scripter to Python 3
git-svn-id: svn://scribus.net/trunk/Scribus@23278 11d20701-8431-0410-a711-e3c959e3b870
+---
+ CMakeLists.txt | 6 +-
+ doc/de/install2.html | 41 ++--
+ doc/de/scripter1.html | 3 +
+ doc/en/install2.html | 38 ++--
+ doc/en/scripter1.html | 4 +-
+ doc/fr/install2.html | 36 ++--
+ doc/it/scripter1.html | 6 +
+ scribus/main_win32.cpp | 4 +-
+ .../plugins/scriptplugin/cmdannotations.cpp | 46 ++---
+ scribus/plugins/scriptplugin/cmdcell.cpp | 8 +-
+ scribus/plugins/scriptplugin/cmdcolor.cpp | 2 +-
+ scribus/plugins/scriptplugin/cmddialog.cpp | 10 +-
+ scribus/plugins/scriptplugin/cmddoc.cpp | 18 +-
+ scribus/plugins/scriptplugin/cmdgetprop.cpp | 34 +--
+ .../plugins/scriptplugin/cmdgetsetprop.cpp | 43 ++--
+ scribus/plugins/scriptplugin/cmdmani.cpp | 27 +--
+ scribus/plugins/scriptplugin/cmdmisc.cpp | 31 ++-
+ scribus/plugins/scriptplugin/cmdobj.cpp | 41 ++--
+ scribus/plugins/scriptplugin/cmdpage.cpp | 6 +-
+ scribus/plugins/scriptplugin/cmdsetprop.cpp | 30 +--
+ scribus/plugins/scriptplugin/cmdstyle.cpp | 12 +-
+ scribus/plugins/scriptplugin/cmdtable.cpp | 8 +-
+ scribus/plugins/scriptplugin/cmdtext.cpp | 36 ++--
+ scribus/plugins/scriptplugin/cmdutil.cpp | 8 +
+ scribus/plugins/scriptplugin/cmdutil.h | 10 +-
+ scribus/plugins/scriptplugin/cmdvar.h | 11 +
+ .../plugins/scriptplugin/objimageexport.cpp | 27 ++-
+ scribus/plugins/scriptplugin/objpdffile.cpp | 174 ++++++++--------
+ scribus/plugins/scriptplugin/objprinter.cpp | 53 ++---
+ .../plugins/scriptplugin/samples/3columnA4.py | 8 +-
+ .../scriptplugin/samples/3columnUSLTR.py | 8 +-
+ .../plugins/scriptplugin/samples/Calender.py | 2 +-
+ .../scriptplugin/samples/ExtractText.py | 4 +-
+ .../plugins/scriptplugin/samples/Sample1.py | 2 +-
+ .../scriptplugin/samples/boilerplate.py | 6 +-
+ .../scriptplugin/samples/golden-mean.py | 2 +-
+ .../plugins/scriptplugin/samples/legende.py | 2 +-
+ .../samples/moins_10_pourcent_group.py | 2 +-
+ .../samples/plus_10_pourcent_group.py | 2 +-
+ .../scriptplugin/samples/pochette_cd.py | 2 +-
+ scribus/plugins/scriptplugin/samples/quote.py | 2 +-
+ .../scriptplugin/samples/sample_db_usage.py | 4 +-
+ .../scriptplugin/samples/trait_de_coupe.py | 2 +-
+ .../plugins/scriptplugin/samples/wordcount.py | 2 +-
+ scribus/plugins/scriptplugin/scriptercore.cpp | 35 ++--
+ scribus/plugins/scriptplugin/scriptplugin.cpp | 194 ++++++++++--------
+ .../scripts/Align_image_in_frame.py | 15 +-
+ .../scriptplugin/scripts/CalendarWizard.py | 44 ++--
+ .../plugins/scriptplugin/scripts/Caption.py | 4 +-
+ .../scriptplugin/scripts/ColorChart.py | 8 +-
+ .../scriptplugin/scripts/DirectImageImport.py | 6 +-
+ .../scriptplugin/scripts/FontSample.py | 76 +++----
+ .../plugins/scriptplugin/scripts/InfoBox.py | 6 +-
+ .../scriptplugin/scripts/Ligatursatz.py | 24 +--
+ .../plugins/scriptplugin/scripts/color2csv.py | 8 +-
+ .../plugins/scriptplugin/scripts/csv2color.py | 10 +-
+ .../scriptplugin/scripts/importcsv2table.py | 10 +-
+ 57 files changed, 670 insertions(+), 593 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 7385057e28..255aae06de 100644
+index 0cfa1d5..cd5c39f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -847,10 +847,10 @@ endif()
@@ -24,7 +83,7 @@ index 7385057e28..255aae06de 100644
set(COMPILE_PYTHON ON)
endif()
diff --git a/doc/de/install2.html b/doc/de/install2.html
-index e8ec3b8820..dd46fbd72a 100644
+index e8ec3b8..dd46fbd 100644
--- a/doc/de/install2.html
+++ b/doc/de/install2.html
@@ -3,36 +3,39 @@
@@ -87,10 +146,10 @@ index e8ec3b8820..dd46fbd72a 100644
Scribus läuft in jeder Desktopumgebung und benötigt kein KDE, aber Drag’n’drop funktioniert nur in KDE.
Falls das Farbmanagement nicht funktioniert, müssen Sie zusätzlich mindestens ein RGB- und ein CMYK-Profil installieren. Anderenfalls werden die Farbmanagement-Optionen ausgeblendet oder ausgegraut. Normalerweise installiert Scribus ein RGB- and ein CMYK-Profil, und zwar nur, um das Farbmanagement zu aktivieren, aber aufgrund ihrer Lizenzpolitik (v.a. Debian) befinden sich die Profile u.U. in einem separaten Paket.
diff --git a/doc/de/scripter1.html b/doc/de/scripter1.html
-index c3acdd06c0..78fba55d9a 100644
+index c3acdd0..78fba55 100644
--- a/doc/de/scripter1.html
+++ b/doc/de/scripter1.html
-@@ -14,6 +14,9 @@ Overview
+@@ -14,6 +14,9 @@
Note that additions to the Scripter are being made frequently, which means that the available documentation may be incomplete.
@@ -101,7 +160,7 @@ index c3acdd06c0..78fba55d9a 100644
Using the Plug-in
Scribus is being shipped with some “hard-wired” scripts, which are available via Scripter > Scribus Scripts:
diff --git a/doc/en/install2.html b/doc/en/install2.html
-index a02c4a771f..7762b5d8a6 100644
+index a02c4a7..7762b5d 100644
--- a/doc/en/install2.html
+++ b/doc/en/install2.html
@@ -10,32 +10,32 @@
@@ -157,10 +216,10 @@ index a02c4a771f..7762b5d8a6 100644
Scribus will run under almost any window manager and does not require KDE. However, drag and drop functionality will be lost without KDE.
If color management does not work, you also need at least one RGB profile and one CMYK profile installed or the color preferences and options will not appear in the menus. Scribus installs one RGB and one CMYK profile simply to enable color management, but some distributions, notably Debian, provide ICC profiles in separate packages, due to their licensing policy.
diff --git a/doc/en/scripter1.html b/doc/en/scripter1.html
-index 922e0cf9f6..78fba55d9a 100644
+index 922e0cf..78fba55 100644
--- a/doc/en/scripter1.html
+++ b/doc/en/scripter1.html
-@@ -15,8 +15,8 @@ Overview
+@@ -15,8 +15,8 @@
Note that additions to the Scripter are being made frequently, which means that the available documentation may be incomplete.
Scripter and Windows
@@ -172,7 +231,7 @@ index 922e0cf9f6..78fba55d9a 100644
Using the Plug-in
Scribus is being shipped with some “hard-wired” scripts, which are available via Scripter > Scribus Scripts:
diff --git a/doc/fr/install2.html b/doc/fr/install2.html
-index 1ff30ec699..8e802dd172 100644
+index 1ff30ec..8e802dd 100644
--- a/doc/fr/install2.html
+++ b/doc/fr/install2.html
@@ -7,19 +7,24 @@
@@ -210,7 +269,7 @@ index 1ff30ec699..8e802dd172 100644
Scribus s'exécutera sous la plupart des gestionnaires de fenêtres et ne requiert pas KDE en soi. Cependant, les fonctionnalités de glisser-déposer seront perdues sans KDE. Un des développeurs de Scribus roule sous Gnome. L'auteur de cette documentation s'est astreint à tester chaque version de Scribus sous Blackbox également.
L'opération n'a révélé aucune incompatibilité ni problème, mise à part la perte de la fonctionnalité glisser-déposer.
-@@ -32,13 +37,10 @@ Éléments requis
+@@ -32,13 +37,10 @@ CXXFLAGS="-march=athlon" serait bénéfique. V&eacu
pour des options détaillées
Optionnellement :
@@ -230,7 +289,7 @@ index 1ff30ec699..8e802dd172 100644