fix issue #951 - Introduced logic for output reordering of indirect o… #1755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR fixes issue #951.
How?
Issue pops up in files which use the "Incremental Update" feature and have modifed indirect objects in the updated sections but no new objects added.
If the operation of sorting by object number is done for this kind of documents in the created context, than the objects are written at the wrong offsets and readers become confused leading to the rendering errors.
In case instead where new objects are added to the file, the sorting is necessary to consolidate the changes. At least that is what i've observed as simply removing the sorting lead to tests 17 and 18 to become corrupted (because those tests load a file with multiple update sections and add new objects).
Testing?
Tested by introducing a new test19 integration test which loads the problematic file and then executes the save operation to show the produced pdf file to the browser.
New Dependencies?
No
Screenshots
N/A
Checklist