Bug 96561

Summary: PDFDoc::saveIncrementalUpdate() saves a new version of document regardless if the document is actually modified
Product: poppler Reporter: Jakub Alba <jakubalba>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: jakubalba
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch
[PATCH] Fix PDFDoc::saveIncrementalUpdate()'s detection of document being modified
[PATCH] PDFDoc::saveIncrementalUpdate: don't check if there are updated entries
[PATCH] Fix PDFDoc::saveIncrementalUpdate()'s detection of document being modified
[PATCH] PDFDoc::saveIncrementalUpdate: don't check if there are updated entries

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.