diff --git a/scribus-1.5.6-poppler-0.84.0.patch b/scribus-1.5.6-poppler-0.84.0.patch new file mode 100644 index 0000000..3c44024 --- /dev/null +++ b/scribus-1.5.6-poppler-0.84.0.patch @@ -0,0 +1,157 @@ +--- 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) +@@ -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()) +@@ -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(); +@@ -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) + { +@@ -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) +@@ -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(); +@@ -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"; +diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h +index 9913ee382..5a7e0d216 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 +diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp +index 5e4d32a55..ffcfa8450 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(); +@@ -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)); +diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h +index 60fb90061..d928fada8 100644 +--- a/scribus/plugins/import/pdf/slaoutput.h ++++ b/scribus/plugins/import/pdf/slaoutput.h +@@ -282,7 +282,7 @@ private: + 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); +--- 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(), +@@ -1199,6 +1204,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA) + true, + #endif + true); ++#endif + } + + void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *) diff --git a/scribus.spec b/scribus.spec index 7318b36..b3abe2f 100644 --- a/scribus.spec +++ b/scribus.spec @@ -1,6 +1,6 @@ Name: scribus Version: 1.5.6 -Release: 0.3%{?dist} +Release: 0.4%{?dist} Summary: Desktop Publishing application written in Qt # swatches bring in the fun licenses License: GPLv2+ and OGL and CC0 and CC-BY and CC-BY-SA and Public Domain and ASL 2.0 and LGPLv2+ @@ -14,6 +14,7 @@ Source0: %{name}-%{version}-free.tar.xz #Source0: http://downloads.sourceforge.net/%%{name}/%%{name}-%%{version}.tar.xz #Source1: http://downloads.sourceforge.net/%%{name}/%%{name}-%%{version}.tar.xz.asc +Patch0: scribus-1.5.6-poppler-0.84.0.patch BuildRequires: boost-devel BuildRequires: cmake @@ -156,6 +157,9 @@ appstream-util validate-relax --nonet \ %changelog +* Fri Jan 17 2020 Marek Kasik - 1.5.6-0.4 +- Rebuild for poppler-0.84.0 + * Tue Nov 05 2019 Luya Tshimbalanga - 1.5.6-0.3 - Update to 1.5.6 pre-release (svn 23333)