#1161 Fix List rendering in ColumnText #1162
Merged
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.
Description of the Bugfix
When adding nested Lists to ColumnText sometimes the rendering of the List just stops midway through. This is caused by nesting levels of lists being reduced by more than one at a time. See the related issue for more detailed information.
The issue was caused by the
if (k == items.size() - 1)
section not being reached, because of thek < items.size();
of the for loop. So when going back to the last item in the stack, the list rendering loop just exited instead of continuing with the previous list. I increased the for loop to run untilk <= item.size()
and changed the check to only run oncek == items.size()
. This ensures we run through each nested list completely and go back to the previous stack item if there is one in the stack.Related Issue: #1161
Compatibilities Issues
In my tests, List rendering in ColumnText still worked as expected.
Your real name
Joost Zöllner
Testing details
See the reproduction repo mentioned in the issue #1161