summaryrefslogblamecommitdiff
path: root/user/calligra/poppler-83.patch
blob: e158ac4fff6702045bf627a47115344e5661c422 (plain) (tree)





































































































                                                                                                   
--- 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();