Merge lp:~marcelstimberg/ubuntu/natty/epdfview/fix-for-783109 into lp:ubuntu/natty/epdfview

Proposed by Marcel Stimberg
Status: Merged
Merge reported by: Colin Watson
Merged at revision: not available
Proposed branch: lp:~marcelstimberg/ubuntu/natty/epdfview/fix-for-783109
Merge into: lp:ubuntu/natty/epdfview
Diff against target: 592 lines (+340/-33)
9 files modified
.pc/applied-patches (+1/-0)
THANKS (+2/-0)
configure.ac (+5/-0)
debian/changelog (+8/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu_poppler-0.16.patch (+276/-0)
src/IDocument.cxx (+35/-33)
src/IDocument.h (+8/-0)
src/PDFDocument.cxx (+4/-0)
To merge this branch: bzr merge lp:~marcelstimberg/ubuntu/natty/epdfview/fix-for-783109
Reviewer Review Type Date Requested Status
Stefano Rivera Approve
Chris Coulson (community) Needs Fixing
Ubuntu branches Pending
Review via email: mp+61794@code.launchpad.net

Description of the change

A branch with backported changes from rev 357 and rev 359, additional the "cosmetic" patch from rev 336 was also necessary in order for the other two patches to apply cleanly. This fixes crashes on many PDF documents, due to API changes in libpoppler.

To post a comment you must log in.
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks for your work. However, it seems like you included a few unnecessary files in your patch:

- epdview/THANKS.orig
- epdfview/configure.ac.orig
- epdfview/src/IDocument.cxx.orig
- epdfview/src/PDFDocument.cxx.orig

Also, the diff is huge because the branch is normally pushed with the patches applied, whereas your merge proposal has none applied

review: Needs Fixing
Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

Thanks for taking a look at the branch. I removed the unnecessary files and left all patches applied for consistency (although I was under the impression that bzr branches/source packages should not have patches applied...). The diff is now to a reasonable size :-) So please, take a look again.

Revision history for this message
Daniel Holbach (dholbach) wrote :

