]> git.pld-linux.org Git - packages/inkscape.git/blob - inkscape-poppler0.83.patch
- fix building with poppler 0.83
[packages/inkscape.git] / inkscape-poppler0.83.patch
1 From 51351358a62acb6887eab49bc0dc4a7a3d18c17a Mon Sep 17 00:00:00 2001
2 From: Jan Tojnar <jtojnar@gmail.com>
3 Date: Tue, 3 Dec 2019 00:17:05 +0100
4 Subject: [PATCH] Fix build with Poppler 0.83.0
5
6 ---
7  src/extension/internal/pdfinput/pdf-input.cpp        |  6 +++---
8  src/extension/internal/pdfinput/pdf-parser.cpp       |  4 ++--
9  .../internal/pdfinput/poppler-transition-api.h       | 12 ++++++++++++
10  src/extension/internal/pdfinput/svg-builder.cpp      |  4 ++--
11  4 files changed, 19 insertions(+), 7 deletions(-)
12
13 diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
14 index e46ab9778b..472dc732de 100644
15 --- a/src/extension/internal/pdfinput/pdf-input.cpp
16 +++ b/src/extension/internal/pdfinput/pdf-input.cpp
17 @@ -689,12 +689,12 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
18          //
19          gchar const *poppler_datadir = g_getenv("POPPLER_DATADIR");
20          if (poppler_datadir != NULL) {
21 -            globalParams = new GlobalParams(poppler_datadir);
22 +            globalParams = _POPPLER_NEW_GLOBAL_PARAMS(poppler_datadir);
23          } else {
24 -            globalParams = new GlobalParams();
25 +            globalParams = _POPPLER_NEW_GLOBAL_PARAMS();
26          }
27  #else
28 -        globalParams = new GlobalParams();
29 +        globalParams = _POPPLER_NEW_GLOBAL_PARAMS();
30  #endif // ENABLE_OSX_APP_LOCATIONS
31      }
32  
33 diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
34 index 4eae275757..4513ad94c5 100644
35 --- a/src/extension/internal/pdfinput/pdf-parser.cpp
36 +++ b/src/extension/internal/pdfinput/pdf-parser.cpp
37 @@ -267,7 +267,7 @@ public:
38      ClipHistoryEntry *save();
39      ClipHistoryEntry *restore();
40      GBool hasSaves() { return saved != nullptr; }
41 -    void setClip(GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
42 +    void setClip(_POPPLER_CONST_83 GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
43      GfxPath *getClipPath() { return clipPath; }
44      GfxClipType getClipType() { return clipType; }
45  
46 @@ -3377,7 +3377,7 @@ ClipHistoryEntry::~ClipHistoryEntry()
47      }
48  }
49  
50 -void ClipHistoryEntry::setClip(GfxPath *clipPathA, GfxClipType clipTypeA) {
51 +void ClipHistoryEntry::setClip(_POPPLER_CONST_83 GfxPath *clipPathA, GfxClipType clipTypeA) {
52      // Free previous clip path
53      if (clipPath) {
54          delete clipPath;
55 diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
56 index 01834007e8..96718118db 100644
57 --- a/src/extension/internal/pdfinput/poppler-transition-api.h
58 +++ b/src/extension/internal/pdfinput/poppler-transition-api.h
59 @@ -14,6 +14,12 @@
60  
61  #include <glib/poppler-features.h>
62  
63 +#if POPPLER_CHECK_VERSION(0, 83, 0)
64 +#define _POPPLER_CONST_83 const
65 +#else
66 +#define _POPPLER_CONST_83
67 +#endif
68 +
69  #if POPPLER_CHECK_VERSION(0, 82, 0)
70  #define _POPPLER_CONST_82 const
71  #else
72 @@ -26,6 +32,12 @@
73  #define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, new Lexer(xref, obj), gFalse)
74  #endif
75  
76 +#if POPPLER_CHECK_VERSION(0, 83, 0)
77 +#define _POPPLER_NEW_GLOBAL_PARAMS(args...) std::unique_ptr<GlobalParams>(new GlobalParams(args))
78 +#else
79 +#define _POPPLER_NEW_GLOBAL_PARAMS(args...) new GlobalParams(args)
80 +#endif
81 +
82  
83  #if POPPLER_CHECK_VERSION(0, 72, 0)
84  #define getCString c_str
85 diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
86 index a7134684a0..d04173b289 100644
87 --- a/src/extension/internal/pdfinput/svg-builder.cpp
88 +++ b/src/extension/internal/pdfinput/svg-builder.cpp
89 @@ -262,10 +262,10 @@ static void svgSetTransform(Inkscape::XML::Node *node, double c0, double c1,
90  /**
91   * \brief Generates a SVG path string from poppler's data structure
92   */
93 -static gchar *svgInterpretPath(GfxPath *path) {
94 +static gchar *svgInterpretPath(_POPPLER_CONST_83 GfxPath *path) {
95      Inkscape::SVG::PathString pathString;
96      for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) {
97 -        GfxSubpath *subpath = path->getSubpath(i);
98 +        _POPPLER_CONST_83 GfxSubpath *subpath = path->getSubpath(i);
99          if (subpath->getNumPoints() > 0) {
100              pathString.moveTo(subpath->getX(0), subpath->getY(0));
101              int j = 1;
102 -- 
103 2.24.1
104
This page took 0.070752 seconds and 3 git commands to generate.