On 1/18/19 6:12 PM, Rafael Sadowski wrote:
Simple update to the latest stable version. All poppler patches merged
upstream.

Feedback and/or tests welcome.

This works very well for me on amd64.

The only problem i've found is overlapping text in the tutorials if the
liberation-fonts are not installed.
Making fonts/liberation-fonts a run dependency would solve this issue.
(To reproduce, uninstall liberation-fonts and choose
Help->Tutorials->Basic from the menu.)

According to port-lib-depends-check, 'WANTLIB += z' is missing.
Otherwise it looks good to me.



Rafael Sadowski


Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/inkscape/Makefile,v
retrieving revision 1.71
diff -u -p -u -p -r1.71 Makefile
--- Makefile    4 Sep 2018 12:46:14 -0000       1.71
+++ Makefile    18 Jan 2019 16:37:50 -0000
@@ -2,13 +2,11 @@
COMMENT = SVG vector drawing application -DISTNAME = inkscape-0.92.3
+DISTNAME =     inkscape-0.92.4
+
  CATEGORIES =  graphics
-REVISION =     3
-MASTER_SITES = https://media.inkscape.org/dl/resources/file/
  HOMEPAGE =    https://www.inkscape.org/
-EXTRACT_SUFX = .tar.bz2
MAINTAINER = Rafael Sadowski <rsadow...@openbsd.org> @@ -19,15 +17,18 @@ WANTLIB += ${COMPILER_LIBCXX} ICE Magick
  WANTLIB += MagickWand-6.Q16 SM X11 Xcomposite Xcursor Xdamage
  WANTLIB += Xext Xfixes Xi Xinerama Xrandr Xrender Xt aspell atk-1.0
  WANTLIB += atkmm-1.6 bz2 c cairo cairomm-1.0 djvulibre enchant
