You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2004/12/07 21:11:22 UTC
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java PageSequenceLayoutManager.java BlockLayoutManager.java RetrieveMarkerLayoutManager.java
spepping 2004/12/07 12:11:22
Modified: src/java/org/apache/fop/fo/flow Marker.java
RetrieveMarker.java
src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
PageSequenceLayoutManager.java
BlockLayoutManager.java
Removed: src/java/org/apache/fop/layoutmgr
RetrieveMarkerLayoutManager.java
Log:
Removed RetrieveMarkerLM. The LMs of the marker children are attached
in the LM tree as the direct children of the LM of the parent of the
RetrieveMarker. This patch solves bug 32253.
Revision Changes Path
1.21 +19 -1 xml-fop/src/java/org/apache/fop/fo/flow/Marker.java
Index: Marker.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Marker.java 30 Nov 2004 20:20:59 -0000 1.20
+++ Marker.java 7 Dec 2004 20:11:21 -0000 1.21
@@ -20,6 +20,9 @@
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
import org.xml.sax.Locator;
@@ -70,7 +73,7 @@
// Set a new parent property list and bind all the children again.
propertyList.setParentPropertyList(parentPropertyList);
for (Iterator i = children.keySet().iterator(); i.hasNext(); ) {
- Object child = i.next();
+ FONode child = (FONode) i.next();
PropertyList childList = (PropertyList) children.get(child);
if (child instanceof FObj) {
((FObj) child).bind(childList);
@@ -123,6 +126,21 @@
throws ValidationException {
if (!isBlockOrInlineItem(nsURI, localName)) {
invalidChildError(loc, nsURI, localName);
+ }
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
+ * @todo remove null check when vCN() & endOfNode() implemented
+ */
+ public void addLayoutManager(List list) {
+ ListIterator baseIter = getChildNodes();
+ if (baseIter == null) {
+ return;
+ }
+ while (baseIter.hasNext()) {
+ FONode child = (FONode) baseIter.next();
+ child.addLayoutManager(list);
}
}
1.24 +11 -8 xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
Index: RetrieveMarker.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- RetrieveMarker.java 28 Oct 2004 10:00:21 -0000 1.23
+++ RetrieveMarker.java 7 Dec 2004 20:11:21 -0000 1.24
@@ -23,6 +23,8 @@
import org.xml.sax.Locator;
+import org.apache.commons.logging.Log;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FONode;
@@ -30,7 +32,7 @@
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.StaticPropertyList;
import org.apache.fop.fo.ValidationException;
-import org.apache.fop.layoutmgr.RetrieveMarkerLayoutManager;
+import org.apache.fop.layoutmgr.LayoutManager;
/**
@@ -108,13 +110,14 @@
return retrieveBoundary;
}
-
- /**
- * @see org.apache.fop.fo.FONode#addLayoutManager(List)
- */
- public void addLayoutManager(List list) {
- RetrieveMarkerLayoutManager lm = new RetrieveMarkerLayoutManager(this);
- list.add(lm);
+ public void bindMarker(Marker marker) {
+ // assert(marker != null);
+ try {
+ marker.rebind(getPropertyList());
+ } catch (FOPException exc) {
+ Log log = getLogger();
+ log.error("fo:retrieve-marker unable to rebind property values", exc);
+ }
}
/**
1.32 +12 -0 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
Index: AbstractLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- AbstractLayoutManager.java 13 Nov 2004 20:37:17 -0000 1.31
+++ AbstractLayoutManager.java 7 Dec 2004 20:11:21 -0000 1.32
@@ -24,6 +24,7 @@
import org.apache.fop.area.Resolvable;
import org.apache.fop.area.PageViewport;
import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.flow.RetrieveMarker;
import org.apache.fop.fo.flow.Marker;
import org.apache.commons.logging.Log;
@@ -373,6 +374,17 @@
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 = marker;
+ }
foNode.addLayoutManager(newLMs);
}
}
1.16 +5 -1 xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
Index: PageSequenceLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- PageSequenceLayoutManager.java 29 Nov 2004 08:45:14 -0000 1.15
+++ PageSequenceLayoutManager.java 7 Dec 2004 20:11:21 -0000 1.16
@@ -392,6 +392,10 @@
}
}
+ if (mark == null) {
+ log.debug("found no marker with name: " + name);
+ }
+
return mark;
}
1.34 +0 -2 xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
Index: BlockLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- BlockLayoutManager.java 13 Nov 2004 20:37:17 -0000 1.33
+++ BlockLayoutManager.java 7 Dec 2004 20:11:21 -0000 1.34
@@ -121,7 +121,6 @@
while (proxyLMiter.hasNext()) {
LayoutManager lm = (LayoutManager) proxyLMiter.next();
- lm.setParent(this);
if (lm.generatesInlineAreas()) {
LineLayoutManager lineLM = createLineManager(lm);
addChildLM(lineLM);
@@ -148,7 +147,6 @@
inlines.add(firstlm);
while (proxyLMiter.hasNext()) {
LayoutManager lm = (LayoutManager) proxyLMiter.next();
- lm.setParent(this);
if (lm.generatesInlineAreas()) {
inlines.add(lm);
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org