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
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2011-02-18 02:59:14 +0000
3+++ .pc/applied-patches 2011-06-19 19:53:28 +0000
4@@ -4,3 +4,4 @@
5 04_fix-slash-search.patch
6 05_fix-gtk-assertions.patch
7 ubuntu_poppler-0.15.patch
8+ubuntu_poppler-0.16.patch
9
10=== modified file 'THANKS'
11--- THANKS 2010-08-01 12:23:11 +0000
12+++ THANKS 2011-06-19 19:53:28 +0000
13@@ -6,6 +6,7 @@
14 - Alexander <lothalev@gmail.com>, for corrections in the Polish translation.
15 - Enrico Tröger <enrico.troeger@uvena.de>, for his full screen patch and others.
16 - ewtoombs <ewtoombs@uwaterloo.ca>, for his patches.
17+ - Dennis Sheil <dennis-poppler@vartmp.com>, for his patch.
18 - Daniel Nylander <po@danielnylander.se>, for his Swedish translation.
19 - Daniel Pielmeie <daniel.pielmeie@googlemail.com>, for his patches.
20 - Dragonlord <dragonlord@seznam.cz>, for his Czech translation.
21@@ -18,6 +19,7 @@
22 - Michael Opitz <opitz.michael@gmail.com>, for his patches.
23 - Moritz Heiber <moe@xfce.org>, for his German translation.
24 - Mr_Moustache <mr.moustache@laposte.net>, for his French translation.
25+ - Jakob Gruber <jakob.gruber@gmail.com>, for his segfault patches.
26 - Nuno Miguel <nunis@netcabo.pt>, for his European Portuguese translation.
27 - Nyu <nyu_8804@yahoo.co.jp>, for his Japanese translation.
28 - Pablo Mazzini <pmazzini@gmail.com>, for his print patches.
29
30=== modified file 'configure.ac'
31--- configure.ac 2011-02-11 22:38:22 +0000
32+++ configure.ac 2011-06-19 19:53:28 +0000
33@@ -56,6 +56,11 @@
34 if test "x$have_poppler_0_15_0" = "xyes"; then
35 AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])
36 fi
37+PKG_CHECK_EXISTS([poppler-glib >= 0.15.1], [have_poppler_0_15_1=yes])
38+if test "x$have_poppler_0_15_1" = "xyes"; then
39+ AC_DEFINE([HAVE_POPPLER_0_15_1], [1], [Define to 1 if you have Poppler version 0.15.1 or higher.])
40+fi
41+
42
43 EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes])
44 AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes")
45
46=== modified file 'debian/changelog'
47--- debian/changelog 2011-02-18 02:59:14 +0000
48+++ debian/changelog 2011-06-19 19:53:28 +0000
49@@ -1,3 +1,11 @@
50+epdfview (0.1.7-5ubuntu1.1) natty-proposed; urgency=low
51+
52+ * debian/patches/ubuntu_poppler-0.16.patch: Backport upstream changes (r357
53+ and r359, in addition also r336, needed for the other patches to apply
54+ cleanly) to prevent crashes due to API changes in poppler 0.16. LP: #783109
55+
56+ -- Marcel Stimberg <stimberg@users.sourceforge.net> Fri, 19 Jun 2011 21:50:20 +0200
57+
58 epdfview (0.1.7-5ubuntu1) natty; urgency=low
59
60 * Merge from debian unstable. Remaining changes:
61
62=== modified file 'debian/patches/series'
63--- debian/patches/series 2011-02-18 02:59:14 +0000
64+++ debian/patches/series 2011-06-19 19:53:28 +0000
65@@ -4,3 +4,4 @@
66 04_fix-slash-search.patch
67 05_fix-gtk-assertions.patch
68 ubuntu_poppler-0.15.patch
69+ubuntu_poppler-0.16.patch
70
71=== added file 'debian/patches/ubuntu_poppler-0.16.patch'
72--- debian/patches/ubuntu_poppler-0.16.patch 1970-01-01 00:00:00 +0000
73+++ debian/patches/ubuntu_poppler-0.16.patch 2011-06-19 19:53:28 +0000
74@@ -0,0 +1,276 @@
75+## Description: Backport upstream changes to prevent crashes due to API changes in poppler 0.16.
76+## Origin/Author: upstream, http://trac.emma-soft.com/epdfview/changeset/336?format=diff&new=336,
77+## http://trac.emma-soft.com/epdfview/changeset/357?format=diff&new=357,
78+## http://trac.emma-soft.com/epdfview/changeset/359?format=diff&new=359
79+## Bug: https://bugs.launchpad.net/ubuntu/+source/epdfview/+bug/783109
80+diff -rpu epdfview.orig//configure.ac epdfview/configure.ac
81+--- epdfview.orig//configure.ac 2011-06-06 23:38:46.294634015 +0200
82++++ epdfview/configure.ac 2011-06-06 23:38:57.754634017 +0200
83+@@ -56,6 +56,11 @@ PKG_CHECK_EXISTS([poppler-glib >= 0.15],
84+ if test "x$have_poppler_0_15_0" = "xyes"; then
85+ AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])
86+ fi
87++PKG_CHECK_EXISTS([poppler-glib >= 0.15.1], [have_poppler_0_15_1=yes])
88++if test "x$have_poppler_0_15_1" = "xyes"; then
89++ AC_DEFINE([HAVE_POPPLER_0_15_1], [1], [Define to 1 if you have Poppler version 0.15.1 or higher.])
90++fi
91++
92+
93+ EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes])
94+ AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes")
95+diff -rpu epdfview.orig//src/IDocument.cxx epdfview/src/IDocument.cxx
96+--- epdfview.orig//src/IDocument.cxx 2011-06-06 23:38:46.304634015 +0200
97++++ epdfview/src/IDocument.cxx 2011-06-06 23:38:57.754634017 +0200
98+@@ -135,7 +135,11 @@ IDocument::IDocument ()
99+ m_FindPage = 0;
100+ m_Format = NULL;
101+ m_Keywords = NULL;
102++#if defined (HAVE_POPPLER_0_15_1)
103++ m_Linearized = FALSE;
104++#else
105+ m_Linearized = NULL;
106++#endif
107+ m_ModifiedDate = NULL;
108+ m_PageCache = NULL;
109+ m_PageCacheAge = 0;
110+@@ -164,7 +168,9 @@ IDocument::~IDocument ()
111+ g_free (m_FileName);
112+ g_free (m_Format);
113+ g_free (m_Keywords);
114++#if !defined (HAVE_POPPLER_0_15_1)
115+ g_free (m_Linearized);
116++#endif
117+ g_free (m_ModifiedDate);
118+ g_free (m_Password);
119+ g_free (m_Producer);
120+@@ -555,9 +561,8 @@ IDocument::getTitle ()
121+ void
122+ IDocument::setTitle (gchar *title)
123+ {
124+- gchar *oldTitle = m_Title;
125++ g_free (m_Title);
126+ m_Title = g_strdup (title);
127+- g_free (oldTitle);
128+ g_free (title);
129+ }
130+
131+@@ -585,9 +590,8 @@ IDocument::getAuthor ()
132+ void
133+ IDocument::setAuthor (gchar *author)
134+ {
135+- gchar *oldAuthor = m_Author;
136++ g_free(m_Author);
137+ m_Author = g_strdup (author);
138+- g_free (oldAuthor);
139+ g_free (author);
140+ }
141+
142+@@ -615,10 +619,9 @@ IDocument::getSubject ()
143+ void
144+ IDocument::setSubject (gchar *subject)
145+ {
146+- gchar *oldSubject = m_Subject;
147++ g_free (m_Subject);
148+ m_Subject = g_strdup (subject);
149+- g_free (oldSubject);
150+- m_Subject = subject;
151++ g_free (subject);
152+ }
153+
154+ ///
155+@@ -646,9 +649,8 @@ IDocument::getKeywords ()
156+ void
157+ IDocument::setKeywords (gchar *keywords)
158+ {
159+- gchar *oldKeywords = m_Keywords;
160++ g_free(m_Keywords);
161+ m_Keywords = g_strdup (keywords);
162+- g_free (oldKeywords);
163+ g_free (keywords);
164+ }
165+
166+@@ -677,9 +679,8 @@ IDocument::getCreator ()
167+ void
168+ IDocument::setCreator (gchar *creator)
169+ {
170+- gchar *oldCreator = m_Creator;
171++ g_free (m_Creator);
172+ m_Creator = g_strdup (creator);
173+- g_free (oldCreator);
174+ g_free (creator);
175+ }
176+ ///
177+@@ -707,9 +708,8 @@ IDocument::getProducer ()
178+ void
179+ IDocument::setProducer (gchar *producer)
180+ {
181+- gchar *oldProducer = m_Producer;
182++ g_free (m_Producer);
183+ m_Producer = g_strdup (producer);
184+- g_free (oldProducer);
185+ g_free (producer);
186+ }
187+
188+@@ -739,9 +739,8 @@ IDocument::getFormat ()
189+ void
190+ IDocument::setFormat (gchar *format)
191+ {
192+- gchar *oldFormat = m_Format;
193++ g_free (m_Format);
194+ m_Format = g_strdup (format);
195+- g_free (oldFormat);
196+ g_free (format);
197+ }
198+
199+@@ -755,11 +754,16 @@ IDocument::setFormat (gchar *format)
200+ const gchar *
201+ IDocument::getLinearized ()
202+ {
203++#if defined (HAVE_POPPLER_0_15_1)
204++ if ( m_Linearized ) return "Yes";
205++ else return "No";
206++#else
207+ if ( NULL == m_Linearized )
208+ {
209+ return "No";
210+ }
211+ return m_Linearized;
212++#endif
213+ }
214+
215+ ///
216+@@ -768,14 +772,21 @@ IDocument::getLinearized ()
217+ /// @param linearized Set to "Yes" if the document is linearized. "No"
218+ /// otherwise. IDocument will free it.
219+ ///
220++#if defined (HAVE_POPPLER_0_15_1)
221++void
222++IDocument::setLinearized (gboolean *linearized)
223++{
224++ m_Linearized = linearized;
225++}
226++#else
227+ void
228+-IDocument::setLinearized (gchar *linearized)
229++ IDocument::setLinearized (gchar *linearized)
230+ {
231+- gchar *oldLinearized = m_Linearized;
232++ g_free (m_Linearized);
233+ m_Linearized = g_strdup (linearized);
234+- g_free (oldLinearized);
235+ g_free (linearized);
236+ }
237++#endif
238+
239+ ///
240+ /// @brief Gets the document's creation date.
241+@@ -802,9 +813,8 @@ IDocument::getCreationDate ()
242+ void
243+ IDocument::setCreationDate (gchar *date)
244+ {
245+- gchar *oldCreationDate = m_CreationDate;
246++ g_free (m_CreationDate);
247+ m_CreationDate = g_strdup (date);
248+- g_free (oldCreationDate);
249+ g_free (date);
250+ }
251+
252+@@ -833,9 +843,8 @@ IDocument::getModifiedDate ()
253+ void
254+ IDocument::setModifiedDate (gchar *date)
255+ {
256+- gchar *oldModifiedDate = m_ModifiedDate;
257++ g_free (m_ModifiedDate);
258+ m_ModifiedDate = g_strdup (date);
259+- g_free (oldModifiedDate);
260+ g_free (date);
261+ }
262+
263+@@ -917,9 +926,8 @@ IDocument::getPassword () const
264+ void
265+ IDocument::setPassword (const gchar *password)
266+ {
267+- gchar *oldPassword = m_Password;
268++ g_free (m_Password);
269+ m_Password = g_strdup (password);
270+- g_free (oldPassword);
271+ }
272+
273+ ///
274+@@ -959,14 +967,8 @@ IDocument::setFileName (const gchar *fil
275+ {
276+ g_assert (NULL != fileName && "Tried to set a NULL file name.");
277+
278+- // Don't ask me why, but then I set like this:
279+- // g_free (m_FileName);
280+- // m_FileName = fileName
281+- // Somehow the g_free also frees the parameter ????????
282+- //
283+- gchar *oldFileName = m_FileName;
284++ g_free(m_FileName);
285+ m_FileName = g_strdup (fileName);
286+- g_free (oldFileName);
287+ }
288+
289+ ///
290+diff -rpu epdfview.orig//src/IDocument.h epdfview/src/IDocument.h
291+--- epdfview.orig//src/IDocument.h 2011-06-06 23:38:46.304634015 +0200
292++++ epdfview/src/IDocument.h 2011-06-06 23:38:57.754634017 +0200
293+@@ -306,7 +306,11 @@ namespace ePDFView
294+ const gchar *getFormat (void);
295+ void setFormat (gchar *format);
296+ const gchar *getLinearized (void);
297++#if defined (HAVE_POPPLER_0_15_1)
298++ void setLinearized (gboolean *linearized);
299++#else
300+ void setLinearized (gchar *linearized);
301++#endif
302+ const gchar *getCreationDate (void);
303+ void setCreationDate (gchar *date);
304+ const gchar *getModifiedDate (void);
305+@@ -382,7 +386,11 @@ namespace ePDFView
306+ /// The document's keyword.
307+ gchar *m_Keywords;
308+ /// Tells if the document is linearized or not.
309++#if defined (HAVE_POPPLER_0_15_1)
310++ gboolean *m_Linearized;
311++#else
312+ gchar *m_Linearized;
313++#endif
314+ /// The document's modification date and time.
315+ gchar *m_ModifiedDate;
316+ /// @brief The list of classes that will receive notifications
317+diff -rpu epdfview.orig//src/PDFDocument.cxx epdfview/src/PDFDocument.cxx
318+--- epdfview.orig//src/PDFDocument.cxx 2011-06-06 23:38:46.334634015 +0200
319++++ epdfview/src/PDFDocument.cxx 2011-06-06 23:38:57.754634017 +0200
320+@@ -299,7 +299,11 @@ PDFDocument::loadMetadata (void)
321+ gchar *format = NULL;
322+ gchar *keywords = NULL;
323+ PopplerPageLayout layout = POPPLER_PAGE_LAYOUT_UNSET;
324++#if defined (HAVE_POPPLER_0_15_1)
325++ gboolean *linearized = NULL;
326++#else
327+ gchar *linearized = NULL;
328++#endif
329+ GTime modDate;
330+ PopplerPageMode mode = POPPLER_PAGE_MODE_UNSET;
331+ gchar *producer = NULL;
332+diff -rpu epdfview.orig//THANKS epdfview/THANKS
333+--- epdfview.orig//THANKS 2011-06-06 23:38:46.224634015 +0200
334++++ epdfview/THANKS 2011-06-06 23:38:57.754634017 +0200
335+@@ -6,6 +6,7 @@ contributions:
336+ - Alexander <lothalev@gmail.com>, for corrections in the Polish translation.
337+ - Enrico Tröger <enrico.troeger@uvena.de>, for his full screen patch and others.
338+ - ewtoombs <ewtoombs@uwaterloo.ca>, for his patches.
339++ - Dennis Sheil <dennis-poppler@vartmp.com>, for his patch.
340+ - Daniel Nylander <po@danielnylander.se>, for his Swedish translation.
341+ - Daniel Pielmeie <daniel.pielmeie@googlemail.com>, for his patches.
342+ - Dragonlord <dragonlord@seznam.cz>, for his Czech translation.
343+@@ -18,6 +19,7 @@ contributions:
344+ - Michael Opitz <opitz.michael@gmail.com>, for his patches.
345+ - Moritz Heiber <moe@xfce.org>, for his German translation.
346+ - Mr_Moustache <mr.moustache@laposte.net>, for his French translation.
347++ - Jakob Gruber <jakob.gruber@gmail.com>, for his segfault patches.
348+ - Nuno Miguel <nunis@netcabo.pt>, for his European Portuguese translation.
349+ - Nyu <nyu_8804@yahoo.co.jp>, for his Japanese translation.
350+ - Pablo Mazzini <pmazzini@gmail.com>, for his print patches.
351
352=== modified file 'src/IDocument.cxx'
353--- src/IDocument.cxx 2009-03-10 00:06:29 +0000
354+++ src/IDocument.cxx 2011-06-19 19:53:28 +0000
355@@ -135,7 +135,11 @@
356 m_FindPage = 0;
357 m_Format = NULL;
358 m_Keywords = NULL;
359+#if defined (HAVE_POPPLER_0_15_1)
360+ m_Linearized = FALSE;
361+#else
362 m_Linearized = NULL;
363+#endif
364 m_ModifiedDate = NULL;
365 m_PageCache = NULL;
366 m_PageCacheAge = 0;
367@@ -164,7 +168,9 @@
368 g_free (m_FileName);
369 g_free (m_Format);
370 g_free (m_Keywords);
371+#if !defined (HAVE_POPPLER_0_15_1)
372 g_free (m_Linearized);
373+#endif
374 g_free (m_ModifiedDate);
375 g_free (m_Password);
376 g_free (m_Producer);
377@@ -555,9 +561,8 @@
378 void
379 IDocument::setTitle (gchar *title)
380 {
381- gchar *oldTitle = m_Title;
382+ g_free (m_Title);
383 m_Title = g_strdup (title);
384- g_free (oldTitle);
385 g_free (title);
386 }
387
388@@ -585,9 +590,8 @@
389 void
390 IDocument::setAuthor (gchar *author)
391 {
392- gchar *oldAuthor = m_Author;
393+ g_free(m_Author);
394 m_Author = g_strdup (author);
395- g_free (oldAuthor);
396 g_free (author);
397 }
398
399@@ -615,10 +619,9 @@
400 void
401 IDocument::setSubject (gchar *subject)
402 {
403- gchar *oldSubject = m_Subject;
404+ g_free (m_Subject);
405 m_Subject = g_strdup (subject);
406- g_free (oldSubject);
407- m_Subject = subject;
408+ g_free (subject);
409 }
410
411 ///
412@@ -646,9 +649,8 @@
413 void
414 IDocument::setKeywords (gchar *keywords)
415 {
416- gchar *oldKeywords = m_Keywords;
417+ g_free(m_Keywords);
418 m_Keywords = g_strdup (keywords);
419- g_free (oldKeywords);
420 g_free (keywords);
421 }
422
423@@ -677,9 +679,8 @@
424 void
425 IDocument::setCreator (gchar *creator)
426 {
427- gchar *oldCreator = m_Creator;
428+ g_free (m_Creator);
429 m_Creator = g_strdup (creator);
430- g_free (oldCreator);
431 g_free (creator);
432 }
433 ///
434@@ -707,9 +708,8 @@
435 void
436 IDocument::setProducer (gchar *producer)
437 {
438- gchar *oldProducer = m_Producer;
439+ g_free (m_Producer);
440 m_Producer = g_strdup (producer);
441- g_free (oldProducer);
442 g_free (producer);
443 }
444
445@@ -739,9 +739,8 @@
446 void
447 IDocument::setFormat (gchar *format)
448 {
449- gchar *oldFormat = m_Format;
450+ g_free (m_Format);
451 m_Format = g_strdup (format);
452- g_free (oldFormat);
453 g_free (format);
454 }
455
456@@ -755,11 +754,16 @@
457 const gchar *
458 IDocument::getLinearized ()
459 {
460+#if defined (HAVE_POPPLER_0_15_1)
461+ if ( m_Linearized ) return "Yes";
462+ else return "No";
463+#else
464 if ( NULL == m_Linearized )
465 {
466 return "No";
467 }
468 return m_Linearized;
469+#endif
470 }
471
472 ///
473@@ -768,14 +772,21 @@
474 /// @param linearized Set to "Yes" if the document is linearized. "No"
475 /// otherwise. IDocument will free it.
476 ///
477-void
478-IDocument::setLinearized (gchar *linearized)
479-{
480- gchar *oldLinearized = m_Linearized;
481+#if defined (HAVE_POPPLER_0_15_1)
482+void
483+IDocument::setLinearized (gboolean *linearized)
484+{
485+ m_Linearized = linearized;
486+}
487+#else
488+void
489+ IDocument::setLinearized (gchar *linearized)
490+{
491+ g_free (m_Linearized);
492 m_Linearized = g_strdup (linearized);
493- g_free (oldLinearized);
494 g_free (linearized);
495 }
496+#endif
497
498 ///
499 /// @brief Gets the document's creation date.
500@@ -802,9 +813,8 @@
501 void
502 IDocument::setCreationDate (gchar *date)
503 {
504- gchar *oldCreationDate = m_CreationDate;
505+ g_free (m_CreationDate);
506 m_CreationDate = g_strdup (date);
507- g_free (oldCreationDate);
508 g_free (date);
509 }
510
511@@ -833,9 +843,8 @@
512 void
513 IDocument::setModifiedDate (gchar *date)
514 {
515- gchar *oldModifiedDate = m_ModifiedDate;
516+ g_free (m_ModifiedDate);
517 m_ModifiedDate = g_strdup (date);
518- g_free (oldModifiedDate);
519 g_free (date);
520 }
521
522@@ -917,9 +926,8 @@
523 void
524 IDocument::setPassword (const gchar *password)
525 {
526- gchar *oldPassword = m_Password;
527+ g_free (m_Password);
528 m_Password = g_strdup (password);
529- g_free (oldPassword);
530 }
531
532 ///
533@@ -959,14 +967,8 @@
534 {
535 g_assert (NULL != fileName && "Tried to set a NULL file name.");
536
537- // Don't ask me why, but then I set like this:
538- // g_free (m_FileName);
539- // m_FileName = fileName
540- // Somehow the g_free also frees the parameter ????????
541- //
542- gchar *oldFileName = m_FileName;
543+ g_free(m_FileName);
544 m_FileName = g_strdup (fileName);
545- g_free (oldFileName);
546 }
547
548 ///
549
550=== modified file 'src/IDocument.h'
551--- src/IDocument.h 2009-03-10 00:06:29 +0000
552+++ src/IDocument.h 2011-06-19 19:53:28 +0000
553@@ -306,7 +306,11 @@
554 const gchar *getFormat (void);
555 void setFormat (gchar *format);
556 const gchar *getLinearized (void);
557+#if defined (HAVE_POPPLER_0_15_1)
558+ void setLinearized (gboolean *linearized);
559+#else
560 void setLinearized (gchar *linearized);
561+#endif
562 const gchar *getCreationDate (void);
563 void setCreationDate (gchar *date);
564 const gchar *getModifiedDate (void);
565@@ -382,7 +386,11 @@
566 /// The document's keyword.
567 gchar *m_Keywords;
568 /// Tells if the document is linearized or not.
569+#if defined (HAVE_POPPLER_0_15_1)
570+ gboolean *m_Linearized;
571+#else
572 gchar *m_Linearized;
573+#endif
574 /// The document's modification date and time.
575 gchar *m_ModifiedDate;
576 /// @brief The list of classes that will receive notifications
577
578=== modified file 'src/PDFDocument.cxx'
579--- src/PDFDocument.cxx 2011-02-11 22:38:22 +0000
580+++ src/PDFDocument.cxx 2011-06-19 19:53:28 +0000
581@@ -299,7 +299,11 @@
582 gchar *format = NULL;
583 gchar *keywords = NULL;
584 PopplerPageLayout layout = POPPLER_PAGE_LAYOUT_UNSET;
585+#if defined (HAVE_POPPLER_0_15_1)
586+ gboolean *linearized = NULL;
587+#else
588 gchar *linearized = NULL;
589+#endif
590 GTime modDate;
591 PopplerPageMode mode = POPPLER_PAGE_MODE_UNSET;
592 gchar *producer = NULL;

Subscribers

People subscribed via source and target branches