Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1161 Fix List rendering in ColumnText #1162

Merged

Conversation

joostme
Copy link
Contributor

@joostme joostme commented May 8, 2024

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 the k < 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 until k <= item.size() and changed the check to only run once k == 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

- When nesting level is reduced by more than one layer, ColumnText stopped rendering Lists
Copy link

sonarqubecloud bot commented May 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@asturio asturio linked an issue May 21, 2024 that may be closed by this pull request
@asturio
Copy link
Member

asturio commented May 21, 2024

Sorry, just reviewing this yet.

@asturio asturio self-requested a review May 21, 2024 11:40
@asturio asturio merged commit 453ef73 into LibrePDF:master May 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested Lists in ColumnText not rendered correctly
2 participants