From: Vincent Hennebert Date: Tue, 24 Nov 2009 14:48:52 +0000 (+0000) Subject: Bugfix in Changing IPD: reset only the children LMs that have been created so far... X-Git-Tag: fop-1_0~99 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d61456f236d52c5d828b12d0ff684688d297b41b;p=xmlgraphics-fop.git Bugfix in Changing IPD: reset only the children LMs that have been created so far. Layout managers following a forced break have not even been created yet. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@883709 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 82f0599eb..e6a5bea5e 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -20,6 +20,7 @@ package org.apache.fop.layoutmgr; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Map; @@ -463,11 +464,8 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager isFinished = false; curChildLM = null; childLMiter = new LMiter(this); - /* - * Reset the children LM. Can't rely on childLMiter since it may have - * been set to null in checkEndOfLayout. - */ - for (LMiter iter = new LMiter(this); iter.hasNext();) { + /* Reset all the children LM that have been created so far. */ + for (Iterator iter = getChildLMs().iterator(); iter.hasNext();) { ((LayoutManager) iter.next()).reset(); } if (fobj != null) { diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_break-before.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_break-before.xml new file mode 100644 index 000000000..22e20d944 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_break-before.xml @@ -0,0 +1,96 @@ + + + + + +

+ This test checks that a forced before break following an IPD change is correctly handled. +

+
+ + + + + + + + + + + + + + + + + + In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. + In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. + In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. In olden times when wishing still helped one, there lived a king + whose daughters were all beautiful, but the youngest was so beautiful that the sun + itself, which has seen so much, was astonished whenever it shone in her + face. + In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. + + + In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. + In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. + + + + + + + + + + + + + + + + + +