Skip to content

Commit

Permalink
inkscape: backport patches for poppler 0.65 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
drkp committed Jun 18, 2018
1 parent cd0760b commit 0647da9
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
6 changes: 6 additions & 0 deletions graphics/inkscape/Portfile
Expand Up @@ -6,6 +6,7 @@ PortGroup compiler_blacklist_versions 1.0
name inkscape
conflicts inkscape-devel
version 0.92.3
revision 1
license GPL-2 LGPL-2.1
maintainers {devans @dbevans}
categories graphics gnome
Expand Down Expand Up @@ -58,6 +59,11 @@ depends_lib port:desktop-file-utils \

patchfiles patch-use-configured-perl.diff

# backport fixes from upstream for poppler 0.65 compatibility
# (patches can presumably be removed on next update)
patchfiles-append 10e8ae0ff522d3a9caeed9a7f137cdfd795ba0a3.diff \
f0697de012598ea84edafea9a326e5e101eccd2a.diff

post-patch {
reinplace "s|@@MP_PERL@@|${prefix}/bin/perl${perl_version}|" ${worksrcpath}/Makefile.am
reinplace "s|\"python-interpreter\", \"python\"|\"python-interpreter\", \"python2.7\"|g" ${worksrcpath}/src/extension/implementation/script.cpp
Expand Down
@@ -0,0 +1,14 @@
diff --git src/extension/internal/pdfinput/pdf-parser.cpp src/extension/internal/pdfinput/pdf-parser.cpp
index 721524e10afcb9979fbbab5292ac9f973f316412..a3aa3213a1c39df80f3e41e0932f4c7bfc683af7 100644
--- src/extension/internal/pdfinput/pdf-parser.cpp
+++ src/extension/internal/pdfinput/pdf-parser.cpp
@@ -37,8 +37,7 @@ extern "C" {
#include "util/units.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"
105 changes: 105 additions & 0 deletions graphics/inkscape/files/f0697de012598ea84edafea9a326e5e101eccd2a.diff
@@ -0,0 +1,105 @@
diff --git src/extension/internal/pdfinput/pdf-parser.cpp src/extension/internal/pdfinput/pdf-parser.cpp
index 604b7f80795ff10cce26b2581ba961f4dd4a0750..721524e10afcb9979fbbab5292ac9f973f316412 100644
--- src/extension/internal/pdfinput/pdf-parser.cpp
+++ src/extension/internal/pdfinput/pdf-parser.cpp
@@ -2582,7 +2582,7 @@ void PdfParser::opShowSpaceText(Object args[], int /*numArgs*/)
}
}

-void PdfParser::doShowText(GooString *s) {
+void PdfParser::doShowText(const GooString *s) {
GfxFont *font;
int wMode;
double riseX, riseY;
@@ -2601,7 +2601,7 @@ void PdfParser::doShowText(GooString *s) {
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()) {
@@ -2631,7 +2631,7 @@ void PdfParser::doShowText(GooString *s) {
double lineX = state->getLineX();
double lineY = state->getLineY();
oldParser = parser;
- p = s->getCString();
+ p = g_strdup(s->getCString());
len = s->getLength();
while (len > 0) {
n = font->getNextChar(p, len, &code,
@@ -2686,7 +2686,7 @@ void PdfParser::doShowText(GooString *s) {

} else {
state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
- p = s->getCString();
+ p = g_strdup(s->getCString());
len = s->getLength();
while (len > 0) {
n = font->getNextChar(p, len, &code,
@@ -2732,7 +2732,7 @@ void PdfParser::opXObject(Object args[], int /*numArgs*/)
{
Object obj1, obj2, obj3, refObj;

- char *name = args[0].getName();
+ char *name = g_strdup(args[0].getName());
#if defined(POPPLER_NEW_OBJECT_API)
if ((obj1 = res->lookupXObject(name)).isNull()) {
#else
diff --git src/extension/internal/pdfinput/pdf-parser.h src/extension/internal/pdfinput/pdf-parser.h
index e28fecc2e155af155d3e84205bb28d269cdda6be..f985b15cad7aa4354d0108127ecedaebb95ea540 100644
--- src/extension/internal/pdfinput/pdf-parser.h
+++ src/extension/internal/pdfinput/pdf-parser.h
@@ -287,7 +287,7 @@ private:
void opMoveShowText(Object args[], int numArgs);
void opMoveSetShowText(Object args[], int numArgs);
void opShowSpaceText(Object args[], int numArgs);
- void doShowText(GooString *s);
+ void doShowText(const GooString *s);

// XObject operators
void opXObject(Object args[], int numArgs);
diff --git src/extension/internal/pdfinput/svg-builder.cpp src/extension/internal/pdfinput/svg-builder.cpp
index a448be639761b81a62aa5b95482f11e6c54045fd..617861928d964a66e88a43666905bab5c9e7ef10 100644
--- src/extension/internal/pdfinput/svg-builder.cpp
+++ src/extension/internal/pdfinput/svg-builder.cpp
@@ -1020,7 +1020,7 @@ void SvgBuilder::updateFont(GfxState *state) {
GfxFont *font = state->getFont();
// Store original name
if (font->getName()) {
- _font_specification = font->getName()->getCString();
+ _font_specification = g_strdup(font->getName()->getCString());
} else {
_font_specification = (char*) "Arial";
}
@@ -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);
}
diff --git src/extension/internal/pdfinput/svg-builder.h src/extension/internal/pdfinput/svg-builder.h
index ad15c9c06fecba95ada6b7beb4184be2456a95a8..ed2a4d48e07b3ee4cd8a4b88c0ea4a685c2ff5b5 100644
--- src/extension/internal/pdfinput/svg-builder.h
+++ src/extension/internal/pdfinput/svg-builder.h
@@ -29,7 +29,6 @@ namespace Inkscape {
#include <glibmm/ustring.h>

#include "CharTypes.h"
-class GooString;
class Function;
class GfxState;
struct GfxColor;
@@ -136,7 +135,7 @@ 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,

0 comments on commit 0647da9

Please sign in to comment.