893b42
From a600c6438fef2f4c06f9a4a7d933d99fb054a973 Mon Sep 17 00:00:00 2001
893b42
From: Eduard Braun <eduard.braun2@gmx.de>
893b42
Date: Tue, 24 Apr 2018 19:18:26 +0200
893b42
Subject: [PATCH] Fix compilation with poppler 0.64
893b42
893b42
---
893b42
 src/extension/internal/pdfinput/pdf-parser.cpp  | 10 +++++-----
893b42
 src/extension/internal/pdfinput/pdf-parser.h    |  2 +-
893b42
 src/extension/internal/pdfinput/svg-builder.cpp |  4 ++--
893b42
 src/extension/internal/pdfinput/svg-builder.h   |  3 +--
893b42
 4 files changed, 9 insertions(+), 10 deletions(-)
893b42
893b42
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
893b42
index 15bc2d746d..6c498f9812 100644
893b42
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
893b42
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
893b42
@@ -2582,7 +2582,7 @@ void PdfParser::opShowSpaceText(Object args[], int /*numArgs*/)
893b42
   }
893b42
 }
893b42
 
893b42
-void PdfParser::doShowText(GooString *s) {
893b42
+void PdfParser::doShowText(const GooString *s) {
893b42
   GfxFont *font;
893b42
   int wMode;
893b42
   double riseX, riseY;
893b42
@@ -2601,7 +2601,7 @@ void PdfParser::doShowText(GooString *s) {
893b42
   font = state->getFont();
893b42
   wMode = font->getWMode();
893b42
 
893b42
-  builder->beginString(state, s);
893b42
+  builder->beginString(state);
893b42
 
893b42
   // handle a Type 3 char
893b42
   if (font->getType() == fontType3 && 0) {//out->interpretType3Chars()) {
893b42
@@ -2631,7 +2631,7 @@ void PdfParser::doShowText(GooString *s) {
893b42
     double lineX = state->getLineX();
893b42
     double lineY = state->getLineY();
893b42
     oldParser = parser;
893b42
-    p = s->getCString();
893b42
+    p = g_strdup(s->getCString());
893b42
     len = s->getLength();
893b42
     while (len > 0) {
893b42
       n = font->getNextChar(p, len, &code,
893b42
@@ -2686,7 +2686,7 @@ void PdfParser::doShowText(GooString *s) {
893b42
 
893b42
   } else {
893b42
     state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
893b42
-    p = s->getCString();
893b42
+    p = g_strdup(s->getCString());
893b42
     len = s->getLength();
893b42
     while (len > 0) {
893b42
       n = font->getNextChar(p, len, &code,
893b42
@@ -2732,7 +2732,7 @@ void PdfParser::opXObject(Object args[], int /*numArgs*/)
893b42
 {
893b42
   Object obj1, obj2, obj3, refObj;
893b42
 
893b42
-  char *name = args[0].getName();
893b42
+  char *name = g_strdup(args[0].getName());
893b42
 #if defined(POPPLER_NEW_OBJECT_API)
893b42
   if ((obj1 = res->lookupXObject(name)).isNull()) {
893b42
 #else
893b42
diff --git a/src/extension/internal/pdfinput/pdf-parser.h b/src/extension/internal/pdfinput/pdf-parser.h
893b42
index e28fecc2e1..f985b15cad 100644
893b42
--- a/src/extension/internal/pdfinput/pdf-parser.h
893b42
+++ b/src/extension/internal/pdfinput/pdf-parser.h
893b42
@@ -287,7 +287,7 @@ private:
893b42
   void opMoveShowText(Object args[], int numArgs);
893b42
   void opMoveSetShowText(Object args[], int numArgs);
893b42
   void opShowSpaceText(Object args[], int numArgs);
893b42
-  void doShowText(GooString *s);
893b42
+  void doShowText(const GooString *s);
893b42
 
893b42
   // XObject operators
893b42
   void opXObject(Object args[], int numArgs);
893b42
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
893b42
index 158c5ae068..8e5a5f6396 100644
893b42
--- a/src/extension/internal/pdfinput/svg-builder.cpp
893b42
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
893b42
@@ -1021,7 +1021,7 @@ void SvgBuilder::updateFont(GfxState *state) {
893b42
     GfxFont *font = state->getFont();
893b42
     // Store original name
893b42
     if (font->getName()) {
893b42
-        _font_specification = font->getName()->getCString();
893b42
+        _font_specification = g_strdup(font->getName()->getCString());
893b42
     } else {
893b42
         _font_specification = (char*) "Arial";
893b42
     }
893b42
@@ -1362,7 +1362,7 @@ void SvgBuilder::_flushText() {
893b42
     _glyphs.clear();
893b42
 }
893b42
 
893b42
-void SvgBuilder::beginString(GfxState *state, GooString * /*s*/) {
893b42
+void SvgBuilder::beginString(GfxState *state) {
893b42
     if (_need_font_update) {
893b42
         updateFont(state);
893b42
     }
893b42
diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
893b42
index ad15c9c06f..ed2a4d48e0 100644
893b42
--- a/src/extension/internal/pdfinput/svg-builder.h
893b42
+++ b/src/extension/internal/pdfinput/svg-builder.h
893b42
@@ -29,7 +29,6 @@ namespace Inkscape {
893b42
 #include <glibmm/ustring.h>
893b42
 
893b42
 #include "CharTypes.h"
893b42
-class GooString;
893b42
 class Function;
893b42
 class GfxState;
893b42
 struct GfxColor;
893b42
@@ -136,7 +135,7 @@ public:
893b42
     void clearSoftMask(GfxState *state);
893b42
 
893b42
     // Text handling
893b42
-    void beginString(GfxState *state, GooString *s);
893b42
+    void beginString(GfxState *state);
893b42
     void endString(GfxState *state);
893b42
     void addChar(GfxState *state, double x, double y,
893b42
                  double dx, double dy,
893b42
-- 
893b42
2.17.1
893b42