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 pi...@apache.org on 2003/03/02 14:47:45 UTC
cvs commit: xml-fop/src/org/apache/fop/layout BlockArea.java
pietsch 2003/03/02 05:47:44
Modified: src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain
Block.java
src/org/apache/fop/layout Tag: fop-0_20_2-maintain
BlockArea.java
Log:
Set currentLine to null after adding it in BlockArea.
Some cosmetical rearrangements.
PR: 17472 and several postings
Revision Changes Path
No revision
No revision
1.41.2.16 +16 -41 xml-fop/src/org/apache/fop/fo/flow/Block.java
Index: Block.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.41.2.15
retrieving revision 1.41.2.16
diff -u -r1.41.2.15 -r1.41.2.16
--- Block.java 25 Feb 2003 12:57:00 -0000 1.41.2.15
+++ Block.java 2 Mar 2003 13:47:44 -0000 1.41.2.16
@@ -185,8 +185,9 @@
area.end();
}
- if (area.getIDReferences() != null)
+ if (area.getIDReferences() != null) {
area.getIDReferences().createID(id);
+ }
this.marker = 0;
@@ -221,9 +222,6 @@
this.areasGenerated++;
if (this.areasGenerated == 1)
blockArea.isFirst(true);
- // for normal areas this should be the only pair
-// blockArea.addLineagePair(this, this.areasGenerated);
-
// markers
// if (this.hasMarkers())
// blockArea.addMarkers(this.getMarkers());
@@ -243,37 +241,25 @@
int numChildren = this.children.size();
for (int i = this.marker; i < numChildren; i++) {
FONode fo = (FONode)children.get(i);
- int status;
- if (Status.isIncomplete(status = fo.layout(blockArea))) {
+ int status = fo.layout(blockArea);
+ if (Status.isIncomplete(status)) {
this.marker = i;
- // this block was modified by
- // Hani Elabed 11/27/2000
- // if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE))
- // {
- // status = new Status(Status.AREA_FULL_SOME);
- // }
-
- // new block to replace the one above
- // Hani Elabed 11/27/2000
if (status == Status.AREA_FULL_NONE) {
- // something has already been laid out
- if ((i != 0)) {
- status = Status.AREA_FULL_SOME;
+ if (i == 0) {
+ // Nothing was laid out.
+ anythingLaidOut = false;
+ return status;
+ } else {
+ // A previous child has already been laid out.
area.addChild(blockArea);
area.setMaxHeight(area.getMaxHeight() - spaceLeft
+ blockArea.getMaxHeight());
area.increaseHeight(blockArea.getHeight());
anythingLaidOut = true;
-
- return status;
- } else // i == 0 nothing was laid out..
- {
- anythingLaidOut = false;
- return status;
+ return Status.AREA_FULL_SOME;
}
}
-
- // blockArea.end();
+ // Something has been laid out.
area.addChild(blockArea);
area.setMaxHeight(area.getMaxHeight() - spaceLeft
+ blockArea.getMaxHeight());
@@ -285,13 +271,10 @@
}
blockArea.end();
-
+ blockArea.isLast(true);
+ area.addChild(blockArea);
area.setMaxHeight(area.getMaxHeight() - spaceLeft
+ blockArea.getMaxHeight());
-
- area.addChild(blockArea);
-
- /* should this be combined into above? */
area.increaseHeight(blockArea.getHeight());
if (spaceAfter != 0) {
@@ -301,8 +284,6 @@
if (area instanceof BlockArea) {
area.start();
}
- // This is not needed any more and it consumes a LOT
- // of memory. So we release it for the GC.
areaHeight= blockArea.getHeight();
contentWidth= blockArea.getContentWidth();
@@ -311,18 +292,12 @@
int breakAfterStatus = propMgr.checkBreakAfter(area);
if (breakAfterStatus != Status.OK) {
this.marker = BREAK_AFTER;
- blockArea = null; //Faster GC - BlockArea is big
+ blockArea = null;
return breakAfterStatus;
}
-
if (keepWithNext != 0) {
- blockArea = null; // Faster GC - BlockArea is big
return Status.KEEP_WITH_NEXT;
}
-
- // log.error(" b:OK" + marker + " ");
- blockArea.isLast(true);
- blockArea = null; // Faster GC - BlockArea is big
return Status.OK;
}
No revision
No revision
1.31.2.5 +2 -1 xml-fop/src/org/apache/fop/layout/Attic/BlockArea.java
Index: BlockArea.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/Attic/BlockArea.java,v
retrieving revision 1.31.2.4
retrieving revision 1.31.2.5
diff -u -r1.31.2.4 -r1.31.2.5
--- BlockArea.java 25 Feb 2003 14:07:01 -0000 1.31.2.4
+++ BlockArea.java 2 Mar 2003 13:47:44 -0000 1.31.2.5
@@ -213,6 +213,7 @@
this.currentLineArea.addPending();
this.currentLineArea.align(this.alignLastLine);
this.addLineArea(this.currentLineArea);
+ this.currentLineArea = null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org