Bug 96561 - PDFDoc::saveIncrementalUpdate() saves a new version of document regardless if the document is actually modified
Summary: PDFDoc::saveIncrementalUpdate() saves a new version of document regardless if...
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-17 11:40 UTC by Jakub Alba
Modified: 2016-11-25 10:22 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (757 bytes, patch)
2016-06-17 11:44 UTC, Jakub Alba
Details | Splinter Review
[PATCH] Fix PDFDoc::saveIncrementalUpdate()'s detection of document being modified (884 bytes, patch)
2016-07-22 09:13 UTC, Jakub Alba
Details | Splinter Review
[PATCH] PDFDoc::saveIncrementalUpdate: don't check if there are updated entries (1.62 KB, patch)
2016-08-07 00:03 UTC, Jakub Alba
Details | Splinter Review
[PATCH] Fix PDFDoc::saveIncrementalUpdate()'s detection of document being modified (873 bytes, patch)
2016-10-22 19:06 UTC, Jakub Alba
Details | Splinter Review
[PATCH] PDFDoc::saveIncrementalUpdate: don't check if there are updated entries (1.60 KB, patch)
2016-10-22 19:09 UTC, Jakub Alba
Details | Splinter Review

Description Jakub Alba 2016-06-17 11:40:17 UTC
The condition in line 967 of poppler/PDFDoc.cc will always be false, since there is always at least one entry in uxref (added in line 942 to comply with PDF spec).
Comment 1 Jakub Alba 2016-06-17 11:44:18 UTC
Created attachment 124571 [details] [review]
proposed patch
Comment 2 Jakub Alba 2016-07-22 09:13:59 UTC
Created attachment 125254 [details] [review]
[PATCH] Fix PDFDoc::saveIncrementalUpdate()'s detection of document being modified

Added a comment explaining why it should be 1, not 0.
Comment 3 Jakub Alba 2016-08-07 00:03:38 UTC
Created attachment 125580 [details] [review]
[PATCH] PDFDoc::saveIncrementalUpdate: don't check if there are updated entries

Or we can stop checking the number of updated entries, since the only caller already checks if the document is modified. Choice is yours.
Comment 4 Jakub Alba 2016-10-22 19:06:28 UTC
Created attachment 127478 [details] [review]
[PATCH] Fix PDFDoc::saveIncrementalUpdate()'s detection of document being modified
Comment 5 Jakub Alba 2016-10-22 19:09:36 UTC
Created attachment 127479 [details] [review]
[PATCH] PDFDoc::saveIncrementalUpdate: don't check if there are updated entries
Comment 6 Jakub Alba 2016-10-22 19:10:16 UTC
I've updated my name and e-mail in the commit author info.
Comment 7 Albert Astals Cid 2016-11-25 10:22:10 UTC
Pushed the one with the "fixed" check


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.