diff options
Diffstat (limited to 'fop-core')
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java index 25fa35885..4139ee094 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java @@ -778,10 +778,12 @@ public abstract class AbstractBreaker { * Remove the last 3 penalty-filler-forced break elements that were added by * the Knuth algorithm. They will be re-added later on. */ - ListIterator iter = returnedList.listIterator(returnedList.size()); - for (int i = 0; i < 3; i++) { - iter.previous(); - iter.remove(); + if (returnedList.size() > 2) { + ListIterator iter = returnedList.listIterator(returnedList.size()); + for (int i = 0; i < 3; i++) { + iter.previous(); + iter.remove(); + } } } else { returnedList = getNextKnuthElements(childLC, alignment, positionAtIPDChange, |