-WANTLIB += exif expat ffi fftw3 fontconfig freetype gc gdk-x11-2.0
-WANTLIB += gdk_pixbuf-2.0 gdkmm-2.4 gio-2.0 giomm-2.4 glib-2.0
-WANTLIB += glibmm-2.4 gmodule-2.0 gobject-2.0 graphite2 gsl gslcblas
-WANTLIB += gthread-2.0 gtk-x11-2.0 gtkmm-2.4 gtkspell harfbuzz
-WANTLIB += iconv intl jasper jbig jpeg lcms2 lzma m openjp2 pango-1.0
-WANTLIB += pangocairo-1.0 pangoft2-1.0 pangomm-1.4 pcre pixman-1
-WANTLIB += png poppler poppler-glib popt potrace raw_r sigc-2.0
-WANTLIB += tiff webp webpmux xcb xcb-render xcb-shm xml2 xslt
-WANTLIB += z
+WANTLIB += exif expat ffi fftw3 fontconfig freetype fribidi gc
+WANTLIB += gdk-x11-2.0 gdk_pixbuf-2.0 gdkmm-2.4 gio-2.0 giomm-2.4
+WANTLIB += glib-2.0 glibmm-2.4 gmodule-2.0 gobject-2.0 graphite2
+WANTLIB += gsl gslcblas gthread-2.0 gtk-x11-2.0 gtkmm-2.4 gtkspell
+WANTLIB += harfbuzz iconv intl jasper jbig jpeg lcms2 lzma m openjp2
+WANTLIB += pango-1.0 pangocairo-1.0 pangoft2-1.0 pangomm-1.4 pcre
+WANTLIB += pixman-1 png16 poppler poppler-glib popt potrace raw_r
+WANTLIB += sigc-2.0 tiff webp webpmux xcb xcb-render xcb-shm xml2
+WANTLIB += xslt
+
+MASTER_SITES = https://media.inkscape.org/dl/resources/file/
+EXTRACT_SUFX = .tar.bz2
MODULES= textproc/intltool \
                lang/python \
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/inkscape/distinfo,v
retrieving revision 1.14
diff -u -p -u -p -r1.14 distinfo
--- distinfo    15 Mar 2018 15:59:19 -0000      1.14
+++ distinfo    18 Jan 2019 16:37:50 -0000
@@ -1,2 +1,2 @@
-SHA256 (inkscape-0.92.3.tar.bz2) = BjKWwFpl16kqD2J0hbZiIUh6z8ZKJPcS61I3xL14FrI=
-SIZE (inkscape-0.92.3.tar.bz2) = 31606442
+SHA256 (inkscape-0.92.4.tar.bz2) = V+wtqBd7NmFKUT4oIu/XOvch5pD33ca9Cl+7FSW0UV4=
+SIZE (inkscape-0.92.4.tar.bz2) = 31929728
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
--- patches/patch-src_extension_internal_pdfinput_pdf-input_cpp 4 Jan 2019 
21:09:06 -0000       1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-src_extension_internal_pdfinput_pdf-input_cpp,v 1.3 2019/01/04 
21:09:06 kili Exp $
-
-Fix with new poppler. From archlinux.
-
-Index: src/extension/internal/pdfinput/pdf-input.cpp
---- src/extension/internal/pdfinput/pdf-input.cpp.orig
-+++ src/extension/internal/pdfinput/pdf-input.cpp
-@@ -793,7 +793,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/,
-             dlg->getImportSettings(prefs);
-
-         // Apply crop settings
--        PDFRectangle *clipToBox = NULL;
-+        _POPPLER_CONST PDFRectangle *clipToBox = NULL;
-         double crop_setting;
-         sp_repr_get_double(prefs, "cropTo", &crop_setting);
-
Index: patches/patch-src_extension_internal_pdfinput_pdf-input_h
===================================================================
RCS file: patches/patch-src_extension_internal_pdfinput_pdf-input_h
diff -N patches/patch-src_extension_internal_pdfinput_pdf-input_h
--- patches/patch-src_extension_internal_pdfinput_pdf-input_h   4 Jan 2019 
21:09:06 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_extension_internal_pdfinput_pdf-input_h,v 1.1 2019/01/04 
21:09:06 kili Exp $
-
-Fix with new poppler. From archlinux.
-
-Index: src/extension/internal/pdfinput/pdf-input.h
---- src/extension/internal/pdfinput/pdf-input.h.orig
-+++ src/extension/internal/pdfinput/pdf-input.h
-@@ -15,6 +15,7 @@
- #endif
-
- #ifdef HAVE_POPPLER
-+#include "poppler-transition-api.h"
-
- #include <gtkmm/dialog.h>
-
Index: patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp
===================================================================
RCS file: patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp
diff -N patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp
--- patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp        4 Jan 
2019 21:09:06 -0000       1.13
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,184 +0,0 @@
-$OpenBSD: patch-src_extension_internal_pdfinput_pdf-parser_cpp,v 1.13 
2019/01/04 21:09:06 kili Exp $
-
-Fix with new poppler. From archlinux.
-
-Index: src/extension/internal/pdfinput/pdf-parser.cpp
---- src/extension/internal/pdfinput/pdf-parser.cpp.orig
-+++ src/extension/internal/pdfinput/pdf-parser.cpp
-@@ -36,9 +36,9 @@ extern "C" {
- #include "pdf-parser.h"
- #include "util/units.h"
-
-+#include "glib/poppler-features.h"
- #include "goo/gmem.h"
--#include "goo/GooTimer.h"
--#include "goo/GooHash.h"
-+#include "goo/GooString.h"
- #include "GlobalParams.h"
- #include "CharTypes.h"
- #include "Object.h"
-@@ -295,8 +295,8 @@ PdfParser::PdfParser(XRef *xrefA,
-                      int /*pageNum*/,
-                    int rotate,
-                    Dict *resDict,
--                     PDFRectangle *box,
--                   PDFRectangle *cropBox) :
-+                     _POPPLER_CONST PDFRectangle *box,
-+                     _POPPLER_CONST PDFRectangle *cropBox) :
-     xref(xrefA),
-     builder(builderA),
-     subPage(gFalse),
-@@ -318,7 +318,7 @@ PdfParser::PdfParser(XRef *xrefA,
-   builder->setDocumentSize(Inkscape::Util::Quantity::convert(state->getPageWidth(), 
"pt", "px"),
-                            Inkscape::Util::Quantity::convert(state->getPageHeight(), 
"pt", "px"));
-
--  double *ctm = state->getCTM();
-+  const double *ctm = state->getCTM();
-   double scaledCTM[6];
-   for (int i = 0; i < 6; ++i) {
-     baseMatrix[i] = ctm[i];
-@@ -353,7 +353,7 @@ PdfParser::PdfParser(XRef *xrefA,
- PdfParser::PdfParser(XRef *xrefA,
-                    Inkscape::Extension::Internal::SvgBuilder *builderA,
-                      Dict *resDict,
--                   PDFRectangle *box) :
-+                   _POPPLER_CONST PDFRectangle *box) :
-     xref(xrefA),
-     builder(builderA),
-     subPage(gTrue),
-@@ -572,7 +572,7 @@ const char *PdfParser::getPreviousOperator(unsigned in
-
- void PdfParser::execOp(Object *cmd, Object args[], int numArgs) {
-   PdfOperator *op;
--  char *name;
-+  const char *name;
-   Object *argPtr;
-   int i;
-
-@@ -620,7 +620,7 @@ void PdfParser::execOp(Object *cmd, Object args[], int
-   (this->*op->func)(argPtr, numArgs);
- }
-
--PdfOperator* PdfParser::findOp(char *name) {
-+PdfOperator* PdfParser::findOp(const char *name) {
-   int a = -1;
-   int b = numOps;
-   int cmp = -1;
-@@ -1752,7 +1752,7 @@ void PdfParser::doShadingPatternFillFallback(GfxShadin
-                                              GBool stroke, GBool eoFill) {
-   GfxShading *shading;
-   GfxPath *savedPath;
--  double *ctm, *btm, *ptm;
-+  const double *ctm, *btm, *ptm;
-   double m[6], ictm[6], m1[6];
-   double xMin, yMin, xMax, yMax;
-   double det;
-@@ -1994,7 +1994,7 @@ void PdfParser::doFunctionShFill1(GfxFunctionShading *
-   GfxColor color0M, color1M, colorM0, colorM1, colorMM;
-   GfxColor colors2[4];
-   double functionColorDelta = colorDeltas[pdfFunctionShading-1];
--  double *matrix;
-+  const double *matrix;
-   double xM, yM;
-   int nComps, i, j;
-
-@@ -2174,7 +2174,7 @@ void PdfParser::doPatchMeshShFill(GfxPatchMeshShading
-   }
- }
-
--void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) {
-+void PdfParser::fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int 
depth) {
-   GfxPatch patch00 = blankPatch();
-   GfxPatch patch01 = blankPatch();
-   GfxPatch patch10 = blankPatch();
-@@ -2582,7 +2582,11 @@ void PdfParser::opShowSpaceText(Object args[], int /*n
-   }
- }
-
-+#if POPPLER_CHECK_VERSION(0,64,0)
-+void PdfParser::doShowText(const GooString *s) {
-+#else
- void PdfParser::doShowText(GooString *s) {
-+#endif
-   GfxFont *font;
-   int wMode;
-   double riseX, riseY;
-@@ -2591,17 +2595,21 @@ void PdfParser::doShowText(GooString *s) {
-   double x, y, dx, dy, tdx, tdy;
-   double originX, originY, tOriginX, tOriginY;
-   double oldCTM[6], newCTM[6];
--  double *mat;
-+  const double *mat;
-   Object charProc;
-   Dict *resDict;
-   Parser *oldParser;
-+#if POPPLER_CHECK_VERSION(0,64,0)
-+  const char *p;
-+#else
-   char *p;
-+#endif
-   int len, n, uLen;
-
-   font = state->getFont();
-   wMode = font->getWMode();
-
--  builder->beginString(state, s);
-+  builder->beginString(state);
-
-   // handle a Type 3 char
-   if (font->getType() == fontType3 && 0) {//out->interpretType3Chars()) {
-@@ -2732,7 +2740,11 @@ void PdfParser::opXObject(Object args[], int /*numArgs
- {
-   Object obj1, obj2, obj3, refObj;
-
-+#if POPPLER_CHECK_VERSION(0,64,0)
-+  const char *name = args[0].getName();
-+#else
-   char *name = args[0].getName();
-+#endif
- #if defined(POPPLER_NEW_OBJECT_API)
-   if ((obj1 = res->lookupXObject(name)).isNull()) {
- #else
-@@ -3657,7 +3669,6 @@ void PdfParser::opBeginImage(Object /*args*/[], int /*
- Stream *PdfParser::buildImageStream() {
-   Object dict;
-   Object obj;
--  char *key;
-   Stream *str;
-
-   // build dictionary
-@@ -3675,26 +3686,17 @@ Stream *PdfParser::buildImageStream() {
-       obj.free();
- #endif
-     } else {
--      key = copyString(obj.getName());
--#if defined(POPPLER_NEW_OBJECT_API)
--      obj = parser->getObj();
--#else
--      obj.free();
--      parser->getObj(&obj);
--#endif
--      if (obj.isEOF() || obj.isError()) {
--      gfree(key);
-+      Object obj2;
-+      _POPPLER_CALL(obj2, parser->getObj);
-+      if (obj2.isEOF() || obj2.isError()) {
-+        _POPPLER_FREE(obj);
-       break;
-       }
--#if defined(POPPLER_NEW_OBJECT_API)
--      dict.dictAdd(key, std::move(obj));
-+      _POPPLER_DICTADD(dict, obj.getName(), obj2);
-+      _POPPLER_FREE(obj);
-+      _POPPLER_FREE(obj2);
-     }
--    obj = parser->getObj();
--#else
--      dict.dictAdd(key, &obj);
--    }
--    parser->getObj(&obj);
--#endif
-+    _POPPLER_CALL(obj, parser->getObj);
-   }
-   if (obj.isEOF()) {
-     error(errSyntaxError, getPos(), "End of file in inline image");
Index: patches/patch-src_extension_internal_pdfinput_pdf-parser_h
===================================================================
RCS file: patches/patch-src_extension_internal_pdfinput_pdf-parser_h
diff -N patches/patch-src_extension_internal_pdfinput_pdf-parser_h
--- patches/patch-src_extension_internal_pdfinput_pdf-parser_h  4 Jan 2019 
21:09:06 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,72 +0,0 @@
-$OpenBSD: patch-src_extension_internal_pdfinput_pdf-parser_h,v 1.1 2019/01/04 
21:09:06 kili Exp $
-
-Fix with new poppler. From archlinux and upstream.
-
-Index: src/extension/internal/pdfinput/pdf-parser.h
---- src/extension/internal/pdfinput/pdf-parser.h.orig
-+++ src/extension/internal/pdfinput/pdf-parser.h
-@@ -9,6 +9,7 @@
- #define PDF_PARSER_H
-
- #ifdef HAVE_POPPLER
-+#include "poppler-transition-api.h"
-
- #ifdef USE_GCC_PRAGMAS
- #pragma interface
-@@ -25,7 +26,7 @@ namespace Inkscape {
- // TODO clean up and remove using:
- using Inkscape::Extension::Internal::SvgBuilder;
-
--#include "goo/gtypes.h"
-+#include "glib/poppler-features.h"
- #include "Object.h"
-
- class GooString;
-@@ -127,11 +128,14 @@ class PdfParser { (public)
-
-   // Constructor for regular output.
-   PdfParser(XRef *xrefA, SvgBuilder *builderA, int pageNum, int rotate,
--            Dict *resDict, PDFRectangle *box, PDFRectangle *cropBox);
-+            Dict *resDict,
-+            _POPPLER_CONST PDFRectangle *box,
-+            _POPPLER_CONST PDFRectangle *cropBox);
-
-   // Constructor for a sub-page object.
-   PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *builderA,
--            Dict *resDict, PDFRectangle *box);
-+            Dict *resDict,
-+            _POPPLER_CONST PDFRectangle *box);
-
-   virtual ~PdfParser();
-
-@@ -185,7 +189,7 @@ class PdfParser { (public)
-
-   void go(GBool topLevel);
-   void execOp(Object *cmd, Object args[], int numArgs);
--  PdfOperator *findOp(char *name);
-+  PdfOperator *findOp(const char *name);
-   GBool checkArg(Object *arg, TchkType type);
-   int getPos();
-
-@@ -256,7 +260,7 @@ class PdfParser { (public)
-                          double x2, double y2, GfxColor *color2,
-                          int nComps, int depth);
-   void doPatchMeshShFill(GfxPatchMeshShading *shading);
--  void fillPatch(GfxPatch *patch, int nComps, int depth);
-+  void fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth);
-   void doEndPath();
-
-   // path clipping operators
-@@ -287,7 +291,12 @@ class PdfParser { (public)
-   void opMoveShowText(Object args[], int numArgs);
-   void opMoveSetShowText(Object args[], int numArgs);
-   void opShowSpaceText(Object args[], int numArgs);
-+#if POPPLER_CHECK_VERSION(0,64,0)
-+  void doShowText(const GooString *s);
-+#else
-   void doShowText(GooString *s);
-+#endif
-+
-
-   // XObject operators
-   void opXObject(Object args[], int numArgs);
Index: patches/patch-src_extension_internal_pdfinput_poppler-transition-api_h
===================================================================
RCS file: patches/patch-src_extension_internal_pdfinput_poppler-transition-api_h
diff -N patches/patch-src_extension_internal_pdfinput_poppler-transition-api_h
--- patches/patch-src_extension_internal_pdfinput_poppler-transition-api_h      
4 Jan 2019 21:09:06 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,57 +0,0 @@
-$OpenBSD: patch-src_extension_internal_pdfinput_poppler-transition-api_h,v 1.1 
2019/01/04 21:09:06 kili Exp $
-
-Fix with new poppler. From archlinux and upstream.
-
-Index: src/extension/internal/pdfinput/poppler-transition-api.h
---- src/extension/internal/pdfinput/poppler-transition-api.h.orig
-+++ src/extension/internal/pdfinput/poppler-transition-api.h
-@@ -0,0 +1,49 @@
-+#ifndef SEEN_POPPLER_TRANSITION_API_H
-+#define SEEN_POPPLER_TRANSITION_API_H
-+
-+#include <glib/poppler-features.h>
-+
-+#if POPPLER_CHECK_VERSION(0, 72, 0)
-+#define getCString c_str
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0,71,0)
-+typedef bool GBool;
-+#define gTrue true
-+#define gFalse false
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0,70,0)
-+#define _POPPLER_CONST const
-+#else
-+#define _POPPLER_CONST
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0,69,0)
-+#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(key, std::move(obj))
-+#elif POPPLER_CHECK_VERSION(0,58,0)
-+#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(copyString(key), 
std::move(obj))
-+#else
-+#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(copyString(key), &obj)
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0,58,0)
-+#define POPPLER_NEW_OBJECT_API
-+#define _POPPLER_FREE(obj)
-+#define _POPPLER_CALL(ret, func) (ret = func())
-+#define _POPPLER_CALL_ARGS(ret, func, ...) (ret = func(__VA_ARGS__))
-+#else
-+#define _POPPLER_FREE(obj) (obj).free()
-+#define _POPPLER_CALL(ret, func) (*func(&ret))
-+#define _POPPLER_CALL_ARGS(ret, func, ...) (*func(__VA_ARGS__, &ret))
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0, 29, 0)
-+#define POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0, 25, 0)
-+#define POPPLER_EVEN_NEWER_COLOR_SPACE_API
-+#endif
-+
-+#endif
Index: patches/patch-src_extension_internal_pdfinput_svg-builder_cpp
===================================================================
RCS file: patches/patch-src_extension_internal_pdfinput_svg-builder_cpp
diff -N patches/patch-src_extension_internal_pdfinput_svg-builder_cpp
--- patches/patch-src_extension_internal_pdfinput_svg-builder_cpp       4 Jan 
2019 21:09:06 -0000       1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,119 +0,0 @@
-$OpenBSD: patch-src_extension_internal_pdfinput_svg-builder_cpp,v 1.4 
2019/01/04 21:09:06 kili Exp $
-
-Fix with new poppler. From archlinux.
-
-Index: src/extension/internal/pdfinput/svg-builder.cpp
---- src/extension/internal/pdfinput/svg-builder.cpp.orig
-+++ src/extension/internal/pdfinput/svg-builder.cpp
-@@ -625,7 +625,7 @@ gchar *SvgBuilder::_createPattern(GfxPattern *pattern,
-     if ( pattern != NULL ) {
-         if ( pattern->getType() == 2 ) {  // Shading pattern
-             GfxShadingPattern *shading_pattern = static_cast<GfxShadingPattern 
*>(pattern);
--            double *ptm;
-+            const double *ptm;
-             double m[6] = {1, 0, 0, 1, 0, 0};
-             double det;
-
-@@ -672,7 +672,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPatte
-
-     Inkscape::XML::Node *pattern_node = 
_xml_doc->createElement("svg:pattern");
-     // Set pattern transform matrix
--    double *p2u = tiling_pattern->getMatrix();
-+    const double *p2u = tiling_pattern->getMatrix();
-     double m[6] = {1, 0, 0, 1, 0, 0};
-     double det;
-     det = _ttm[0] * _ttm[3] - _ttm[1] * _ttm[2];    // see LP Bug 1168908
-@@ -698,7 +698,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPatte
-     pattern_node->setAttribute("patternUnits", "userSpaceOnUse");
-     // Set pattern tiling
-     // FIXME: don't ignore XStep and YStep
--    double *bbox = tiling_pattern->getBBox();
-+    const double *bbox = tiling_pattern->getBBox();
-     sp_repr_set_svg_double(pattern_node, "x", 0.0);
-     sp_repr_set_svg_double(pattern_node, "y", 0.0);
-     sp_repr_set_svg_double(pattern_node, "width", bbox[2] - bbox[0]);
-@@ -751,7 +751,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPatte
-  */
- gchar *SvgBuilder::_createGradient(GfxShading *shading, double *matrix, bool 
for_shading) {
-     Inkscape::XML::Node *gradient;
--    Function *func;
-+    _POPPLER_CONST Function *func;
-     int num_funcs;
-     bool extend0, extend1;
-
-@@ -865,7 +865,7 @@ static bool svgGetShadingColorRGB(GfxShading *shading,
-
- #define INT_EPSILON 8
- bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading 
*shading,
--                                   Function *func) {
-+                                   _POPPLER_CONST Function *func) {
-     int type = func->getType();
-     if ( type == 0 || type == 2 ) {  // Sampled or exponential function
-         GfxRGB stop1, stop2;
-@@ -877,9 +877,9 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node
-             _addStopToGradient(gradient, 1.0, &stop2, 1.0);
-         }
-     } else if ( type == 3 ) { // Stitching
--        StitchingFunction *stitchingFunc = 
static_cast<StitchingFunction*>(func);
--        double *bounds = stitchingFunc->getBounds();
--        double *encode = stitchingFunc->getEncode();
-+        auto stitchingFunc = static_cast<_POPPLER_CONST 
StitchingFunction*>(func);
-+        const double *bounds = stitchingFunc->getBounds();
-+        const double *encode = stitchingFunc->getEncode();
-         int num_funcs = stitchingFunc->getNumFuncs();
-
-         // Add stops from all the stitched functions
-@@ -890,7 +890,7 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node
-             svgGetShadingColorRGB(shading, bounds[i + 1], &color);
-             // Add stops
-             if (stitchingFunc->getFunc(i)->getType() == 2) {    // process 
exponential fxn
--                double expE = 
(static_cast<ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE();
-+                double expE = (static_cast<_POPPLER_CONST 
ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE();
-                 if (expE > 1.0) {
-                     expE = (bounds[i + 1] - bounds[i])/expE;    // 
approximate exponential as a single straight line at x=1
-                     if (encode[2*i] == 0) {    // normal sequence
-@@ -1022,7 +1022,7 @@ void SvgBuilder::updateFont(GfxState *state) {
-     if (font->getName()) {
-         _font_specification = font->getName()->getCString();
-     } else {
--        _font_specification = (char*) "Arial";
-+        _font_specification = "Arial";
-     }
-
-     // Prune the font name to get the correct font family name
-@@ -1030,7 +1030,7 @@ void SvgBuilder::updateFont(GfxState *state) {
-     char *font_family = NULL;
-     char *font_style = NULL;
-     char *font_style_lowercase = NULL;
--    char *plus_sign = strstr(_font_specification, "+");
-+    const char *plus_sign = strstr(_font_specification, "+");
-     if (plus_sign) {
-         font_family = g_strdup(plus_sign + 1);
-         _font_specification = plus_sign + 1;
-@@ -1148,7 +1148,7 @@ void SvgBuilder::updateFont(GfxState *state) {
-     Inkscape::CSSOStringStream os_font_size;
-     double css_font_size = _font_scaling * state->getFontSize();
-     if ( font->getType() == fontType3 ) {
--        double *font_matrix = font->getFontMatrix();
-+        const double *font_matrix = font->getFontMatrix();
-         if ( font_matrix[0] != 0.0 ) {
-             css_font_size *= font_matrix[3] / font_matrix[0];
-         }
-@@ -1193,7 +1193,7 @@ void SvgBuilder::updateTextPosition(double tx, double
- void SvgBuilder::updateTextMatrix(GfxState *state) {
-     _flushText();
-     // Update text matrix
--    double *text_matrix = state->getTextMat();
-+    const double *text_matrix = state->getTextMat();
-     double w_scale = sqrt( text_matrix[0] * text_matrix[0] + text_matrix[2] * 
text_matrix[2] );
-     double h_scale = sqrt( text_matrix[1] * text_matrix[1] + text_matrix[3] * 
text_matrix[3] );
-     double max_scale;
-@@ -1361,7 +1361,7 @@ void SvgBuilder::_flushText() {
-     _glyphs.clear();
- }
-
--void SvgBuilder::beginString(GfxState *state, GooString * /*s*/) {
-+void SvgBuilder::beginString(GfxState *state) {
-     if (_need_font_update) {
-         updateFont(state);
-     }
Index: patches/patch-src_extension_internal_pdfinput_svg-builder_h
===================================================================
RCS file: patches/patch-src_extension_internal_pdfinput_svg-builder_h
diff -N patches/patch-src_extension_internal_pdfinput_svg-builder_h
--- patches/patch-src_extension_internal_pdfinput_svg-builder_h 4 Jan 2019 
21:09:06 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,59 +0,0 @@
-$OpenBSD: patch-src_extension_internal_pdfinput_svg-builder_h,v 1.1 2019/01/04 
21:09:06 kili Exp $
-
-Fix with new poppler. From archlinux.
-
-Index: src/extension/internal/pdfinput/svg-builder.h
---- src/extension/internal/pdfinput/svg-builder.h.orig
-+++ src/extension/internal/pdfinput/svg-builder.h
-@@ -15,6 +15,7 @@
- #endif
-
- #ifdef HAVE_POPPLER
-+#include "poppler-transition-api.h"
-
- class SPDocument;
- namespace Inkscape {
-@@ -29,7 +30,6 @@ namespace Inkscape {
- #include <glibmm/ustring.h>
-
- #include "CharTypes.h"
--class GooString;
- class Function;
- class GfxState;
- struct GfxColor;
-@@ -81,7 +81,7 @@ struct SvgGlyph {
-     bool style_changed;  // Set to true if style has to be reset
-     SPCSSAttr *style;
-     int render_mode;    // Text render mode
--    char *font_specification;   // Pointer to current font specification
-+    const char *font_specification;   // Pointer to current font specification
- };
-
- /**
-@@ -136,7 +136,7 @@ class SvgBuilder { (public)
-     void clearSoftMask(GfxState *state);
-
-     // Text handling
--    void beginString(GfxState *state, GooString *s);
-+    void beginString(GfxState *state);
-     void endString(GfxState *state);
-     void addChar(GfxState *state, double x, double y,
-                  double dx, double dy,
-@@ -175,7 +175,7 @@ class SvgBuilder { (public)
-     void _addStopToGradient(Inkscape::XML::Node *gradient, double offset,
-                             GfxRGB *color, double opacity);
-     bool _addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading,
--                           Function *func);
-+                           _POPPLER_CONST Function *func);
-     gchar *_createTilingPattern(GfxTilingPattern *tiling_pattern, GfxState 
*state,
-                                 bool is_stroke=false);
-     // Image/mask creation
-@@ -203,7 +203,7 @@ class SvgBuilder { (public)
-
-     SPCSSAttr *_font_style;          // Current font style
-     GfxFont *_current_font;
--    char *_font_specification;
-+    const char *_font_specification;
-     double _font_scaling;
-     bool _need_font_update;
-     Geom::Affine _text_matrix;



Reply via email to