1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
--- a/src/extension/internal/pdfinput/pdf-input.cpp
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
@@ -689,12 +689,12 @@
//
gchar const *poppler_datadir = g_getenv("POPPLER_DATADIR");
if (poppler_datadir != NULL) {
- globalParams = new GlobalParams(poppler_datadir);
+ globalParams = std::unique_ptr<GlobalParams>(new GlobalParams(poppler_datadir));
} else {
- globalParams = new GlobalParams();
+ globalParams = std::unique_ptr<GlobalParams>(new GlobalParams());
}
#else
- globalParams = new GlobalParams();
+ globalParams = std::unique_ptr<GlobalParams>(new GlobalParams());
#endif // ENABLE_OSX_APP_LOCATIONS
}
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -265,14 +265,14 @@
class ClipHistoryEntry {
public:
- ClipHistoryEntry(GfxPath *clipPath = NULL, GfxClipType clipType = clipNormal);
+ ClipHistoryEntry(const GfxPath *clipPath = NULL, GfxClipType clipType = clipNormal);
virtual ~ClipHistoryEntry();
// Manipulate clip path stack
ClipHistoryEntry *save();
ClipHistoryEntry *restore();
GBool hasSaves() { return saved != NULL; }
- void setClip(GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
+ void setClip(const GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
GfxPath *getClipPath() { return clipPath; }
GfxClipType getClipType() { return clipType; }
@@ -3379,7 +3379,7 @@
// ClipHistoryEntry
//------------------------------------------------------------------------
-ClipHistoryEntry::ClipHistoryEntry(GfxPath *clipPathA, GfxClipType clipTypeA) :
+ClipHistoryEntry::ClipHistoryEntry(const GfxPath *clipPathA, GfxClipType clipTypeA) :
saved(NULL),
clipPath((clipPathA) ? clipPathA->copy() : NULL),
clipType(clipTypeA)
@@ -3394,7 +3394,7 @@
}
}
-void ClipHistoryEntry::setClip(GfxPath *clipPathA, GfxClipType clipTypeA) {
+void ClipHistoryEntry::setClip(const GfxPath *clipPathA, GfxClipType clipTypeA) {
// Free previous clip path
if (clipPath) {
delete clipPath;
--- a/src/extension/internal/pdfinput/svg-builder.cpp
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
@@ -264,10 +264,10 @@
/**
* \brief Generates a SVG path string from poppler's data structure
*/
-static gchar *svgInterpretPath(GfxPath *path) {
+static gchar *svgInterpretPath(const GfxPath *path) {
Inkscape::SVG::PathString pathString;
for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) {
- GfxSubpath *subpath = path->getSubpath(i);
+ const GfxSubpath *subpath = path->getSubpath(i);
if (subpath->getNumPoints() > 0) {
pathString.moveTo(subpath->getX(0), subpath->getY(0));
int j = 1;
|