aboutsummaryrefslogtreecommitdiffstats
path: root/fop-core/src
diff options
context:
space:
mode:
authorSimon Steiner <ssteiner@apache.org>2017-06-08 10:11:33 +0000
committerSimon Steiner <ssteiner@apache.org>2017-06-08 10:11:33 +0000
commitff4455dd4bbb746c88f8991118d64dfedec86666 (patch)
tree6ac7c8bbd24ba4809916752fb0d66604bcc31940 /fop-core/src
parenta9f1a8fd0794a47d19f286b92bf0e927dfa736e4 (diff)
downloadxmlgraphics-fop-ff4455dd4bbb746c88f8991118d64dfedec86666.tar.gz
xmlgraphics-fop-ff4455dd4bbb746c88f8991118d64dfedec86666.zip
FOP-2712: NoSuchElementException on changing IPD
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1798040 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core/src')
-rw-r--r--fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java10
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,