From d61456f236d52c5d828b12d0ff684688d297b41b Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 24 Nov 2009 14:48:52 +0000 Subject: 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 --- .../fop/layoutmgr/AbstractLayoutManager.java | 8 +- .../flow_changing-ipd_break-before.xml | 96 ++++++++++++++++++++++ 2 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 test/layoutengine/standard-testcases/flow_changing-ipd_break-before.xml 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. + + + + + + + + + + + + + + + + + +
-- cgit v1.2.3