diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/PageLayoutManager.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java index 5a202c2d2..9a292696b 100644 --- a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java @@ -88,6 +88,7 @@ import org.apache.fop.fo.properties.Overflow; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.HashMap; import java.awt.Rectangle; import java.util.Iterator; import java.awt.geom.Rectangle2D; @@ -149,6 +150,12 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable private SimplePageMaster currentSimplePageMaster; /** + * The collection of StaticContentLayoutManager objects that are associated + * with this Page Sequence, keyed by flow-name. + */ + private HashMap staticContentLMs = new HashMap(4); + + /** * This is the top level layout manager. * It is created by the PageSequence FO. * @@ -896,9 +903,15 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable * @return a StaticContent layout manager */ public StaticContentLayoutManager getStaticContentLayoutManager(StaticContent sc) { - StaticContentLayoutManager lm = new StaticContentLayoutManager(); + StaticContentLayoutManager lm = + (StaticContentLayoutManager)staticContentLMs.get(sc.getFlowName()); + if (lm != null) { + return lm; + } + lm = new StaticContentLayoutManager(); lm.setUserAgent(getUserAgent()); lm.setFObj(sc); + staticContentLMs.put(sc.getFlowName(), lm); return lm; } |