aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-02-08 09:17:50 +0000
committerJeremias Maerki <jeremias@apache.org>2005-02-08 09:17:50 +0000
commit37374bcb6940540641607a8596ae52228596a42a (patch)
tree6251ef75092b86cc325e09c802d338d8127d41c3 /src
parent83371d2d601858d8938c8468a361b9b67a66038c (diff)
downloadxmlgraphics-fop-37374bcb6940540641607a8596ae52228596a42a.tar.gz
xmlgraphics-fop-37374bcb6940540641607a8596ae52228596a42a.zip
moving retrieve-marker replacement into separate method to make preLoadList easier to read and understand.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198390 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java39
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;