summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/pdfinput/pdf-parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/extension/internal/pdfinput/pdf-parser.cpp')
-rw-r--r--src/extension/internal/pdfinput/pdf-parser.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index 5fa21263a..a3a8ff25a 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -32,6 +32,7 @@
#include "pdf-parser.h"
#include "util/units.h"
+#include "glib/poppler-features.h"
#include "goo/gmem.h"
#include "goo/GooString.h"
#include "GlobalParams.h"
@@ -2577,7 +2578,11 @@ void PdfParser::opShowSpaceText(Object args[], int /*numArgs*/)
}
}
+#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;
@@ -2590,7 +2595,11 @@ void PdfParser::doShowText(const GooString *s) {
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();
@@ -2626,7 +2635,7 @@ void PdfParser::doShowText(const GooString *s) {
double lineX = state->getLineX();
double lineY = state->getLineY();
oldParser = parser;
- p = g_strdup(s->getCString());
+ p = s->getCString();
len = s->getLength();
while (len > 0) {
n = font->getNextChar(p, len, &code,
@@ -2681,7 +2690,7 @@ void PdfParser::doShowText(const GooString *s) {
} else {
state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
- p = g_strdup(s->getCString());
+ p = s->getCString();
len = s->getLength();
while (len > 0) {
n = font->getNextChar(p, len, &code,
@@ -2727,7 +2736,11 @@ void PdfParser::opXObject(Object args[], int /*numArgs*/)
{
Object obj1, obj2, obj3, refObj;
- char *name = g_strdup(args[0].getName());
+#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