summaryrefslogtreecommitdiff
path: root/community/epdfview/0003-r357.patch
blob: c1aa9a1a6f27cd4fc7a5198f17a9871cf0c597ec (plain)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
From 951a8f66463c0dc38fa05931bd8df7b45707f6e8 Mon Sep 17 00:00:00 2001
From: jordi <jordi@cb4bfb15-1111-0410-82e2-95233c8f1c7e>
Date: Wed, 17 Nov 2010 16:02:45 +0000
Subject: [PATCH 3/3] Applied patch by Dennis Sheil <dennis-poppler@vartmp.com> to use the correct variable type for linearization since poppler version 0.15.1.

git-svn-id: svn://svn.emma-soft.com/epdfview@357 cb4bfb15-1111-0410-82e2-95233c8f1c7e
---
 trunk/THANKS              |    1 +
 trunk/configure.ac        |    5 +++++
 trunk/src/IDocument.cxx   |   15 ++++++++++++++-
 trunk/src/IDocument.h     |    8 ++++++++
 trunk/src/PDFDocument.cxx |    4 ++++
 5 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/trunk/THANKS b/trunk/THANKS
index 48dcb2b..7888d1a 100644
--- a/trunk/THANKS
+++ b/trunk/THANKS
@@ -4,6 +4,7 @@ contributions:
     - Alain Mendizabal <alainmendi@gmail.com>, for his Basque translation.
     - Alex Dedul <rotmer@gmail.com>, for his patch.
     - Alexander <lothalev@gmail.com>, for corrections in the Polish translation.
+    - Dennis Sheil <dennis-poppler@vartmp.com>, for his patch.
     - Enrico Tröger <enrico.troeger@uvena.de>, for his full screen patch and others.
     - Daniel Nylander <po@danielnylander.se>, for his Swedish translation.
     - Daniel Pielmeie <daniel.pielmeie@googlemail.com>, for his patches.
diff --git a/trunk/configure.ac b/trunk/configure.ac
index 6cbd0e2..f8316b0 100644
--- a/trunk/configure.ac
+++ b/trunk/configure.ac
@@ -56,6 +56,11 @@ PKG_CHECK_EXISTS([poppler-glib >= 0.15], [have_poppler_0_15_0=yes])
 if test "x$have_poppler_0_15_0" = "xyes"; then
     AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])
 fi
+PKG_CHECK_EXISTS([poppler-glib >= 0.15.1], [have_poppler_0_15_1=yes])
+if test "x$have_poppler_0_15_1" = "xyes"; then
+    AC_DEFINE([HAVE_POPPLER_0_15_1], [1], [Define to 1 if you have Poppler version 0.15.1 or higher.])
+fi
+
 
 EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes])
 AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes")
diff --git a/trunk/src/IDocument.cxx b/trunk/src/IDocument.cxx
index f1b71c5..f560f34 100644
--- a/trunk/src/IDocument.cxx
+++ b/trunk/src/IDocument.cxx
@@ -755,11 +755,16 @@ IDocument::setFormat (gchar *format)
 const gchar *
 IDocument::getLinearized ()
 {
+#if defined (HAVE_POPPLER_0_15_1)
+    if ( m_Linearized ) return "Yes";
+    else return "No";
+#else
     if ( NULL == m_Linearized )
     {
         return "No";
     }
     return m_Linearized;
+#endif
 }
 
 ///
@@ -768,14 +773,22 @@ IDocument::getLinearized ()
 /// @param linearized Set to "Yes" if the document is linearized. "No"
 ///                   otherwise. IDocument will free it.
 ///
+#if defined (HAVE_POPPLER_0_15_1)
 void
-IDocument::setLinearized (gchar *linearized)
+IDocument::setLinearized (gboolean *linearized)
+{
+    m_Linearized = linearized;
+}
+#else
+void
+    IDocument::setLinearized (gchar *linearized)
 {
     gchar *oldLinearized = m_Linearized;
     m_Linearized = g_strdup (linearized);
     g_free (oldLinearized);
     g_free (linearized);
 }
+#endif
 
 ///
 /// @brief Gets the document's creation date.
diff --git a/trunk/src/IDocument.h b/trunk/src/IDocument.h
index fbb3954..32aadf2 100644
--- a/trunk/src/IDocument.h
+++ b/trunk/src/IDocument.h
@@ -306,7 +306,11 @@ namespace ePDFView
             const gchar *getFormat (void);
             void setFormat (gchar *format);
             const gchar *getLinearized (void);
+#if defined (HAVE_POPPLER_0_15_1)
+            void setLinearized (gboolean *linearized);
+#else
             void setLinearized (gchar *linearized);
+#endif
             const gchar *getCreationDate (void);
             void setCreationDate (gchar *date);
             const gchar *getModifiedDate (void);
@@ -382,7 +386,11 @@ namespace ePDFView
             /// The document's keyword.
             gchar *m_Keywords;
             /// Tells if the document is linearized or not.
+#if defined (HAVE_POPPLER_0_15_1)
+            gboolean *m_Linearized;
+#else
             gchar *m_Linearized;
+#endif
             /// The document's modification date and time.
             gchar *m_ModifiedDate;
             /// @brief The list of classes that will receive notifications
diff --git a/trunk/src/PDFDocument.cxx b/trunk/src/PDFDocument.cxx
index a590a20..4d425cd 100644
--- a/trunk/src/PDFDocument.cxx
+++ b/trunk/src/PDFDocument.cxx
@@ -324,7 +324,11 @@ PDFDocument::loadMetadata (void)
     gchar *format = NULL;
     gchar *keywords = NULL;
     PopplerPageLayout layout = POPPLER_PAGE_LAYOUT_UNSET;
+#if defined (HAVE_POPPLER_0_15_1)
+    gboolean *linearized = NULL;
+#else
     gchar *linearized = NULL;
+#endif
     GTime modDate;
     PopplerPageMode mode = POPPLER_PAGE_MODE_UNSET;
     gchar *producer = NULL;
-- 
1.7.4