Unbreak the build with poppler-0.83.0.

To be committed right after poppler.

[AFAIK, rsadowski is on vaction, so tests from other people using
inkscape are welcome; you'll need the poppler diff I sent earlier
this day]

ok?

Index: patches/patch-src_extension_internal_pdfinput_pdf-input_cpp
===================================================================
RCS file: patches/patch-src_extension_internal_pdfinput_pdf-input_cpp
diff -N patches/patch-src_extension_internal_pdfinput_pdf-input_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_extension_internal_pdfinput_pdf-input_cpp 16 Dec 2019 
21:00:15 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Fix build with poppler-0.83.0.
+
+Index: src/extension/internal/pdfinput/pdf-input.cpp
+--- src/extension/internal/pdfinput/pdf-input.cpp.orig
++++ src/extension/internal/pdfinput/pdf-input.cpp
+@@ -689,12 +689,12 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/,
+         //
+         gchar const *poppler_datadir = g_getenv("POPPLER_DATADIR");
+         if (poppler_datadir != NULL) {
+-            globalParams = new GlobalParams(poppler_datadir);
++            globalParams = std::make_unique<GlobalParams>(poppler_datadir);
+         } else {
+-            globalParams = new GlobalParams();
++            globalParams = std::make_unique<GlobalParams>();
+         }
+ #else
+-        globalParams = new GlobalParams();
++        globalParams = std::make_unique<GlobalParams>();
+ #endif // ENABLE_OSX_APP_LOCATIONS
+     }
+ 
Index: patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp
===================================================================
RCS file: 
/cvs/ports/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp,v
retrieving revision 1.16
diff -u -p -r1.16 patch-src_extension_internal_pdfinput_pdf-parser_cpp
--- patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp        12 Nov 
2019 22:04:55 -0000      1.16
+++ patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp        16 Dec 
2019 21:00:15 -0000
@@ -2,11 +2,20 @@ $OpenBSD: patch-src_extension_internal_p
 
 Fix build with poppler-0.76. From archlinux.
 
-And with poppler-0.82.0.
+And with poppler-0.83.0.
 
 Index: src/extension/internal/pdfinput/pdf-parser.cpp
 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig
 +++ src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -272,7 +272,7 @@ class ClipHistoryEntry { (public)
+     ClipHistoryEntry *save();
+     ClipHistoryEntry *restore();
+     GBool hasSaves() { return saved != NULL; }
+-    void setClip(GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
++    void setClip(const GfxPath *newClipPath, GfxClipType newClipType = 
clipNormal);
+     GfxPath *getClipPath() { return clipPath; }
+     GfxClipType getClipType() { return clipType; }
+ 
 @@ -426,7 +426,7 @@ void PdfParser::parse(Object *obj, GBool topLevel) {
        error(errInternal, -1, "Weird page contents");
        return;
@@ -25,3 +34,12 @@ Index: src/extension/internal/pdfinput/p
    double x, y, dx, dy, tdx, tdy;
    double originX, originY, tOriginX, tOriginY;
    double oldCTM[6], newCTM[6];
+@@ -3394,7 +3394,7 @@ ClipHistoryEntry::~ClipHistoryEntry()
+     }
+ }
+ 
+-void ClipHistoryEntry::setClip(GfxPath *clipPathA, GfxClipType clipTypeA) {
++void ClipHistoryEntry::setClip(const GfxPath *clipPathA, GfxClipType 
clipTypeA) {
+     // Free previous clip path
+     if (clipPath) {
+         delete clipPath;
Index: patches/patch-src_extension_internal_pdfinput_svg-builder_cpp
===================================================================
RCS file: 
/cvs/ports/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-src_extension_internal_pdfinput_svg-builder_cpp
--- patches/patch-src_extension_internal_pdfinput_svg-builder_cpp       12 Nov 
2019 22:04:55 -0000      1.6
+++ patches/patch-src_extension_internal_pdfinput_svg-builder_cpp       16 Dec 
2019 21:00:15 -0000
@@ -1,10 +1,23 @@
 $OpenBSD: patch-src_extension_internal_pdfinput_svg-builder_cpp,v 1.6 
2019/11/12 22:04:55 kili Exp $
 
-Fix build against poppler-0.82.0.
+Fix build against poppler-0.83.0.
 
 Index: src/extension/internal/pdfinput/svg-builder.cpp
 --- src/extension/internal/pdfinput/svg-builder.cpp.orig
 +++ src/extension/internal/pdfinput/svg-builder.cpp
+@@ -264,10 +264,10 @@ static void svgSetTransform(Inkscape::XML::Node *node,
+ /**
+  * \brief Generates a SVG path string from poppler's data structure
+  */
+-static gchar *svgInterpretPath(GfxPath *path) {
++static gchar *svgInterpretPath(const GfxPath *path) {
+     Inkscape::SVG::PathString pathString;
+     for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) {
+-        GfxSubpath *subpath = path->getSubpath(i);
++        const GfxSubpath *subpath = path->getSubpath(i);
+         if (subpath->getNumPoints() > 0) {
+             pathString.moveTo(subpath->getX(0), subpath->getY(0));
+             int j = 1;
 @@ -1379,7 +1379,7 @@ void SvgBuilder::beginString(GfxState *state) {
  void SvgBuilder::addChar(GfxState *state, double x, double y,
                           double dx, double dy,

Reply via email to