Skip to content

Commit

Permalink
Improve table border detection
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Jul 11, 2024
1 parent 50962a4 commit 1aa3887
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,17 @@ private List<TableBorderBuilder> findTableBorders(Integer pageNumber) {
private void mergeTableBorders(List<TableBorderBuilder> tableBorders) {
for (int i = tableBorders.size() - 2; i >= 0; i--) {
TableBorderBuilder border = tableBorders.get(i);
for (int j = i + 1; j < tableBorders.size();) {
List<Integer> indexes = new LinkedList<>();
for (int j = tableBorders.size() - 1; j > i; j--) {
TableBorderBuilder border2 = tableBorders.get(j);
if (border.isConnectedBorder(border2)) {
border.mergeBorder(border2);
tableBorders.remove(j);
} else {
j++;
indexes.add(j);
}
}
for (Integer index : indexes) {
border.mergeBorder(tableBorders.get(index));
tableBorders.remove((int)index);
}
}
}

Expand Down

0 comments on commit 1aa3887

Please sign in to comment.