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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions openpdf/src/main/java/com/lowagie/text/pdf/ColumnText.java
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,18 @@ protected int goComposite(boolean simulate) throws DocumentException {
float listIndentation = list.getIndentationLeft();
int count = 0;
Stack<Object[]> stack = new Stack<>();
for (int k = 0; k < items.size(); ++k) {
for (int k = 0; k <= items.size(); ++k) {
if (k == items.size()) {
if (!stack.isEmpty()) {
Object[] objs = stack.pop();
list = (com.lowagie.text.List) objs[0];
items = list.getItems();
k = (Integer) objs[1];
listIndentation = (Float) objs[2];
}
continue;
}

Object obj = items.get(k);
if (obj instanceof ListItem) {
if (count == listIdx) {
Expand All @@ -1316,16 +1327,6 @@ protected int goComposite(boolean simulate) throws DocumentException {
items = list.getItems();
listIndentation += list.getIndentationLeft();
k = -1;
continue;
}
if (k == items.size() - 1) {
if (!stack.isEmpty()) {
Object[] objs = stack.pop();
list = (com.lowagie.text.List) objs[0];
items = list.getItems();
k = (Integer) objs[1];
listIndentation = (Float) objs[2];
}
}
}
int status = 0;
Expand Down