diff options
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 0f6770cd4..45ef5e6e3 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -394,6 +394,29 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants } /** + * Handles retrieve-marker nodes as they occur. + * @param foNode FO node to check + * @return the original foNode or in case of a retrieve-marker the replaced + * FO node. null if the the replacement results in no nodes to be + * processed. + */ + private FONode handleRetrieveMarker(FONode foNode) { + if (foNode instanceof RetrieveMarker) { + RetrieveMarker rm = (RetrieveMarker) foNode; + Marker marker = retrieveMarker(rm.getRetrieveClassName(), + rm.getRetrievePosition(), + rm.getRetrieveBoundary()); + if (marker == null) { + return null; + } + rm.bindMarker(marker); + return rm; + } else { + return foNode; + } + } + + /** * Convenience method: preload a number of child LMs * @param size the requested number of child LMs * @return the list with the preloaded child LMs @@ -407,19 +430,11 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants Object theobj = fobjIter.next(); if (theobj instanceof FONode) { FONode foNode = (FONode) theobj; - if (foNode instanceof RetrieveMarker) { - RetrieveMarker rm = (RetrieveMarker) foNode; - Marker marker = retrieveMarker(rm.getRetrieveClassName(), - rm.getRetrievePosition(), - rm.getRetrieveBoundary()); - if (marker == null) { - continue; - } - rm.bindMarker(marker); - foNode = rm; + foNode = handleRetrieveMarker(foNode); + if (foNode != null) { + getAreaTreeHandler().getLayoutManagerMaker(). + makeLayoutManagers(foNode, newLMs); } - getAreaTreeHandler().getLayoutManagerMaker(). - makeLayoutManagers(foNode, newLMs); } } return newLMs; |