1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
--- calligra-3.1.0/filters/karbon/pdf/CMakeLists.txt.old 2020-01-13 11:57:23.529485941 +0000
+++ calligra-3.1.0/filters/karbon/pdf/CMakeLists.txt 2020-01-13 12:08:05.610601265 +0000
@@ -3,6 +3,10 @@
add_definitions("-DHAVE_POPPLER_PRE_0_82")
endif()
+if(Poppler_VERSION VERSION_LESS "0.83.0")
+ add_definitions("-DHAVE_POPPLER_PRE_0_83")
+endif()
+
set(pdf2svg_PART_SRCS PdfImportDebug.cpp PdfImport.cpp SvgOutputDev.cpp )
add_library(calligra_filter_pdf2svg MODULE ${pdf2svg_PART_SRCS})
--- calligra-3.1.0/filters/karbon/pdf/PdfImport.cpp.old 2020-01-13 10:34:30.622852616 +0000
+++ calligra-3.1.0/filters/karbon/pdf/PdfImport.cpp 2020-01-13 12:26:57.029441237 +0000
@@ -60,19 +60,31 @@
}
// read config file
+#ifdef HAVE_POPPLER_PRE_0_83
globalParams = new GlobalParams();
+#else
+ globalParams = std::unique_ptr<GlobalParams>(new GlobalParams());
+#endif
if (! globalParams)
return KoFilter::NotImplemented;
GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
if (! pdfDoc) {
+#ifdef HAVE_POPPLER_PRE_0_83
delete globalParams;
+#else
+ globalParams.reset();
+#endif
return KoFilter::StupidError;
}
if (! pdfDoc->isOk()) {
+#ifdef HAVE_POPPLER_PRE_0_83
delete globalParams;
+#else
+ globalParams.reset();
+#endif
delete pdfDoc;
return KoFilter::StupidError;
}
@@ -99,8 +111,12 @@
delete dev;
delete pdfDoc;
+#ifdef HAVE_POPPLER_PRE_0_83
delete globalParams;
globalParams = 0;
+#else
+ globalParams.reset();
+#endif
return KoFilter::OK;
}
--- calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.cpp.old 2020-01-13 11:57:43.537339118 +0000
+++ calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.cpp 2020-01-13 12:18:49.211663293 +0000
@@ -172,7 +172,11 @@
*d->body << "/>" << endl;
}
+#ifdef HAVE_POPPLER_PRE_0_83
QString SvgOutputDev::convertPath(GfxPath *path)
+#else
+QString SvgOutputDev::convertPath(const GfxPath *path)
+#endif
{
if (! path)
return QString();
@@ -180,7 +184,12 @@
QString output;
for (int i = 0; i < path->getNumSubpaths(); ++i) {
- GfxSubpath * subpath = path->getSubpath(i);
+#ifdef HAVE_POPPLER_PRE_0_83
+ GfxSubpath * subpath;
+#else
+ const GfxSubpath * subpath;
+#endif
+ subpath = path->getSubpath(i);
if (subpath->getNumPoints() > 0) {
output += QString("M%1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));
int j = 1;
--- calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.h.old 2020-01-13 11:57:23.529485941 +0000
+++ calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.h 2020-01-13 12:11:30.918610131 +0000
@@ -87,7 +87,11 @@
/// Dumps content to svg file
void dumpContent();
private:
+#ifdef HAVE_POPPLER_PRE_0_83
QString convertPath(GfxPath *path);
+#else
+ QString convertPath(const GfxPath *path);
+#endif
QString convertMatrix(const QMatrix &matrix);
QString convertMatrix(const double * matrix);
QString printFill();
|