]>
Commit | Line | Data |
---|---|---|
1b7df6e5 JR |
1 | --- a/scribus/plugins/import/pdf/importpdf.cpp |
2 | +++ b/scribus/plugins/import/pdf/importpdf.cpp | |
3 | @@ -74,7 +74,11 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int flags) | |
4 | QImage PdfPlug::readThumbnail(const QString& fName)\r | |
5 | {\r | |
6 | QString pdfFile = QDir::toNativeSeparators(fName);\r | |
7 | +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
8 | + globalParams.reset(new GlobalParams());\r | |
9 | +#else\r | |
10 | globalParams = new GlobalParams();\r | |
11 | +#endif\r | |
12 | if (globalParams)\r | |
13 | {\r | |
14 | #if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)\r | |
15 | @@ -89,7 +93,9 @@ QImage PdfPlug::readThumbnail(const QString& fName) | |
16 | if (pdfDoc->getErrorCode() == errEncrypted)\r | |
17 | {\r | |
18 | delete pdfDoc;\r | |
19 | +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
20 | delete globalParams;\r | |
21 | +#endif\r | |
22 | return QImage();\r | |
23 | }\r | |
24 | if (pdfDoc->isOk())\r | |
25 | @@ -133,11 +139,15 @@ QImage PdfPlug::readThumbnail(const QString& fName) | |
26 | image.setText("YSize", QString("%1").arg(h));\r | |
27 | delete dev;\r | |
28 | delete pdfDoc;\r | |
29 | +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
30 | delete globalParams;\r | |
31 | +#endif\r | |
32 | return image;\r | |
33 | }\r | |
34 | delete pdfDoc;\r | |
35 | +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
36 | delete globalParams;\r | |
37 | +#endif\r | |
38 | }\r | |
39 | }\r | |
40 | return QImage();\r | |
41 | @@ -343,7 +353,11 @@ bool PdfPlug::convert(const QString& fn) | |
42 | qApp->processEvents();\r | |
43 | }\r | |
44 | \r | |
45 | +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
46 | + globalParams.reset(new GlobalParams());\r | |
47 | +#else\r | |
48 | globalParams = new GlobalParams();\r | |
49 | +#endif\r | |
50 | GooString *userPW = nullptr;\r | |
51 | if (globalParams)\r | |
52 | {\r | |
53 | @@ -385,7 +399,9 @@ bool PdfPlug::convert(const QString& fn) | |
54 | if (progressDialog)\r | |
55 | progressDialog->close();\r | |
56 | delete pdfDoc;\r | |
57 | +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
58 | delete globalParams;\r | |
59 | +#endif\r | |
60 | return false;\r | |
61 | }\r | |
62 | if (progressDialog)\r | |
63 | @@ -430,7 +446,9 @@ bool PdfPlug::convert(const QString& fn) | |
64 | progressDialog->close();\r | |
65 | delete optImp;\r | |
66 | delete pdfDoc;\r | |
67 | +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
68 | delete globalParams;\r | |
69 | +#endif\r | |
70 | return false;\r | |
71 | }\r | |
72 | pageString = optImp->getPagesString();\r | |
73 | @@ -843,8 +861,12 @@ bool PdfPlug::convert(const QString& fn) | |
74 | }\r | |
75 | delete pdfDoc;\r | |
76 | }\r | |
77 | +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
78 | + globalParams.release();\r | |
79 | +#else\r | |
80 | delete globalParams;\r | |
81 | globalParams = nullptr;\r | |
82 | +#endif\r | |
83 | \r | |
84 | // qDebug() << "converting finished";\r | |
85 | // qDebug() << "Imported" << Elements.count() << "Elements";\r | |
86 | diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h | |
87 | index 9913ee382..5a7e0d216 100644 | |
88 | --- a/scribus/plugins/import/pdf/importpdfconfig.h | |
89 | +++ b/scribus/plugins/import/pdf/importpdfconfig.h | |
90 | @@ -58,4 +58,10 @@ for which a new license (GPL+exception) is in place. | |
91 | #define POPPLER_CONST_082\r | |
92 | #endif\r | |
93 | \r | |
94 | +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)\r | |
95 | +#define POPPLER_CONST_083 const\r | |
96 | +#else\r | |
97 | +#define POPPLER_CONST_083\r | |
98 | +#endif\r | |
99 | +\r | |
100 | #endif\r | |
101 | diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp | |
102 | index 5e4d32a55..ffcfa8450 100644 | |
103 | --- a/scribus/plugins/import/pdf/slaoutput.cpp | |
104 | +++ b/scribus/plugins/import/pdf/slaoutput.cpp | |
105 | @@ -3678,7 +3678,7 @@ QString SlaOutputDev::getAnnotationColor(const AnnotColor *color) | |
106 | return fNam;\r | |
107 | }\r | |
108 | \r | |
109 | -QString SlaOutputDev::convertPath(GfxPath *path)\r | |
110 | +QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)\r | |
111 | {\r | |
112 | if (! path)\r | |
113 | return QString();\r | |
114 | @@ -3688,7 +3688,7 @@ QString SlaOutputDev::convertPath(GfxPath *path) | |
115 | \r | |
116 | for (int i = 0; i < path->getNumSubpaths(); ++i)\r | |
117 | {\r | |
118 | - GfxSubpath * subpath = path->getSubpath(i);\r | |
119 | + POPPLER_CONST_083 GfxSubpath * subpath = path->getSubpath(i);\r | |
120 | if (subpath->getNumPoints() > 0)\r | |
121 | {\r | |
122 | output += QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));\r | |
123 | diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h | |
124 | index 60fb90061..d928fada8 100644 | |
125 | --- a/scribus/plugins/import/pdf/slaoutput.h | |
126 | +++ b/scribus/plugins/import/pdf/slaoutput.h | |
127 | @@ -282,7 +282,7 @@ private: | |
128 | void getPenState(GfxState *state);\r | |
129 | QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);\r | |
130 | QString getAnnotationColor(const AnnotColor *color);\r | |
131 | - QString convertPath(GfxPath *path);\r | |
132 | + QString convertPath(POPPLER_CONST_083 GfxPath *path);\r | |
133 | int getBlendMode(GfxState *state);\r | |
134 | void applyMask(PageItem *ite);\r | |
135 | void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);\r | |
136 | --- a/scribus/plugins/import/pdf/slaoutput.cpp | |
137 | +++ b/scribus/plugins/import/pdf/slaoutput.cpp | |
138 | @@ -1189,6 +1189,11 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA) | |
139 | catalog = catA;\r | |
140 | pdfDoc = doc;\r | |
141 | updateGUICounter = 0;\r | |
142 | +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)\r | |
143 | + m_fontEngine = new SplashFontEngine(true, true, true, true);\r | |
144 | +#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 61, 0)\r | |
145 | + m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), true, true, true);\r | |
146 | +#else\r | |
147 | m_fontEngine = new SplashFontEngine(\r | |
148 | #if HAVE_T1LIB_H\r | |
149 | globalParams->getEnableT1lib(),\r | |
150 | @@ -1199,6 +1204,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA) | |
151 | true,\r | |
152 | #endif\r | |
153 | true);\r | |
154 | +#endif\r | |
155 | }\r | |
156 | \r | |
157 | void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)\r |