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 ad...@apache.org on 2008/05/11 14:22:23 UTC
svn commit: r655309 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop:
fo/FObj.java layoutmgr/AbstractLayoutManager.java
Author: adelmelle
Date: Sun May 11 05:22:22 2008
New Revision: 655309
URL: http://svn.apache.org/viewvc?rev=655309&view=rev
Log:
Make the LM clean up on end-of-layout, if possible.
Added clearChildNodes() method to FObj to release the reference to the FO's children.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java?rev=655309&r1=655308&r2=655309&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java Sun May 11 05:22:22 2008
@@ -515,6 +515,13 @@
return -1;
}
+ /**
+ * Clears the list of child nodes.
+ */
+ public void clearChildNodes() {
+ this.firstChild = null;
+ }
+
/** @return the "id" property. */
public String getId() {
return id;
@@ -598,7 +605,7 @@
return (super.toString() + "[@id=" + this.id + "]");
}
-
+ /** Basic {@link FONodeIterator} implementation */
public class FObjIterator implements FONodeIterator {
private static final int F_NONE_ALLOWED = 0;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java?rev=655309&r1=655308&r2=655309&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Sun May 11 05:22:22 2008
@@ -147,15 +147,11 @@
isFinished = fin;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void addAreas(PositionIterator posIter, LayoutContext context) {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public LinkedList getNextKnuthElements(LayoutContext context,
int alignment) {
log.warn("null implementation of getNextKnuthElements() called!");
@@ -163,9 +159,7 @@
return null;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public LinkedList getChangedKnuthElements(List oldList,
int alignment) {
log.warn("null implementation of getChangeKnuthElement() called!");
@@ -390,7 +384,7 @@
/**
* Checks to see if the incoming {@link Position}
* is the last one for this LM, and if so, calls
- * {@link #notifyEndOfLayout()}
+ * {@link #notifyEndOfLayout()} and cleans up.
*
* @param pos the {@link Position} to check
*/
@@ -398,7 +392,32 @@
if (pos != null
&& pos.getLM() == this
&& this.isLast(pos)) {
+
notifyEndOfLayout();
+
+ /* References to the child LMs are no longer needed
+ */
+ childLMs = null;
+ curChildLM = null;
+ childLMiter = null;
+
+ /* markers that qualify have been transferred to the page
+ */
+ markers = null;
+
+ /* References to the FO's children can be released if the
+ * LM is a descendant of the FlowLM. For static-content
+ * the FO may still be needed on following pages.
+ */
+ LayoutManager lm = this.parentLM;
+ while (!(lm instanceof FlowLayoutManager
+ || lm instanceof PageSequenceLayoutManager)) {
+ lm = lm.getParent();
+ }
+ if (lm instanceof FlowLayoutManager) {
+ fobj.clearChildNodes();
+ fobjIter = null;
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org
Re: svn commit: r655309 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: fo/FObj.java layoutmgr/AbstractLayoutManager.java
Posted by Andreas Delmelle <an...@telenet.be>.
On May 11, 2008, at 14:22, adelmelle@apache.org wrote:
> Author: adelmelle
> Date: Sun May 11 05:22:22 2008
> New Revision: 655309
>
> URL: http://svn.apache.org/viewvc?rev=655309&view=rev
> Log:
> Make the LM clean up on end-of-layout, if possible.
> Added clearChildNodes() method to FObj to release the reference to
> the FO's children.
FWIW, I don't think it helps /that/ much yet, but it seemed like a
sane thing, and didn't break anything, so I decided to commit it anyway.
In theory, this should provide a bit more room once the area-
generation begins. Blocks, inlines and lists will now release the
references to their children once their last area has been added to
the tree...
The larger documents I tested it on did also have large tables so
maybe that explains why the effect was not immediately visible to me.
For table-elements, something similar might be possible, but I
couldn't get that to work just yet, hence why I decided to move it
into checkEndOfLayout() for the moment, which is only used by the LMs
I modified a few days ago to get page-number-citation-last working.
Andreas