Package: gambas3 / 3.13.0-1

d721a82377075ae3b6735f404435a2ef68ce2beb.patch Patch series | download
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
From d721a82377075ae3b6735f404435a2ef68ce2beb Mon Sep 17 00:00:00 2001
From: gambas <g4mba5@gmail.com>
Date: Wed, 1 May 2019 15:16:05 +0200
Subject: [PATCH] Try again to compile with poppler 0.76.

[GB.PDF]
* BUG: Try again to compile with poppler 0.76.
---
 gb.pdf/src/CPdfDocument.cpp |  8 ++++++--
 gb.pdf/src/CPdfDocument.h   | 13 ++++++++-----
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/gb.pdf/src/CPdfDocument.cpp b/gb.pdf/src/CPdfDocument.cpp
index 03b94ac46..198846690 100644
--- a/gb.pdf/src/CPdfDocument.cpp
+++ b/gb.pdf/src/CPdfDocument.cpp
@@ -273,7 +273,11 @@ static uint32_t aux_get_page_from_action(void *_object, const_LinkAction *act)
 	if (dest->isPageRef() )
 	{
 		pref= dest->getPageRef();
+#if POPPLER_VERSION_0_76
+		return THIS->doc->findPage(pref);
+#else
 		return THIS->doc->findPage(pref.num, pref.gen);
+#endif
 	}
 	else
 		return dest->getPageNum();
@@ -740,7 +744,7 @@ BEGIN_PROPERTY(PDFINDEX_has_children)
 
 	OutlineItem *item = CPDF_index_get(THIS->currindex);
 
-	GB.ReturnBoolean(item->getKids() && item->getKids()->getLength());
+	GB.ReturnBoolean(item->getKids() && CPDF_list_count(item->getKids()));
 
 END_PROPERTY
 
@@ -807,7 +811,7 @@ BEGIN_METHOD_VOID(PDFINDEX_child)
 
 	OutlineItem *item = CPDF_index_get(THIS->currindex);
 
-	if (!item->hasKids() || item->getKids()->getLength() == 0) { GB.ReturnBoolean(true); return; }
+	if (!item->hasKids() || CPDF_list_count(item->getKids()) == 0) { GB.ReturnBoolean(true); return; }
 
 	if (THIS->pindex)
 	{
diff --git a/gb.pdf/src/CPdfDocument.h b/gb.pdf/src/CPdfDocument.h
index cd794011e..702f6f0eb 100644
--- a/gb.pdf/src/CPdfDocument.h
+++ b/gb.pdf/src/CPdfDocument.h
@@ -40,7 +40,7 @@
 #if POPPLER_VERSION_0_76
 #define const_LinkAction const LinkAction
 #define const_LinkDest const LinkDest
-#define const_GooList std::vector<OutlineItem*>
+#define const_GooList const std::vector<OutlineItem*>
 #define GooList std::vector<OutlineItem*>
 #define const_GooString const GooString
 #elif POPPLER_VERSION_0_64
@@ -77,16 +77,19 @@ extern GB_DESC PdfModeDesc[];
 
 #if POPPLER_VERSION_0_76
 
-#define CPDF_index_get(_i) (THIS->index->at(_i))
-#define CPDF_index_count() (THIS->index->size())
+#define CPDF_list_get(_list, _i) ((_list)->at(_i))
+#define CPDF_list_count(_list) ((_list)->size())
 
 #else
 
-#define CPDF_index_get(_i) ((OutlineItem *)(THIS->index->get(_i)))
-#define CPDF_index_count() (THIS->index->getLength())
+#define CPDF_list_get(_list, _i) ((OutlineItem *)(_list)->get(_i))
+#define CPDF_list_count(_list) ((_list)->getLength())
 
 #endif
 
+#define CPDF_index_get(_i) CPDF_list_get(THIS->index, _i)
+#define CPDF_index_count() CPDF_list_count(THIS->index)
+
 
 typedef
 	struct {
-- 
2.21.0