137 lines
5.0 KiB
Diff
137 lines
5.0 KiB
Diff
--- a/src/extension/internal/pdfinput/pdf-input.cpp 2019-01-15 05:29:27.000000000 +0100
|
|
+++ b/src/extension/internal/pdfinput/pdf-input.cpp 2024-12-31 21:27:27.574557163 +0100
|
|
@@ -689,12 +689,12 @@
|
|
//
|
|
gchar const *poppler_datadir = g_getenv("POPPLER_DATADIR");
|
|
if (poppler_datadir != NULL) {
|
|
- globalParams = new GlobalParams(poppler_datadir);
|
|
+ globalParams = _POPPLER_NEW_GLOBAL_PARAMS(poppler_datadir);
|
|
} else {
|
|
- globalParams = new GlobalParams();
|
|
+ globalParams = _POPPLER_NEW_GLOBAL_PARAMS();
|
|
}
|
|
#else
|
|
- globalParams = new GlobalParams();
|
|
+ globalParams = _POPPLER_NEW_GLOBAL_PARAMS();
|
|
#endif // ENABLE_OSX_APP_LOCATIONS
|
|
}
|
|
|
|
--- a/src/extension/internal/pdfinput/pdf-parser.cpp 2019-01-15 05:29:27.000000000 +0100
|
|
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp 2024-12-31 21:30:17.185577782 +0100
|
|
@@ -272,7 +272,7 @@
|
|
ClipHistoryEntry *save();
|
|
ClipHistoryEntry *restore();
|
|
GBool hasSaves() { return saved != NULL; }
|
|
- void setClip(GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
|
|
+ void setClip(_POPPLER_CONST_83 GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
|
|
GfxPath *getClipPath() { return clipPath; }
|
|
GfxClipType getClipType() { return clipType; }
|
|
|
|
@@ -426,7 +426,7 @@
|
|
error(errInternal, -1, "Weird page contents");
|
|
return;
|
|
}
|
|
- parser = new Parser(xref, new Lexer(xref, obj), gFalse);
|
|
+ parser = new _POPPLER_NEW_PARSER(xref, obj);
|
|
go(topLevel);
|
|
delete parser;
|
|
parser = NULL;
|
|
@@ -2210,7 +2210,11 @@
|
|
}
|
|
if (printCommands) {
|
|
printf(" font: tag=%s name='%s' %g\n",
|
|
+#if POPPLER_CHECK_VERSION(21,11,0)
|
|
+ font->getTag().c_str(),
|
|
+#else
|
|
font->getTag()->getCString(),
|
|
+#endif
|
|
font->getName() ? font->getName()->getCString() : "???",
|
|
args[1].getNum());
|
|
fflush(stdout);
|
|
@@ -2414,7 +2418,7 @@
|
|
int wMode;
|
|
double riseX, riseY;
|
|
CharCode code;
|
|
- Unicode *u = NULL;
|
|
+ Unicode _POPPLER_CONST_82 *u = NULL;
|
|
double x, y, dx, dy, tdx, tdy;
|
|
double originX, originY, tOriginX, tOriginY;
|
|
double oldCTM[6], newCTM[6];
|
|
@@ -3394,7 +3398,7 @@
|
|
}
|
|
}
|
|
|
|
-void ClipHistoryEntry::setClip(GfxPath *clipPathA, GfxClipType clipTypeA) {
|
|
+void ClipHistoryEntry::setClip(_POPPLER_CONST_83 GfxPath *clipPathA, GfxClipType clipTypeA) {
|
|
// Free previous clip path
|
|
if (clipPath) {
|
|
delete clipPath;
|
|
--- a/src/extension/internal/pdfinput/poppler-transition-api.h 2019-01-15 05:29:27.000000000 +0100
|
|
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h 2024-12-31 21:32:58.276547132 +0100
|
|
@@ -3,6 +3,30 @@
|
|
|
|
#include <glib/poppler-features.h>
|
|
|
|
+#if POPPLER_CHECK_VERSION(0, 83, 0)
|
|
+#define _POPPLER_CONST_83 const
|
|
+#else
|
|
+#define _POPPLER_CONST_83
|
|
+#endif
|
|
+
|
|
+#if POPPLER_CHECK_VERSION(0, 82, 0)
|
|
+#define _POPPLER_CONST_82 const
|
|
+#else
|
|
+#define _POPPLER_CONST_82
|
|
+#endif
|
|
+
|
|
+#if POPPLER_CHECK_VERSION(0, 76, 0)
|
|
+#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, obj, gFalse)
|
|
+#else
|
|
+#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, new Lexer(xref, obj), gFalse)
|
|
+#endif
|
|
+
|
|
+#if POPPLER_CHECK_VERSION(0, 83, 0)
|
|
+#define _POPPLER_NEW_GLOBAL_PARAMS(args...) std::unique_ptr<GlobalParams>(new GlobalParams(args))
|
|
+#else
|
|
+#define _POPPLER_NEW_GLOBAL_PARAMS(args...) new GlobalParams(args)
|
|
+#endif
|
|
+
|
|
#if POPPLER_CHECK_VERSION(0, 72, 0)
|
|
#define getCString c_str
|
|
#endif
|
|
--- a/src/extension/internal/pdfinput/svg-builder.cpp 2019-01-15 05:29:27.000000000 +0100
|
|
+++ b/src/extension/internal/pdfinput/svg-builder.cpp 2024-12-31 21:34:24.487065888 +0100
|
|
@@ -264,10 +264,10 @@
|
|
/**
|
|
* \brief Generates a SVG path string from poppler's data structure
|
|
*/
|
|
-static gchar *svgInterpretPath(GfxPath *path) {
|
|
+static gchar *svgInterpretPath(_POPPLER_CONST_83 GfxPath *path) {
|
|
Inkscape::SVG::PathString pathString;
|
|
for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) {
|
|
- GfxSubpath *subpath = path->getSubpath(i);
|
|
+ _POPPLER_CONST_83 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::addChar(GfxState *state, double x, double y,
|
|
double dx, double dy,
|
|
double originX, double originY,
|
|
- CharCode /*code*/, int /*nBytes*/, Unicode *u, int uLen) {
|
|
+ CharCode /*code*/, int /*nBytes*/, Unicode const *u, int uLen) {
|
|
|
|
|
|
bool is_space = ( uLen == 1 && u[0] == 32 );
|
|
--- a/src/extension/internal/pdfinput/svg-builder.h 2019-01-15 05:29:27.000000000 +0100
|
|
+++ b/src/extension/internal/pdfinput/svg-builder.h 2024-12-31 21:34:45.897194723 +0100
|
|
@@ -141,7 +141,7 @@
|
|
void addChar(GfxState *state, double x, double y,
|
|
double dx, double dy,
|
|
double originX, double originY,
|
|
- CharCode code, int nBytes, Unicode *u, int uLen);
|
|
+ CharCode code, int nBytes, Unicode const *u, int uLen);
|
|
void beginTextObject(GfxState *state);
|
|
void endTextObject(GfxState *state);
|
|
|