diff options
author | Steve Coffman <gears@apache.org> | 2001-08-01 22:12:54 +0000 |
---|---|---|
committer | Steve Coffman <gears@apache.org> | 2001-08-01 22:12:54 +0000 |
commit | eeb2adff569057e2b6deb089ba9dffb21fb3a00b (patch) | |
tree | c8968573d60b496aa17befb1afbec840ddc1b355 /src/org/apache/fop/fo/FOText.java | |
parent | a5bc30d4a3977d60f0e70c2792bc4e3a37913a3d (diff) | |
download | xmlgraphics-fop-eeb2adff569057e2b6deb089ba9dffb21fb3a00b.tar.gz xmlgraphics-fop-eeb2adff569057e2b6deb089ba9dffb21fb3a00b.zip |
Adds Mark Lillywhite's performance and memory patch in all it's glory.
Unfortunately breaks marker support.
(AreaTree getNextPage and getPreviousPage return the current page)
XSL-FO with markers is not a good idea until it is fixed.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194385 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/FOText.java')
-rw-r--r-- | src/org/apache/fop/fo/FOText.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/org/apache/fop/fo/FOText.java b/src/org/apache/fop/fo/FOText.java index 20095d988..05e5a660a 100644 --- a/src/org/apache/fop/fo/FOText.java +++ b/src/org/apache/fop/fo/FOText.java @@ -20,10 +20,16 @@ import org.apache.fop.system.BufferManager; /** * a text node in the formatting object tree + * + * Modified by Mark Lillywhite, mark-fop@inomial.com. + * Unfortunately the BufferManager implementatation holds + * onto references to the character data in this object + * longer than the lifetime of the object itself, causing + * excessive memory consumption and OOM errors. */ public class FOText extends FONode { - // protected char[] ca; + protected char[] ca; protected int start; protected int length; @@ -46,10 +52,12 @@ public class FOText extends FONode { public FOText(char[] chars, int s, int e, FObj parent) { super(parent); this.start = 0; - char ca[] = new char[e - s]; + this.ca = new char[e - s]; for (int i = s; i < e; i++) ca[i - s] = chars[i]; this.length = e - s; + + /* ML - remove refs to BufferManager this.bufferManager = parent.bufferManager; if (this.bufferManager != null) { bufferManager.writeBuffer((Object)this, ca); @@ -57,6 +65,7 @@ public class FOText extends FONode { System.out.println("abnormal exit"); System.exit(0); } + */ } public void setUnderlined(boolean ul) { @@ -73,7 +82,9 @@ public class FOText extends FONode { public boolean willCreateArea() { - char ca[] = this.bufferManager.readBuffer((Object)this); + // ML - remove refs to BufferManager + //char ca[] = this.bufferManager.readBuffer((Object)this); + this.whiteSpaceCollapse = this.parent.properties.get("white-space-collapse").getEnum(); if (this.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE @@ -92,7 +103,8 @@ public class FOText extends FONode { } public Status layout(Area area) throws FOPException { - char ca[] = this.bufferManager.readBuffer((Object)this); + // ML - remove refs to BufferManager + // char ca[] = this.bufferManager.readBuffer((Object)this); if (!(area instanceof BlockArea)) { MessageHandler.errorln("WARNING: text outside block area" + new String(ca, start, length)); |