This looks much better. Can you also submit a merge proposal for oneiric, so we can get it in there first (and follow https://wiki.ubuntu.com/SRU)? Thanks a lot in advance.

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

> This looks much better. Can you also submit a merge proposal for oneiric, so we can get it in there first (and follow https://wiki.ubuntu.com/SRU)?
Thanks. Since I created this branch, Debian packaged a new upstream
version – I'll therefore submit a sync request for Oneiric instead. At
the first sight, there's no need for Ubuntu-specific patches for the
new version anymore, since these were all backported upstream changes.
But I'll check this more thoroughly later tonight.

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

epdfview 0.8.1 has been synced to Oneiric, so all that remains is the SRU for Natty.

Revision history for this message
Stefano Rivera (stefanor) wrote :

Looks good, would you mind using the version number 0.1.7-5ubuntu1.1?

review: Needs Fixing
24. By Marcel Stimberg

change version number to ubuntu1.1 instead of ubuntu2

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

> Looks good, would you mind using the version number 0.1.7-5ubuntu1.1?
No problem, I updated the numbering.

Revision history for this message
Stefano Rivera (stefanor) wrote :

Thanks, uploaded to natty-proposed, pending SRU team review

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2011-02-18 02:59:14 +0000
+++ .pc/applied-patches 2011-06-19 19:53:28 +0000
@@ -4,3 +4,4 @@
404_fix-slash-search.patch404_fix-slash-search.patch
505_fix-gtk-assertions.patch505_fix-gtk-assertions.patch
6ubuntu_poppler-0.15.patch6ubuntu_poppler-0.15.patch
7ubuntu_poppler-0.16.patch
78
=== modified file 'THANKS'
--- THANKS 2010-08-01 12:23:11 +0000
+++ THANKS 2011-06-19 19:53:28 +0000
@@ -6,6 +6,7 @@
6 - Alexander <lothalev@gmail.com>, for corrections in the Polish translation.6 - Alexander <lothalev@gmail.com>, for corrections in the Polish translation.
7 - Enrico Tröger <enrico.troeger@uvena.de>, for his full screen patch and others.7 - Enrico Tröger <enrico.troeger@uvena.de>, for his full screen patch and others.
8 - ewtoombs <ewtoombs@uwaterloo.ca>, for his patches.8 - ewtoombs <ewtoombs@uwaterloo.ca>, for his patches.
9 - Dennis Sheil <dennis-poppler@vartmp.com>, for his patch.
9 - Daniel Nylander <po@danielnylander.se>, for his Swedish translation.10 - Daniel Nylander <po@danielnylander.se>, for his Swedish translation.
10 - Daniel Pielmeie <daniel.pielmeie@googlemail.com>, for his patches.11 - Daniel Pielmeie <daniel.pielmeie@googlemail.com>, for his patches.
11 - Dragonlord <dragonlord@seznam.cz>, for his Czech translation.12 - Dragonlord <dragonlord@seznam.cz>, for his Czech translation.
@@ -18,6 +19,7 @@
18 - Michael Opitz <opitz.michael@gmail.com>, for his patches.19 - Michael Opitz <opitz.michael@gmail.com>, for his patches.
19 - Moritz Heiber <moe@xfce.org>, for his German translation.20 - Moritz Heiber <moe@xfce.org>, for his German translation.
20 - Mr_Moustache <mr.moustache@laposte.net>, for his French translation.21 - Mr_Moustache <mr.moustache@laposte.net>, for his French translation.
22 - Jakob Gruber <jakob.gruber@gmail.com>, for his segfault patches.
21 - Nuno Miguel <nunis@netcabo.pt>, for his European Portuguese translation.23 - Nuno Miguel <nunis@netcabo.pt>, for his European Portuguese translation.
22 - Nyu <nyu_8804@yahoo.co.jp>, for his Japanese translation.24 - Nyu <nyu_8804@yahoo.co.jp>, for his Japanese translation.
23 - Pablo Mazzini <pmazzini@gmail.com>, for his print patches.25 - Pablo Mazzini <pmazzini@gmail.com>, for his print patches.
2426
=== modified file 'configure.ac'
--- configure.ac 2011-02-11 22:38:22 +0000
+++ configure.ac 2011-06-19 19:53:28 +0000
@@ -56,6 +56,11 @@
56if test "x$have_poppler_0_15_0" = "xyes"; then56if test "x$have_poppler_0_15_0" = "xyes"; then
57 AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])57 AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])
58fi58fi
59PKG_CHECK_EXISTS([poppler-glib >= 0.15.1], [have_poppler_0_15_1=yes])
60if test "x$have_poppler_0_15_1" = "xyes"; then
61 AC_DEFINE([HAVE_POPPLER_0_15_1], [1], [Define to 1 if you have Poppler version 0.15.1 or higher.])
62fi
63
5964
60EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes])65EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes])
61AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes")66AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes")
6267
=== modified file 'debian/changelog'
--- debian/changelog 2011-02-18 02:59:14 +0000
+++ debian/changelog 2011-06-19 19:53:28 +0000
@@ -1,3 +1,11 @@
1epdfview (0.1.7-5ubuntu1.1) natty-proposed; urgency=low
2
3 * debian/patches/ubuntu_poppler-0.16.patch: Backport upstream changes (r357
4 and r359, in addition also r336, needed for the other patches to apply
5 cleanly) to prevent crashes due to API changes in poppler 0.16. LP: #783109
6
7 -- Marcel Stimberg <stimberg@users.sourceforge.net> Fri, 19 Jun 2011 21:50:20 +0200
8
1epdfview (0.1.7-5ubuntu1) natty; urgency=low9epdfview (0.1.7-5ubuntu1) natty; urgency=low
210
3 * Merge from debian unstable. Remaining changes:11 * Merge from debian unstable. Remaining changes:
412
=== modified file 'debian/patches/series'
--- debian/patches/series 2011-02-18 02:59:14 +0000
+++ debian/patches/series 2011-06-19 19:53:28 +0000
@@ -4,3 +4,4 @@
404_fix-slash-search.patch404_fix-slash-search.patch
505_fix-gtk-assertions.patch505_fix-gtk-assertions.patch
6ubuntu_poppler-0.15.patch6ubuntu_poppler-0.15.patch
7ubuntu_poppler-0.16.patch
78
=== added file 'debian/patches/ubuntu_poppler-0.16.patch'
--- debian/patches/ubuntu_poppler-0.16.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/ubuntu_poppler-0.16.patch 2011-06-19 19:53:28 +0000
@@ -0,0 +1,276 @@
1## Description: Backport upstream changes to prevent crashes due to API changes in poppler 0.16.
2## Origin/Author: upstream, http://trac.emma-soft.com/epdfview/changeset/336?format=diff&new=336,
3## http://trac.emma-soft.com/epdfview/changeset/357?format=diff&new=357,
4## http://trac.emma-soft.com/epdfview/changeset/359?format=diff&new=359
5## Bug: https://bugs.launchpad.net/ubuntu/+source/epdfview/+bug/783109
6diff -rpu epdfview.orig//configure.ac epdfview/configure.ac
7--- epdfview.orig//configure.ac 2011-06-06 23:38:46.294634015 +0200
8+++ epdfview/configure.ac 2011-06-06 23:38:57.754634017 +0200
9@@ -56,6 +56,11 @@ PKG_CHECK_EXISTS([poppler-glib >= 0.15],
10 if test "x$have_poppler_0_15_0" = "xyes"; then
11 AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])
12 fi
13+PKG_CHECK_EXISTS([poppler-glib >= 0.15.1], [have_poppler_0_15_1=yes])
14+if test "x$have_poppler_0_15_1" = "xyes"; then
15+ AC_DEFINE([HAVE_POPPLER_0_15_1], [1], [Define to 1 if you have Poppler version 0.15.1 or higher.])
16+fi
17+
18
19 EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes])
20 AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes")
21diff -rpu epdfview.orig//src/IDocument.cxx epdfview/src/IDocument.cxx
22--- epdfview.orig//src/IDocument.cxx 2011-06-06 23:38:46.304634015 +0200
23+++ epdfview/src/IDocument.cxx 2011-06-06 23:38:57.754634017 +0200
24@@ -135,7 +135,11 @@ IDocument::IDocument ()
25 m_FindPage = 0;
26 m_Format = NULL;
27 m_Keywords = NULL;
28+#if defined (HAVE_POPPLER_0_15_1)
29+ m_Linearized = FALSE;
30+#else
31 m_Linearized = NULL;
32+#endif
33 m_ModifiedDate = NULL;
34 m_PageCache = NULL;
35 m_PageCacheAge = 0;
36@@ -164,7 +168,9 @@ IDocument::~IDocument ()
37 g_free (m_FileName);
38 g_free (m_Format);
39 g_free (m_Keywords);
40+#if !defined (HAVE_POPPLER_0_15_1)
41 g_free (m_Linearized);
42+#endif
43 g_free (m_ModifiedDate);
44 g_free (m_Password);
45 g_free (m_Producer);
46@@ -555,9 +561,8 @@ IDocument::getTitle ()
47 void
48 IDocument::setTitle (gchar *title)
49 {
50- gchar *oldTitle = m_Title;
51+ g_free (m_Title);
52 m_Title = g_strdup (title);
53- g_free (oldTitle);
54 g_free (title);
55 }
56
57@@ -585,9 +590,8 @@ IDocument::getAuthor ()
58 void
59 IDocument::setAuthor (gchar *author)
60 {
61- gchar *oldAuthor = m_Author;
62+ g_free(m_Author);
63 m_Author = g_strdup (author);
64- g_free (oldAuthor);
65 g_free (author);
66 }
67
68@@ -615,10 +619,9 @@ IDocument::getSubject ()
69 void
70 IDocument::setSubject (gchar *subject)
71 {
72- gchar *oldSubject = m_Subject;
73+ g_free (m_Subject);
74 m_Subject = g_strdup (subject);
75- g_free (oldSubject);
76- m_Subject = subject;
77+ g_free (subject);
78 }
79
80 ///
81@@ -646,9 +649,8 @@ IDocument::getKeywords ()
82 void
83 IDocument::setKeywords (gchar *keywords)
84 {
85- gchar *oldKeywords = m_Keywords;
86+ g_free(m_Keywords);
87 m_Keywords = g_strdup (keywords);
88- g_free (oldKeywords);
89 g_free (keywords);
90 }
91
92@@ -677,9 +679,8 @@ IDocument::getCreator ()
93 void
94 IDocument::setCreator (gchar *creator)
95 {
96- gchar *oldCreator = m_Creator;
97+ g_free (m_Creator);
98 m_Creator = g_strdup (creator);
99- g_free (oldCreator);
100 g_free (creator);
101 }
102 ///
103@@ -707,9 +708,8 @@ IDocument::getProducer ()
104 void
105 IDocument::setProducer (gchar *producer)
106 {
107- gchar *oldProducer = m_Producer;
108+ g_free (m_Producer);
109 m_Producer = g_strdup (producer);
110- g_free (oldProducer);
111 g_free (producer);
112 }
113
114@@ -739,9 +739,8 @@ IDocument::getFormat ()
115 void
116 IDocument::setFormat (gchar *format)
117 {
118- gchar *oldFormat = m_Format;
119+ g_free (m_Format);
120 m_Format = g_strdup (format);
121- g_free (oldFormat);
122 g_free (format);
123 }
124
125@@ -755,11 +754,16 @@ IDocument::setFormat (gchar *format)
126 const gchar *
127 IDocument::getLinearized ()
128 {
129+#if defined (HAVE_POPPLER_0_15_1)
130+ if ( m_Linearized ) return "Yes";
131+ else return "No";
132+#else
133 if ( NULL == m_Linearized )
134 {
135 return "No";
136 }
137 return m_Linearized;
138+#endif
139 }
140
141 ///
142@@ -768,14 +772,21 @@ IDocument::getLinearized ()
143 /// @param linearized Set to "Yes" if the document is linearized. "No"
144 /// otherwise. IDocument will free it.
145 ///
146+#if defined (HAVE_POPPLER_0_15_1)
147+void
148+IDocument::setLinearized (gboolean *linearized)
149+{
150+ m_Linearized = linearized;
151+}
152+#else
153 void
154-IDocument::setLinearized (gchar *linearized)
155+ IDocument::setLinearized (gchar *linearized)
156 {
157- gchar *oldLinearized = m_Linearized;
158+ g_free (m_Linearized);
159 m_Linearized = g_strdup (linearized);
160- g_free (oldLinearized);
161 g_free (linearized);
162 }
163+#endif
164
165 ///
166 /// @brief Gets the document's creation date.
167@@ -802,9 +813,8 @@ IDocument::getCreationDate ()
168 void
169 IDocument::setCreationDate (gchar *date)
170 {
171- gchar *oldCreationDate = m_CreationDate;
172+ g_free (m_CreationDate);
173 m_CreationDate = g_strdup (date);
174- g_free (oldCreationDate);
175 g_free (date);
176 }
177
178@@ -833,9 +843,8 @@ IDocument::getModifiedDate ()
179 void
180 IDocument::setModifiedDate (gchar *date)
181 {
182- gchar *oldModifiedDate = m_ModifiedDate;
183+ g_free (m_ModifiedDate);
184 m_ModifiedDate = g_strdup (date);
185- g_free (oldModifiedDate);
186 g_free (date);
187 }
188
189@@ -917,9 +926,8 @@ IDocument::getPassword () const
190 void
191 IDocument::setPassword (const gchar *password)
192 {
193- gchar *oldPassword = m_Password;
194+ g_free (m_Password);
195 m_Password = g_strdup (password);
196- g_free (oldPassword);
197 }
198
199 ///
200@@ -959,14 +967,8 @@ IDocument::setFileName (const gchar *fil
201 {
202 g_assert (NULL != fileName && "Tried to set a NULL file name.");
203
204- // Don't ask me why, but then I set like this:
205- // g_free (m_FileName);
206- // m_FileName = fileName
207- // Somehow the g_free also frees the parameter ????????
208- //
209- gchar *oldFileName = m_FileName;
210+ g_free(m_FileName);
211 m_FileName = g_strdup (fileName);
212- g_free (oldFileName);
213 }
214
215 ///
216diff -rpu epdfview.orig//src/IDocument.h epdfview/src/IDocument.h
217--- epdfview.orig//src/IDocument.h 2011-06-06 23:38:46.304634015 +0200
218+++ epdfview/src/IDocument.h 2011-06-06 23:38:57.754634017 +0200
219@@ -306,7 +306,11 @@ namespace ePDFView
220 const gchar *getFormat (void);
221 void setFormat (gchar *format);
222 const gchar *getLinearized (void);
223+#if defined (HAVE_POPPLER_0_15_1)
224+ void setLinearized (gboolean *linearized);
225+#else
226 void setLinearized (gchar *linearized);
227+#endif
228 const gchar *getCreationDate (void);
229 void setCreationDate (gchar *date);
230 const gchar *getModifiedDate (void);
231@@ -382,7 +386,11 @@ namespace ePDFView
232 /// The document's keyword.
233 gchar *m_Keywords;
234 /// Tells if the document is linearized or not.
235+#if defined (HAVE_POPPLER_0_15_1)
236+ gboolean *m_Linearized;
237+#else
238 gchar *m_Linearized;
239+#endif
240 /// The document's modification date and time.
241 gchar *m_ModifiedDate;
242 /// @brief The list of classes that will receive notifications
243diff -rpu epdfview.orig//src/PDFDocument.cxx epdfview/src/PDFDocument.cxx
244--- epdfview.orig//src/PDFDocument.cxx 2011-06-06 23:38:46.334634015 +0200
245+++ epdfview/src/PDFDocument.cxx 2011-06-06 23:38:57.754634017 +0200
246@@ -299,7 +299,11 @@ PDFDocument::loadMetadata (void)
247 gchar *format = NULL;
248 gchar *keywords = NULL;
249 PopplerPageLayout layout = POPPLER_PAGE_LAYOUT_UNSET;
250+#if defined (HAVE_POPPLER_0_15_1)
251+ gboolean *linearized = NULL;
252+#else
253 gchar *linearized = NULL;
254+#endif
255 GTime modDate;
256 PopplerPageMode mode = POPPLER_PAGE_MODE_UNSET;
257 gchar *producer = NULL;
258diff -rpu epdfview.orig//THANKS epdfview/THANKS
259--- epdfview.orig//THANKS 2011-06-06 23:38:46.224634015 +0200
260+++ epdfview/THANKS 2011-06-06 23:38:57.754634017 +0200
261@@ -6,6 +6,7 @@ contributions:
262 - Alexander <lothalev@gmail.com>, for corrections in the Polish translation.
263 - Enrico Tröger <enrico.troeger@uvena.de>, for his full screen patch and others.
264 - ewtoombs <ewtoombs@uwaterloo.ca>, for his patches.
265+ - Dennis Sheil <dennis-poppler@vartmp.com>, for his patch.
266 - Daniel Nylander <po@danielnylander.se>, for his Swedish translation.
267 - Daniel Pielmeie <daniel.pielmeie@googlemail.com>, for his patches.
268 - Dragonlord <dragonlord@seznam.cz>, for his Czech translation.
269@@ -18,6 +19,7 @@ contributions:
270 - Michael Opitz <opitz.michael@gmail.com>, for his patches.
271 - Moritz Heiber <moe@xfce.org>, for his German translation.
272 - Mr_Moustache <mr.moustache@laposte.net>, for his French translation.
273+ - Jakob Gruber <jakob.gruber@gmail.com>, for his segfault patches.
274 - Nuno Miguel <nunis@netcabo.pt>, for his European Portuguese translation.
275 - Nyu <nyu_8804@yahoo.co.jp>, for his Japanese translation.
276 - Pablo Mazzini <pmazzini@gmail.com>, for his print patches.
0277
=== modified file 'src/IDocument.cxx'
--- src/IDocument.cxx 2009-03-10 00:06:29 +0000
+++ src/IDocument.cxx 2011-06-19 19:53:28 +0000
@@ -135,7 +135,11 @@
135 m_FindPage = 0;135 m_FindPage = 0;
136 m_Format = NULL;136 m_Format = NULL;
137 m_Keywords = NULL;137 m_Keywords = NULL;
138#if defined (HAVE_POPPLER_0_15_1)
139 m_Linearized = FALSE;
140#else
138 m_Linearized = NULL;141 m_Linearized = NULL;
142#endif
139 m_ModifiedDate = NULL;143 m_ModifiedDate = NULL;
140 m_PageCache = NULL;144 m_PageCache = NULL;
141 m_PageCacheAge = 0;145 m_PageCacheAge = 0;
@@ -164,7 +168,9 @@
164 g_free (m_FileName);168 g_free (m_FileName);
165 g_free (m_Format);169 g_free (m_Format);
166 g_free (m_Keywords);170 g_free (m_Keywords);
171#if !defined (HAVE_POPPLER_0_15_1)
167 g_free (m_Linearized);172 g_free (m_Linearized);
173#endif
168 g_free (m_ModifiedDate);174 g_free (m_ModifiedDate);
169 g_free (m_Password);175 g_free (m_Password);
170 g_free (m_Producer);176 g_free (m_Producer);
@@ -555,9 +561,8 @@
555void561void
556IDocument::setTitle (gchar *title)562IDocument::setTitle (gchar *title)
557{563{
558 gchar *oldTitle = m_Title;564 g_free (m_Title);
559 m_Title = g_strdup (title);565 m_Title = g_strdup (title);
560 g_free (oldTitle);
561 g_free (title);566 g_free (title);
562}567}
563568
@@ -585,9 +590,8 @@
585void590void
586IDocument::setAuthor (gchar *author)591IDocument::setAuthor (gchar *author)
587{592{
588 gchar *oldAuthor = m_Author;593 g_free(m_Author);
589 m_Author = g_strdup (author);594 m_Author = g_strdup (author);
590 g_free (oldAuthor);
591 g_free (author);595 g_free (author);
592}596}
593597
@@ -615,10 +619,9 @@
615void619void
616IDocument::setSubject (gchar *subject)620IDocument::setSubject (gchar *subject)
617{621{
618 gchar *oldSubject = m_Subject;622 g_free (m_Subject);
619 m_Subject = g_strdup (subject);623 m_Subject = g_strdup (subject);
620 g_free (oldSubject);624 g_free (subject);
621 m_Subject = subject;
622}625}
623626
624///627///
@@ -646,9 +649,8 @@
646void649void
647IDocument::setKeywords (gchar *keywords)650IDocument::setKeywords (gchar *keywords)
648{651{
649 gchar *oldKeywords = m_Keywords;652 g_free(m_Keywords);
650 m_Keywords = g_strdup (keywords);653 m_Keywords = g_strdup (keywords);
651 g_free (oldKeywords);
652 g_free (keywords);654 g_free (keywords);
653}655}
654656
@@ -677,9 +679,8 @@
677void679void
678IDocument::setCreator (gchar *creator)680IDocument::setCreator (gchar *creator)
679{681{
680 gchar *oldCreator = m_Creator;682 g_free (m_Creator);
681 m_Creator = g_strdup (creator);683 m_Creator = g_strdup (creator);
682 g_free (oldCreator);
683 g_free (creator);684 g_free (creator);
684}685}
685///686///
@@ -707,9 +708,8 @@
707void708void
708IDocument::setProducer (gchar *producer)709IDocument::setProducer (gchar *producer)
709{710{
710 gchar *oldProducer = m_Producer;711 g_free (m_Producer);
711 m_Producer = g_strdup (producer);712 m_Producer = g_strdup (producer);
712 g_free (oldProducer);
713 g_free (producer);713 g_free (producer);
714}714}
715715
@@ -739,9 +739,8 @@
739void739void
740IDocument::setFormat (gchar *format)740IDocument::setFormat (gchar *format)
741{741{
742 gchar *oldFormat = m_Format;742 g_free (m_Format);
743 m_Format = g_strdup (format);743 m_Format = g_strdup (format);
744 g_free (oldFormat);
745 g_free (format);744 g_free (format);
746}745}
747746
@@ -755,11 +754,16 @@
755const gchar *754const gchar *
756IDocument::getLinearized ()755IDocument::getLinearized ()
757{756{
757#if defined (HAVE_POPPLER_0_15_1)
758 if ( m_Linearized ) return "Yes";
759 else return "No";
760#else
758 if ( NULL == m_Linearized )761 if ( NULL == m_Linearized )
759 {762 {
760 return "No";763 return "No";
761 }764 }
762 return m_Linearized;765 return m_Linearized;
766#endif
763}767}
764768
765///769///
@@ -768,14 +772,21 @@
768/// @param linearized Set to "Yes" if the document is linearized. "No"772/// @param linearized Set to "Yes" if the document is linearized. "No"
769/// otherwise. IDocument will free it.773/// otherwise. IDocument will free it.
770///774///
771void775#if defined (HAVE_POPPLER_0_15_1)
772IDocument::setLinearized (gchar *linearized)776void
773{777IDocument::setLinearized (gboolean *linearized)
774 gchar *oldLinearized = m_Linearized;778{
779 m_Linearized = linearized;
780}
781#else
782void
783 IDocument::setLinearized (gchar *linearized)
784{
785 g_free (m_Linearized);
775 m_Linearized = g_strdup (linearized);786 m_Linearized = g_strdup (linearized);
776 g_free (oldLinearized);
777 g_free (linearized);787 g_free (linearized);
778}788}
789#endif
779790
780///791///
781/// @brief Gets the document's creation date.792/// @brief Gets the document's creation date.
@@ -802,9 +813,8 @@
802void813void
803IDocument::setCreationDate (gchar *date)814IDocument::setCreationDate (gchar *date)
804{815{
805 gchar *oldCreationDate = m_CreationDate;816 g_free (m_CreationDate);
806 m_CreationDate = g_strdup (date);817 m_CreationDate = g_strdup (date);
807 g_free (oldCreationDate);
808 g_free (date);818 g_free (date);
809}819}
810820
@@ -833,9 +843,8 @@
833void843void
834IDocument::setModifiedDate (gchar *date)844IDocument::setModifiedDate (gchar *date)
835{845{
836 gchar *oldModifiedDate = m_ModifiedDate;846 g_free (m_ModifiedDate);
837 m_ModifiedDate = g_strdup (date);847 m_ModifiedDate = g_strdup (date);
838 g_free (oldModifiedDate);
839 g_free (date);848 g_free (date);
840}849}
841850
@@ -917,9 +926,8 @@
917void926void
918IDocument::setPassword (const gchar *password)927IDocument::setPassword (const gchar *password)
919{928{
920 gchar *oldPassword = m_Password;929 g_free (m_Password);
921 m_Password = g_strdup (password);930 m_Password = g_strdup (password);
922 g_free (oldPassword);
923}931}
924932
925///933///
@@ -959,14 +967,8 @@
959{967{
960 g_assert (NULL != fileName && "Tried to set a NULL file name.");968 g_assert (NULL != fileName && "Tried to set a NULL file name.");
961969
962 // Don't ask me why, but then I set like this:970 g_free(m_FileName);
963 // g_free (m_FileName);
964 // m_FileName = fileName
965 // Somehow the g_free also frees the parameter ????????
966 //
967 gchar *oldFileName = m_FileName;
968 m_FileName = g_strdup (fileName);971 m_FileName = g_strdup (fileName);
969 g_free (oldFileName);
970}972}
971973
972///974///
973975
=== modified file 'src/IDocument.h'
--- src/IDocument.h 2009-03-10 00:06:29 +0000
+++ src/IDocument.h 2011-06-19 19:53:28 +0000
@@ -306,7 +306,11 @@
306 const gchar *getFormat (void);306 const gchar *getFormat (void);
307 void setFormat (gchar *format);307 void setFormat (gchar *format);
308 const gchar *getLinearized (void);308 const gchar *getLinearized (void);
309#if defined (HAVE_POPPLER_0_15_1)
310 void setLinearized (gboolean *linearized);
311#else
309 void setLinearized (gchar *linearized);312 void setLinearized (gchar *linearized);
313#endif
310 const gchar *getCreationDate (void);314 const gchar *getCreationDate (void);
311 void setCreationDate (gchar *date);315 void setCreationDate (gchar *date);
312 const gchar *getModifiedDate (void);316 const gchar *getModifiedDate (void);
@@ -382,7 +386,11 @@
382 /// The document's keyword.386 /// The document's keyword.
383 gchar *m_Keywords;387 gchar *m_Keywords;
384 /// Tells if the document is linearized or not.388 /// Tells if the document is linearized or not.
389#if defined (HAVE_POPPLER_0_15_1)
390 gboolean *m_Linearized;
391#else
385 gchar *m_Linearized;392 gchar *m_Linearized;
393#endif
386 /// The document's modification date and time.394 /// The document's modification date and time.
387 gchar *m_ModifiedDate;395 gchar *m_ModifiedDate;
388 /// @brief The list of classes that will receive notifications396 /// @brief The list of classes that will receive notifications
389397
=== modified file 'src/PDFDocument.cxx'
--- src/PDFDocument.cxx 2011-02-11 22:38:22 +0000
+++ src/PDFDocument.cxx 2011-06-19 19:53:28 +0000
@@ -299,7 +299,11 @@
299 gchar *format = NULL;299 gchar *format = NULL;
300 gchar *keywords = NULL;300 gchar *keywords = NULL;
301 PopplerPageLayout layout = POPPLER_PAGE_LAYOUT_UNSET;301 PopplerPageLayout layout = POPPLER_PAGE_LAYOUT_UNSET;
302#if defined (HAVE_POPPLER_0_15_1)
303 gboolean *linearized = NULL;
304#else
302 gchar *linearized = NULL;305 gchar *linearized = NULL;
306#endif
303 GTime modDate;307 GTime modDate;
304 PopplerPageMode mode = POPPLER_PAGE_MODE_UNSET;308 PopplerPageMode mode = POPPLER_PAGE_MODE_UNSET;
305 gchar *producer = NULL;309 gchar *producer = NULL;

Subscribers

People subscribed via source and target branches