blob: c704d7896e1f7e97554f0d6fe416ed81a96b81ba (
plain)
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
|
From 8f328bef497a9e3bc628e4e294c1a70b0c8b0eab Mon Sep 17 00:00:00 2001
From: foutrelis <foutrelis@eb2447ed-0c53-47e4-bac8-5bc4a241df78>
Date: Wed, 2 Mar 2022 10:28:24 +0000
Subject: [PATCH] Fix build with poppler 22.03.0
diff -uprw a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
--- a/filters/karbon/pdf/CMakeLists.txt 2020-05-14 09:51:30.000000000 +0300
+++ b/filters/karbon/pdf/CMakeLists.txt 2022-03-02 12:19:08.039939530 +0200
@@ -14,6 +14,10 @@ if(Poppler_VERSION VERSION_LESS "0.83.0"
add_definitions("-DHAVE_POPPLER_PRE_0_83")
endif()
+if(Poppler_VERSION VERSION_LESS "22.3.0")
+ add_definitions("-DHAVE_POPPLER_PRE_22_3")
+endif()
+
set(pdf2svg_PART_SRCS PdfImportDebug.cpp PdfImport.cpp SvgOutputDev.cpp )
add_library(calligra_filter_pdf2svg MODULE ${pdf2svg_PART_SRCS})
diff -uprw a/filters/karbon/pdf/Pdf2OdgImport.cpp b/filters/karbon/pdf/Pdf2OdgImport.cpp
--- a/filters/karbon/pdf/Pdf2OdgImport.cpp 2020-05-14 09:51:30.000000000 +0300
+++ b/filters/karbon/pdf/Pdf2OdgImport.cpp 2022-03-02 12:20:35.125605950 +0200
@@ -86,8 +86,12 @@ KoFilter::ConversionStatus Pdf2OdgImport
if (! globalParams)
return KoFilter::NotImplemented;
+#ifdef HAVE_POPPLER_PRE_22_3
GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
+#else
+ PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(m_chain->inputFile()).data()));
+#endif
if (! pdfDoc) {
#ifdef HAVE_POPPLER_PRE_0_83
delete globalParams;
diff -uprw a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
--- a/filters/karbon/pdf/PdfImport.cpp 2020-05-14 09:51:30.000000000 +0300
+++ b/filters/karbon/pdf/PdfImport.cpp 2022-03-02 12:21:46.197510028 +0200
@@ -73,8 +73,12 @@ KoFilter::ConversionStatus PdfImport::co
if (! globalParams)
return KoFilter::NotImplemented;
+#ifdef HAVE_POPPLER_PRE_22_3
GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
+#else
+ PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(m_chain->inputFile()).data()));
+#endif
if (! pdfDoc) {
#ifdef HAVE_POPPLER_PRE_0_83
delete globalParams;
|