|
|
@@ -1,18 +1,10 @@ |
|
|
From 691f1ceb388207bd990a58282782ca07bf6e6904 Mon Sep 17 00:00:00 2001 |
|
|
From f327995510c233822ae2b8751eea66cead967efe Mon Sep 17 00:00:00 2001 |
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com> |
|
|
Date: Thu, 3 May 2018 21:03:11 +1000 |
|
|
Subject: Fix build for Haiku |
|
|
|
|
|
Disable python and scriptplugin |
|
|
Add paths for Haiku |
|
|
--- |
|
|
CMakeLists.txt | 6 +++--- |
|
|
scribus/CMakeLists.txt | 2 +- |
|
|
scribus/plugins/CMakeLists.txt | 4 ++-- |
|
|
scribus/scpaths.cpp | 25 +++++++++++++++++++++++++ |
|
|
scribus/third_party/pgf/PGFplatform.h | 4 ++-- |
|
|
scribus/util_debug.cpp | 2 +- |
|
|
6 files changed, 34 insertions(+), 9 deletions(-) |
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt |
|
|
index 0862e48..3ac3c9c 100644 |
|
|
@@ -165,3 +157,785 @@ index 483a7dc..228614b 100644 |
|
|
-- |
|
|
2.21.0 |
|
|
|
|
|
|
|
|
From baea04052f11243914763d6ca4ed54d114eb0759 Mon Sep 17 00:00:00 2001 |
|
|
From: Jerome Duval <jerome.duval@gmail.com> |
|
|
Date: Fri, 3 May 2019 19:56:10 +0200 |
|
|
Subject: import poppler patchs from scribus team. |
|
|
|
|
|
|
|
|
diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp |
|
|
index c180286..a2aa5a7 100644 |
|
|
--- a/scribus/plugins/import/pdf/importpdf.cpp |
|
|
+++ b/scribus/plugins/import/pdf/importpdf.cpp |
|
|
@@ -556,10 +556,21 @@ bool PdfPlug::convert(const QString& fn) |
|
|
} |
|
|
else |
|
|
{ |
|
|
- GooList *ocgs; |
|
|
- int i; |
|
|
- ocgs = ocg->getOCGs (); |
|
|
- for (i = 0; i < ocgs->getLength (); ++i) |
|
|
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0) |
|
|
+ const auto& ocgs = ocg->getOCGs (); |
|
|
+ for (const auto& ocg : ocgs) |
|
|
+ { |
|
|
+ OptionalContentGroup *oc = ocg.second.get(); |
|
|
+ QString ocgName = UnicodeParsedString(oc->getName()); |
|
|
+ if (!ocgNames.contains(ocgName)) |
|
|
+ { |
|
|
+ ocgGroups.prepend(oc); |
|
|
+ ocgNames.append(ocgName); |
|
|
+ } |
|
|
+ } |
|
|
+#else |
|
|
+ GooList *ocgs = ocg->getOCGs (); |
|
|
+ for (int i = 0; i < ocgs->getLength (); ++i) |
|
|
{ |
|
|
OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i); |
|
|
QString ocgName = UnicodeParsedString(oc->getName()); |
|
|
@@ -569,15 +580,27 @@ bool PdfPlug::convert(const QString& fn) |
|
|
ocgNames.append(ocgName); |
|
|
} |
|
|
} |
|
|
+#endif |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
- GooList *ocgs; |
|
|
- int i; |
|
|
- ocgs = ocg->getOCGs (); |
|
|
- for (i = 0; i < ocgs->getLength (); ++i) |
|
|
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0) |
|
|
+ const auto& ocgs = ocg->getOCGs (); |
|
|
+ for (const auto& ocg : ocgs) |
|
|
+ { |
|
|
+ OptionalContentGroup *oc = ocg.second.get(); |
|
|
+ QString ocgName = UnicodeParsedString(oc->getName()); |
|
|
+ if (!ocgNames.contains(ocgName)) |
|
|
+ { |
|
|
+ ocgGroups.prepend(oc); |
|
|
+ ocgNames.append(ocgName); |
|
|
+ } |
|
|
+ } |
|
|
+#else |
|
|
+ GooList *ocgs = ocg->getOCGs (); |
|
|
+ for (int i = 0; i < ocgs->getLength (); ++i) |
|
|
{ |
|
|
OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i); |
|
|
QString ocgName = UnicodeParsedString(oc->getName()); |
|
|
@@ -587,6 +610,7 @@ bool PdfPlug::convert(const QString& fn) |
|
|
ocgNames.append(ocgName); |
|
|
} |
|
|
} |
|
|
+#endif |
|
|
} |
|
|
} |
|
|
} |
|
|
@@ -1081,7 +1105,7 @@ QRectF PdfPlug::getCBox(int box, int pgNum) |
|
|
return cRect; |
|
|
} |
|
|
|
|
|
-QString PdfPlug::UnicodeParsedString(GooString *s1) |
|
|
+QString PdfPlug::UnicodeParsedString(POPPLER_CONST GooString *s1) |
|
|
{ |
|
|
if ( !s1 || s1->getLength() == 0 ) |
|
|
return QString(); |
|
|
diff --git a/scribus/plugins/import/pdf/importpdf.h b/scribus/plugins/import/pdf/importpdf.h |
|
|
index c8c5efc..fbf607b 100644 |
|
|
--- a/scribus/plugins/import/pdf/importpdf.h |
|
|
+++ b/scribus/plugins/import/pdf/importpdf.h |
|
|
@@ -7,11 +7,6 @@ for which a new license (GPL+exception) is in place. |
|
|
#ifndef IMPORTPDF_H |
|
|
#define IMPORTPDF_H |
|
|
|
|
|
- |
|
|
-#include "pluginapi.h" |
|
|
-#include "pageitem.h" |
|
|
-#include "sccolor.h" |
|
|
-#include "fpointarray.h" |
|
|
#include <QList> |
|
|
#include <QTransform> |
|
|
#include <QMultiMap> |
|
|
@@ -26,6 +21,11 @@ for which a new license (GPL+exception) is in place. |
|
|
#include <QPen> |
|
|
#include <QImage> |
|
|
|
|
|
+#include "fpointarray.h" |
|
|
+#include "importpdfconfig.h" |
|
|
+#include "pluginapi.h" |
|
|
+#include "pageitem.h" |
|
|
+#include "sccolor.h" |
|
|
|
|
|
class QColor; |
|
|
class QMatrix; |
|
|
@@ -81,7 +81,7 @@ public: |
|
|
private: |
|
|
bool convert(const QString& fn); |
|
|
QRectF getCBox(int box, int pgNum); |
|
|
- QString UnicodeParsedString(GooString *s1); |
|
|
+ QString UnicodeParsedString(POPPLER_CONST GooString *s1); |
|
|
|
|
|
QList<PageItem*> Elements; |
|
|
double baseX, baseY; |
|
|
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp |
|
|
index be1815d..2e261e1 100644 |
|
|
--- a/scribus/plugins/import/pdf/slaoutput.cpp |
|
|
+++ b/scribus/plugins/import/pdf/slaoutput.cpp |
|
|
@@ -6,7 +6,7 @@ for which a new license (GPL+exception) is in place. |
|
|
*/ |
|
|
|
|
|
#include "slaoutput.h" |
|
|
-#include <poppler/cpp/poppler-version.h> |
|
|
+ |
|
|
#include <poppler/GlobalParams.h> |
|
|
#include <poppler/poppler-config.h> |
|
|
#include <poppler/FileSpec.h> |
|
|
@@ -20,12 +20,6 @@ for which a new license (GPL+exception) is in place. |
|
|
#include "util_math.h" |
|
|
#include <tiffio.h> |
|
|
|
|
|
-#define POPPLER_VERSION_ENCODE(major, minor, micro) ( \ |
|
|
- ((major) * 10000) \ |
|
|
- + ((minor) * 100) \ |
|
|
- + ((micro) * 1)) |
|
|
-#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO) |
|
|
- |
|
|
LinkSubmitForm::LinkSubmitForm(Object *actionObj) |
|
|
{ |
|
|
Object obj1, obj2, obj3; |
|
|
@@ -44,7 +38,7 @@ LinkSubmitForm::LinkSubmitForm(Object *actionObj) |
|
|
{ |
|
|
if (obj3.isName()) |
|
|
{ |
|
|
- char *name = obj3.getName(); |
|
|
+ POPPLER_CONST char *name = obj3.getName(); |
|
|
if (!strcmp(name, "URL")) |
|
|
{ |
|
|
obj2 = obj1.dictLookup("F"); |
|
|
@@ -508,8 +502,8 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do |
|
|
QString fileName = ""; |
|
|
if (act->getKind() == actionGoTo) |
|
|
{ |
|
|
- LinkGoTo *gto = (LinkGoTo*)act; |
|
|
- LinkDest *dst = gto->getDest(); |
|
|
+ LinkGoTo *gto = (LinkGoTo*) act; |
|
|
+ POPPLER_CONST LinkDest *dst = gto->getDest(); |
|
|
if (dst) |
|
|
{ |
|
|
if (dst->getKind() == destXYZ) |
|
|
@@ -528,7 +522,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do |
|
|
} |
|
|
else |
|
|
{ |
|
|
- GooString *ndst = gto->getNamedDest(); |
|
|
+ POPPLER_CONST GooString *ndst = gto->getNamedDest(); |
|
|
if (ndst) |
|
|
{ |
|
|
LinkDest *dstn = pdfDoc->findDest(ndst); |
|
|
@@ -555,7 +549,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do |
|
|
{ |
|
|
LinkGoToR *gto = (LinkGoToR*)act; |
|
|
fileName = UnicodeParsedString(gto->getFileName()); |
|
|
- LinkDest *dst = gto->getDest(); |
|
|
+ POPPLER_CONST LinkDest *dst = gto->getDest(); |
|
|
if (dst) |
|
|
{ |
|
|
if (dst->getKind() == destXYZ) |
|
|
@@ -568,7 +562,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do |
|
|
} |
|
|
else |
|
|
{ |
|
|
- GooString *ndst = gto->getNamedDest(); |
|
|
+ POPPLER_CONST GooString *ndst = gto->getNamedDest(); |
|
|
if (ndst) |
|
|
{ |
|
|
LinkDest *dstn = pdfDoc->findDest(ndst); |
|
|
@@ -709,7 +703,7 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, |
|
|
bool bgFound = false; |
|
|
if (achar) |
|
|
{ |
|
|
- AnnotColor *bgCol = achar->getBackColor(); |
|
|
+ POPPLER_CONST AnnotColor *bgCol = achar->getBackColor(); |
|
|
if (bgCol) |
|
|
{ |
|
|
bgFound = true; |
|
|
@@ -717,7 +711,7 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, |
|
|
} |
|
|
else |
|
|
CurrColorFill = CommonStrings::None; |
|
|
- AnnotColor *fgCol = achar->getBorderColor(); |
|
|
+ POPPLER_CONST AnnotColor *fgCol = achar->getBorderColor(); |
|
|
if (fgCol) |
|
|
{ |
|
|
fgFound = true; |
|
|
@@ -1054,7 +1048,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) |
|
|
int xco = 0; |
|
|
int yco = 0; |
|
|
LinkGoTo *gto = (LinkGoTo*)Lact; |
|
|
- LinkDest *dst = gto->getDest(); |
|
|
+ POPPLER_CONST LinkDest *dst = gto->getDest(); |
|
|
if (dst) |
|
|
{ |
|
|
if (dst->getKind() == destXYZ) |
|
|
@@ -1075,7 +1069,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) |
|
|
} |
|
|
else |
|
|
{ |
|
|
- GooString *ndst = gto->getNamedDest(); |
|
|
+ POPPLER_CONST GooString *ndst = gto->getNamedDest(); |
|
|
if (ndst) |
|
|
{ |
|
|
LinkDest *dstn = pdfDoc->findDest(ndst); |
|
|
@@ -1107,7 +1101,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) |
|
|
int yco = 0; |
|
|
LinkGoToR *gto = (LinkGoToR*)Lact; |
|
|
QString fileName = UnicodeParsedString(gto->getFileName()); |
|
|
- LinkDest *dst = gto->getDest(); |
|
|
+ POPPLER_CONST LinkDest *dst = gto->getDest(); |
|
|
if (dst) |
|
|
{ |
|
|
if (dst->getKind() == destXYZ) |
|
|
@@ -1123,7 +1117,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) |
|
|
} |
|
|
else |
|
|
{ |
|
|
- GooString *ndst = gto->getNamedDest(); |
|
|
+ POPPLER_CONST GooString *ndst = gto->getNamedDest(); |
|
|
if (ndst) |
|
|
{ |
|
|
LinkDest *dstn = pdfDoc->findDest(ndst); |
|
|
@@ -3002,6 +2996,14 @@ void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int widt |
|
|
if ((mm.type() == QTransform::TxShear) || (mm.type() == QTransform::TxRotate)) |
|
|
{ |
|
|
ite->setImageRotation(-tline.angle()); |
|
|
+ /*QTransform rotMat; |
|
|
+ rotMat.rotate(tline.angle()); |
|
|
+ QTransform imgMat = m_ctm * rotMat.inverted(); |
|
|
+ double scaleX = sqrt(imgMat.m11() * imgMat.m11() + imgMat.m12() * imgMat.m12()); |
|
|
+ double scaleY = sqrt(imgMat.m21() * imgMat.m21() + imgMat.m22() * imgMat.m22()); |
|
|
+ imgMat.scale(1.0 / scaleX, 1.0 / scaleY); |
|
|
+ if (!imgMat.isIdentity()) |
|
|
+ img = img.transformed(imgMat);*/ |
|
|
} |
|
|
else |
|
|
{ |
|
|
@@ -4032,7 +4034,7 @@ QString SlaOutputDev::getColor(GfxColorSpace *color_space, GfxColor *color, int |
|
|
return fNam; |
|
|
} |
|
|
|
|
|
-QString SlaOutputDev::getAnnotationColor(AnnotColor *color) |
|
|
+QString SlaOutputDev::getAnnotationColor(const AnnotColor *color) |
|
|
{ |
|
|
QString fNam; |
|
|
QString namPrefix = "FromPDF"; |
|
|
@@ -4252,7 +4254,7 @@ void SlaOutputDev::pushGroup(QString maskName, GBool forSoftMask, GBool alpha, b |
|
|
m_groupStack.push(gElements); |
|
|
} |
|
|
|
|
|
-QString SlaOutputDev::UnicodeParsedString(GooString *s1) |
|
|
+QString SlaOutputDev::UnicodeParsedString(POPPLER_CONST GooString *s1) |
|
|
{ |
|
|
if ( !s1 || s1->getLength() == 0 ) |
|
|
return QString(); |
|
|
diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h |
|
|
index 20e8b2d..888cd06 100644 |
|
|
--- a/scribus/plugins/import/pdf/slaoutput.h |
|
|
+++ b/scribus/plugins/import/pdf/slaoutput.h |
|
|
@@ -7,19 +7,21 @@ for which a new license (GPL+exception) is in place. |
|
|
#ifndef SLAOUTPUT_H |
|
|
#define SLAOUTPUT_H |
|
|
|
|
|
-#include <QString> |
|
|
-#include <QTextStream> |
|
|
-#include <QSizeF> |
|
|
#include <QBuffer> |
|
|
#include <QColor> |
|
|
#include <QBrush> |
|
|
-#include <QPen> |
|
|
+#include <QDebug> |
|
|
#include <QImage> |
|
|
+#include <QPen> |
|
|
#include <QList> |
|
|
-#include <QTransform> |
|
|
+#include <QSizeF> |
|
|
#include <QStack> |
|
|
-#include <QDebug> |
|
|
+#include <QString> |
|
|
+#include <QTextStream> |
|
|
+#include <QTransform> |
|
|
+ |
|
|
#include "fpointarray.h" |
|
|
+#include "importpdfconfig.h" |
|
|
#include "pageitem.h" |
|
|
#include "scribusdoc.h" |
|
|
#include "scribusview.h" |
|
|
@@ -61,9 +63,9 @@ public: |
|
|
// Destructor. |
|
|
virtual ~LinkSubmitForm(); |
|
|
// Was the LinkImportData created successfully? |
|
|
- virtual GBool isOk() { return fileName != NULL; } |
|
|
+ virtual GBool isOk() POPPLER_CONST { return fileName != NULL; } |
|
|
// Accessors. |
|
|
- virtual LinkActionKind getKind() { return actionUnknown; } |
|
|
+ virtual LinkActionKind getKind() POPPLER_CONST { return actionUnknown; } |
|
|
GooString *getFileName() { return fileName; } |
|
|
int getFlags() { return m_flags; } |
|
|
private: |
|
|
@@ -83,9 +85,9 @@ public: |
|
|
// Destructor. |
|
|
virtual ~LinkImportData(); |
|
|
// Was the LinkImportData created successfully? |
|
|
- virtual GBool isOk() { return fileName != NULL; } |
|
|
+ virtual GBool isOk() POPPLER_CONST { return fileName != NULL; } |
|
|
// Accessors. |
|
|
- virtual LinkActionKind getKind() { return actionUnknown; } |
|
|
+ virtual LinkActionKind getKind() POPPLER_CONST { return actionUnknown; } |
|
|
GooString *getFileName() { return fileName; } |
|
|
private: |
|
|
GooString *fileName; // file name |
|
|
@@ -98,7 +100,7 @@ class SplashOutFontFileID: public SplashFontFileID |
|
|
{ |
|
|
public: |
|
|
|
|
|
- SplashOutFontFileID(Ref *rA) { r = *rA; } |
|
|
+ SplashOutFontFileID(const Ref *rA) { r = *rA; } |
|
|
~SplashOutFontFileID() {} |
|
|
GBool matches(SplashFontFileID *id) |
|
|
{ |
|
|
@@ -146,6 +148,7 @@ class SlaOutputDev : public OutputDev |
|
|
public: |
|
|
SlaOutputDev(ScribusDoc* doc, QList<PageItem*> *Elements, QStringList *importedColors, int flags); |
|
|
virtual ~SlaOutputDev(); |
|
|
+ |
|
|
LinkAction* SC_getAction(AnnotWidget *ano); |
|
|
LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano); |
|
|
static GBool annotations_callback(Annot *annota, void *user_data); |
|
|
@@ -261,12 +264,12 @@ public: |
|
|
private: |
|
|
void getPenState(GfxState *state); |
|
|
QString getColor(GfxColorSpace *color_space, GfxColor *color, int *shade); |
|
|
- QString getAnnotationColor(AnnotColor *color); |
|
|
+ QString getAnnotationColor(const AnnotColor *color); |
|
|
QString convertPath(GfxPath *path); |
|
|
int getBlendMode(GfxState *state); |
|
|
void applyMask(PageItem *ite); |
|
|
void pushGroup(QString maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false); |
|
|
- QString UnicodeParsedString(GooString *s1); |
|
|
+ QString UnicodeParsedString(POPPLER_CONST GooString *s1); |
|
|
bool checkClip(); |
|
|
bool pathIsClosed; |
|
|
QString CurrColorFill; |
|
|
-- |
|
|
2.21.0 |
|
|
|
|
|
|
|
|
From f4e555b6603f9d32e62cf5e487e10705a8701a01 Mon Sep 17 00:00:00 2001 |
|
|
From: Jerome Duval <jerome.duval@gmail.com> |
|
|
Date: Fri, 3 May 2019 20:25:41 +0200 |
|
|
Subject: import patchs from arch linux for poppler 0.70=>0.76. |
|
|
|
|
|
|
|
|
diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp |
|
|
index a2aa5a7..da08dd4 100644 |
|
|
--- a/scribus/plugins/import/pdf/importpdf.cpp |
|
|
+++ b/scribus/plugins/import/pdf/importpdf.cpp |
|
|
@@ -461,7 +461,7 @@ bool PdfPlug::convert(const QString& fn) |
|
|
GBool useMediaBox = gTrue; |
|
|
GBool crop = gTrue; |
|
|
GBool printing = gFalse; |
|
|
- PDFRectangle *mediaBox = pdfDoc->getPage(1)->getMediaBox(); |
|
|
+ const PDFRectangle *mediaBox = pdfDoc->getPage(1)->getMediaBox(); |
|
|
QRectF mediaRect = QRectF(QPointF(mediaBox->x1, mediaBox->y1), QPointF(mediaBox->x2, mediaBox->y2)).normalized(); |
|
|
bool boxesAreDifferent = false; |
|
|
if (getCBox(Crop_Box, 1) != mediaRect) |
|
|
@@ -535,7 +535,7 @@ bool PdfPlug::convert(const QString& fn) |
|
|
if (orderItem.isDict()) |
|
|
{ |
|
|
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0) |
|
|
- Object ref = order->getNF(i); |
|
|
+ Object ref = order->getNF(i).copy(); |
|
|
#else |
|
|
Object ref; |
|
|
order->getNF(i, &ref); |
|
|
@@ -1090,7 +1090,7 @@ QImage PdfPlug::readPreview(int pgNum, int width, int height, int box) |
|
|
|
|
|
QRectF PdfPlug::getCBox(int box, int pgNum) |
|
|
{ |
|
|
- PDFRectangle *cBox = NULL; |
|
|
+ const PDFRectangle *cBox = NULL; |
|
|
if (box == Media_Box) |
|
|
cBox = m_pdfDoc->getPage(pgNum)->getMediaBox(); |
|
|
else if (box == Bleed_Box) |
|
|
diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h |
|
|
new file mode 100644 |
|
|
index 0000000..6213baf |
|
|
--- /dev/null |
|
|
+++ b/scribus/plugins/import/pdf/importpdfconfig.h |
|
|
@@ -0,0 +1,47 @@ |
|
|
+/* |
|
|
+For general Scribus (>=1.3.2) copyright and licensing information please refer |
|
|
+to the COPYING file provided with the program. Following this notice may exist |
|
|
+a copyright and/or license notice that predates the release of Scribus 1.3.2 |
|
|
+for which a new license (GPL+exception) is in place. |
|
|
+*/ |
|
|
+#ifndef IMPORTPDFCONFIG_H |
|
|
+#define IMPORTPDFCONFIG_H |
|
|
+ |
|
|
+#include <poppler/cpp/poppler-version.h> |
|
|
+ |
|
|
+#define POPPLER_VERSION_ENCODE(major, minor, micro) ( \ |
|
|
+ ((major) * 10000) \ |
|
|
+ + ((minor) * 100) \ |
|
|
+ + ((micro) * 1)) |
|
|
+#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO) |
|
|
+ |
|
|
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 64, 0) |
|
|
+#define POPPLER_CONST const |
|
|
+#else |
|
|
+#define POPPLER_CONST |
|
|
+#endif |
|
|
+ |
|
|
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 70, 0) |
|
|
+#define POPPLER_CONST_070 const |
|
|
+#else |
|
|
+#define POPPLER_CONST_070 |
|
|
+#endif |
|
|
+ |
|
|
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 71, 0) |
|
|
+#define GBool bool |
|
|
+#define gTrue true |
|
|
+#define gFalse false |
|
|
+#endif |
|
|
+ |
|
|
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 72, 0) |
|
|
+#define getCString c_str |
|
|
+#endif |
|
|
+ |
|
|
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 73, 0) |
|
|
+#define Guchar unsigned char |
|
|
+#define Gushort unsigned short |
|
|
+#define Guint unsigned int |
|
|
+#define Gulong unsigned long |
|
|
+#endif |
|
|
+ |
|
|
+#endif |
|
|
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp |
|
|
index 2e261e1..a85df1e 100644 |
|
|
--- a/scribus/plugins/import/pdf/slaoutput.cpp |
|
|
+++ b/scribus/plugins/import/pdf/slaoutput.cpp |
|
|
@@ -183,7 +183,7 @@ void AnoOutputDev::drawString(GfxState *state, GooString *s) |
|
|
m_itemText = s->copy(); |
|
|
} |
|
|
|
|
|
-QString AnoOutputDev::getColor(GfxColorSpace *color_space, GfxColor *color, int *shade) |
|
|
+QString AnoOutputDev::getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade) |
|
|
{ |
|
|
QString fNam; |
|
|
QString namPrefix = "FromPDF"; |
|
|
@@ -310,7 +310,7 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano) |
|
|
if (obj.isDict()) |
|
|
{ |
|
|
Dict* adic = obj.getDict(); |
|
|
- additionalActions = adic->lookupNF("A"); |
|
|
+ additionalActions = adic->lookupNF("A").copy(); |
|
|
Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef()); |
|
|
if (additionalActionsObject.isDict()) |
|
|
{ |
|
|
@@ -370,7 +370,7 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a |
|
|
if (obj.isDict()) |
|
|
{ |
|
|
Dict* adic = obj.getDict(); |
|
|
- additionalActions = adic->lookupNF("AA"); |
|
|
+ additionalActions = adic->lookupNF("AA").copy(); |
|
|
Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef()); |
|
|
if (additionalActionsObject.isDict()) |
|
|
{ |
|
|
@@ -511,7 +511,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do |
|
|
if (dst->isPageRef()) |
|
|
{ |
|
|
Ref dstr = dst->getPageRef(); |
|
|
- pagNum = pdfDoc->findPage(dstr.num, dstr.gen); |
|
|
+ pagNum = pdfDoc->findPage(dstr); |
|
|
} |
|
|
else |
|
|
pagNum = dst->getPageNum(); |
|
|
@@ -533,7 +533,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do |
|
|
if (dstn->isPageRef()) |
|
|
{ |
|
|
Ref dstr = dstn->getPageRef(); |
|
|
- pagNum = pdfDoc->findPage(dstr.num, dstr.gen); |
|
|
+ pagNum = pdfDoc->findPage(dstr); |
|
|
} |
|
|
else |
|
|
pagNum = dstn->getPageNum(); |
|
|
@@ -939,7 +939,7 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, |
|
|
QList<int> radList; |
|
|
for (int i = 0; i < obj2.arrayGetLength(); i++) |
|
|
{ |
|
|
- Object childRef = obj2.arrayGetNF(i); |
|
|
+ Object childRef = obj2.arrayGetNF(i).copy(); |
|
|
if (!childRef.isRef()) |
|
|
continue; |
|
|
Object childObj = obj2.arrayGet(i); |
|
|
@@ -1056,7 +1056,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) |
|
|
if (dst->isPageRef()) |
|
|
{ |
|
|
Ref dstr = dst->getPageRef(); |
|
|
- pagNum = pdfDoc->findPage(dstr.num, dstr.gen); |
|
|
+ pagNum = pdfDoc->findPage(dstr); |
|
|
} |
|
|
else |
|
|
pagNum = dst->getPageNum(); |
|
|
@@ -1080,7 +1080,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) |
|
|
if (dstn->isPageRef()) |
|
|
{ |
|
|
Ref dstr = dstn->getPageRef(); |
|
|
- pagNum = pdfDoc->findPage(dstr.num, dstr.gen); |
|
|
+ pagNum = pdfDoc->findPage(dstr); |
|
|
} |
|
|
else |
|
|
pagNum = dstn->getPageNum(); |
|
|
@@ -1598,7 +1598,7 @@ void SlaOutputDev::updateStrokeColor(GfxState *state) |
|
|
void SlaOutputDev::clip(GfxState *state) |
|
|
{ |
|
|
// qDebug() << "Clip"; |
|
|
- double *ctm; |
|
|
+ const double *ctm; |
|
|
ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
QString output = convertPath(state->getPath()); |
|
|
@@ -1635,7 +1635,7 @@ void SlaOutputDev::clip(GfxState *state) |
|
|
void SlaOutputDev::eoClip(GfxState *state) |
|
|
{ |
|
|
// qDebug() << "EoClip"; |
|
|
- double *ctm; |
|
|
+ const double *ctm; |
|
|
ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
QString output = convertPath(state->getPath()); |
|
|
@@ -1672,7 +1672,7 @@ void SlaOutputDev::eoClip(GfxState *state) |
|
|
void SlaOutputDev::stroke(GfxState *state) |
|
|
{ |
|
|
// qDebug() << "Stroke"; |
|
|
- double *ctm; |
|
|
+ const double *ctm; |
|
|
ctm = state->getCTM(); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
@@ -1764,7 +1764,7 @@ void SlaOutputDev::stroke(GfxState *state) |
|
|
void SlaOutputDev::fill(GfxState *state) |
|
|
{ |
|
|
// qDebug() << "Fill"; |
|
|
- double *ctm; |
|
|
+ const double *ctm; |
|
|
ctm = state->getCTM(); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
@@ -1809,7 +1809,7 @@ void SlaOutputDev::fill(GfxState *state) |
|
|
void SlaOutputDev::eoFill(GfxState *state) |
|
|
{ |
|
|
// qDebug() << "EoFill"; |
|
|
- double *ctm; |
|
|
+ const double *ctm; |
|
|
ctm = state->getCTM(); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
@@ -1858,14 +1858,14 @@ GBool SlaOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, d |
|
|
double GrEndX; |
|
|
double GrEndY; |
|
|
int shade = 100; |
|
|
- Function *func = shading->getFunc(0); |
|
|
+ POPPLER_CONST_070 Function *func = shading->getFunc(0); |
|
|
VGradient FillGradient = VGradient(VGradient::linear); |
|
|
FillGradient.clearStops(); |
|
|
GfxColorSpace *color_space = shading->getColorSpace(); |
|
|
if (func->getType() == 3) |
|
|
{ |
|
|
StitchingFunction *stitchingFunc = (StitchingFunction*)func; |
|
|
- double *bounds = stitchingFunc->getBounds(); |
|
|
+ const double *bounds = stitchingFunc->getBounds(); |
|
|
int num_funcs = stitchingFunc->getNumFuncs(); |
|
|
// Add stops from all the stitched functions |
|
|
for ( int i = 0 ; i < num_funcs ; i++ ) |
|
|
@@ -1899,8 +1899,7 @@ GBool SlaOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, d |
|
|
state->getClipBBox(&xmin, &ymin, &xmax, &ymax); |
|
|
QRectF crect = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax)); |
|
|
crect = crect.normalized(); |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
FPointArray gr; |
|
|
gr.addPoint(GrStartX, GrStartY); |
|
|
@@ -1969,14 +1968,14 @@ GBool SlaOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, |
|
|
double GrEndX; |
|
|
double GrEndY; |
|
|
int shade = 100; |
|
|
- Function *func = shading->getFunc(0); |
|
|
+ POPPLER_CONST_070 Function *func = shading->getFunc(0); |
|
|
VGradient FillGradient = VGradient(VGradient::linear); |
|
|
FillGradient.clearStops(); |
|
|
GfxColorSpace *color_space = shading->getColorSpace(); |
|
|
if (func->getType() == 3) |
|
|
{ |
|
|
StitchingFunction *stitchingFunc = (StitchingFunction*)func; |
|
|
- double *bounds = stitchingFunc->getBounds(); |
|
|
+ const double *bounds = stitchingFunc->getBounds(); |
|
|
int num_funcs = stitchingFunc->getNumFuncs(); |
|
|
// Add stops from all the stitched functions |
|
|
for ( int i = 0 ; i < num_funcs ; i++ ) |
|
|
@@ -2015,8 +2014,7 @@ GBool SlaOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, |
|
|
double GrFocalY = y1; |
|
|
GrEndX = GrFocalX + r1; |
|
|
GrEndY = GrFocalY; |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
FPointArray gr; |
|
|
gr.addPoint(GrStartX, GrStartY); |
|
|
@@ -2098,8 +2096,7 @@ GBool SlaOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangl |
|
|
output += QString("Z"); |
|
|
pathIsClosed = true; |
|
|
Coords = output; |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, CurrColorFill, CommonStrings::None); |
|
|
PageItem* ite = m_doc->Items->at(z); |
|
|
@@ -2179,8 +2176,7 @@ GBool SlaOutputDev::patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *sh |
|
|
output += QString("Z"); |
|
|
pathIsClosed = true; |
|
|
Coords = output; |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, CurrColorFill, CommonStrings::None); |
|
|
PageItem* ite = m_doc->Items->at(z); |
|
|
@@ -2205,7 +2201,7 @@ GBool SlaOutputDev::patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *sh |
|
|
for (int i = 0; i < shading->getNPatches(); i++) |
|
|
{ |
|
|
int shade = 100; |
|
|
- GfxPatch *patch = shading->getPatch(i); |
|
|
+ const GfxPatch *patch = shading->getPatch(i); |
|
|
GfxColor color; |
|
|
meshGradientPatch patchM; |
|
|
int u, v; |
|
|
@@ -2333,8 +2329,7 @@ GBool SlaOutputDev::tilingPatternFill(GfxState *state, Gfx * /*gfx*/, Catalog *c |
|
|
box.y1 = bbox[1]; |
|
|
box.x2 = bbox[2]; |
|
|
box.y2 = bbox[3]; |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
QTransform mm = QTransform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); |
|
|
QTransform mmx = mm * m_ctm; |
|
|
@@ -2506,8 +2501,7 @@ void SlaOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int |
|
|
t++; |
|
|
} |
|
|
} |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
QRectF crect = QRectF(0, 0, width, height); |
|
|
@@ -2652,8 +2646,7 @@ void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str |
|
|
t++; |
|
|
} |
|
|
} |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
QRectF crect = QRectF(0, 0, width, height); |
|
|
@@ -2802,8 +2795,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i |
|
|
t++; |
|
|
} |
|
|
} |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
QRectF crect = QRectF(0, 0, width, height); |
|
|
@@ -2967,8 +2959,7 @@ void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int widt |
|
|
delete image; |
|
|
return; |
|
|
} |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
QRectF crect = QRectF(0, 0, width, height); |
|
|
@@ -3328,7 +3319,7 @@ void SlaOutputDev::updateFont(GfxState *state) |
|
|
char *tmpBuf; |
|
|
int tmpBufLen = 0; |
|
|
int *codeToGID; |
|
|
- double *textMat; |
|
|
+ const double *textMat; |
|
|
double m11, m12, m21, m22, fontSize; |
|
|
SplashCoord mat[4]; |
|
|
int n = 0; |
|
|
@@ -3795,8 +3786,7 @@ void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, doub |
|
|
if (f & splashPathLast) |
|
|
qPath.closeSubpath(); |
|
|
} |
|
|
- double *ctm; |
|
|
- ctm = state->getCTM(); |
|
|
+ const double *ctm = state->getCTM(); |
|
|
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); |
|
|
double xCoor = m_doc->currentPage()->xOffset(); |
|
|
double yCoor = m_doc->currentPage()->yOffset(); |
|
|
@@ -3950,7 +3940,7 @@ void SlaOutputDev::endTextObject(GfxState *state) |
|
|
} |
|
|
} |
|
|
|
|
|
-QString SlaOutputDev::getColor(GfxColorSpace *color_space, GfxColor *color, int *shade) |
|
|
+QString SlaOutputDev::getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade) |
|
|
{ |
|
|
QString fNam; |
|
|
QString namPrefix = "FromPDF"; |
|
|
diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h |
|
|
index 888cd06..f948724 100644 |
|
|
--- a/scribus/plugins/import/pdf/slaoutput.h |
|
|
+++ b/scribus/plugins/import/pdf/slaoutput.h |
|
|
@@ -28,7 +28,9 @@ for which a new license (GPL+exception) is in place. |
|
|
#include "selection.h" |
|
|
#include "vgradient.h" |
|
|
|
|
|
+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0) |
|
|
#include <poppler/goo/gtypes.h> |
|
|
+#endif |
|
|
#include <poppler/Object.h> |
|
|
#include <poppler/OutputDev.h> |
|
|
#include <poppler/Gfx.h> |
|
|
@@ -137,7 +139,7 @@ public: |
|
|
GooString *m_fontName; |
|
|
GooString *m_itemText; |
|
|
private: |
|
|
- QString getColor(GfxColorSpace *color_space, GfxColor *color, int *shade); |
|
|
+ QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade); |
|
|
ScribusDoc* m_doc; |
|
|
QStringList *m_importedColors; |
|
|
}; |
|
|
@@ -263,7 +265,7 @@ public: |
|
|
|
|
|
private: |
|
|
void getPenState(GfxState *state); |
|
|
- QString getColor(GfxColorSpace *color_space, GfxColor *color, int *shade); |
|
|
+ QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade); |
|
|
QString getAnnotationColor(const AnnotColor *color); |
|
|
QString convertPath(GfxPath *path); |
|
|
int getBlendMode(GfxState *state); |
|
|
-- |
|
|
2.21.0 |
|
|
|