r23395 by jghali - #15985: Fix failure to build against poppler 0.83.0
scribus-commit
scribus-commit at lists.scribus.net
Wed Dec 4 05:51:19 UTC 2019
Author: jghali
Date: Wed Dec 4 05:51:19 2019
New Revision: 23395
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23395
Log:
#15985: Fix failure to build against poppler 0.83.0
Modified:
trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
trunk/Scribus/scribus/plugins/import/pdf/importpdfconfig.h
trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23395&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp Wed Dec 4 05:51:19 2019
@@ -74,7 +74,11 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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";
Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdfconfig.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23395&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdfconfig.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdfconfig.h (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdfconfig.h Wed Dec 4 05:51:19 2019
@@ -58,4 +58,10 @@
#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
Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23395&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Wed Dec 4 05:51:19 2019
@@ -3678,7 +3678,7 @@
return fNam;
}
-QString SlaOutputDev::convertPath(GfxPath *path)
+QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)
{
if (! path)
return QString();
@@ -3688,7 +3688,7 @@
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));
Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23395&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h Wed Dec 4 05:51:19 2019
@@ -282,7 +282,7 @@
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);
More information about the scribus-commit
mailing list