jeremias 2005/02/03 00:18:27
Modified: src/java/org/apache/fop/fo/flow Block.java
src/java/org/apache/fop/fo FObj.java
Log:
Bugfix for whitespace handling that surfaced after my last fix for linefeed
handling when markers are involved. Nodes preceeding a marker that don't create
an area were removed from the childNodes list but the firstInlineChild was not
cleared creating additional unwanted empty lines in the output.
Revision Changes Path
1.52 +10 -5 xml-fop/src/java/org/apache/fop/fo/flow/Block.java
Index: Block.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- Block.java 24 Dec 2004 12:06:25 -0000 1.51
+++ Block.java 3 Feb 2005 08:18:27 -0000 1.52
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
package org.apache.fop.fo.flow;
-// Java
-import java.util.List;
-
import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
@@ -45,7 +42,6 @@
import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.SpaceProperty;
-import org.apache.fop.layoutmgr.BlockLayoutManager;
import org.apache.fop.util.CharUtilities;
/*
@@ -323,6 +319,15 @@
}
super.addChildNode(child);
}
+
+ /**
+ * @see
org.apache.fop.fo.FObj#notifyChildRemoval(org.apache.fop.fo.FONode)
+ */
+ protected void notifyChildRemoval(FONode node) {
+ if (node != null && node == firstInlineChild) {
+ firstInlineChild = null;
+ }
+ }
private void handleWhiteSpace() {
//getLogger().debug("fo:block: handleWhiteSpace");
1.91 +11 -1 xml-fop/src/java/org/apache/fop/fo/FObj.java
Index: FObj.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- FObj.java 6 Jan 2005 00:56:25 -0000 1.90
+++ FObj.java 3 Feb 2005 08:18:27 -0000 1.91
@@ -262,7 +262,16 @@
return null;
}
- /**
+ /**
+ * Notifies a FObj that one of it's children is removed.
+ * This method is subclassed by Block to clear the firstInlineChild
variable.
+ * @param node the node that was removed
+ */
+ protected void notifyChildRemoval(FONode node) {
+ //nop
+ }
+
+ /**
* Add the marker to this formatting object.
* If this object can contain markers it checks that the marker
* has a unique class-name for this object and that it is
@@ -282,6 +291,7 @@
return;
} else {
iter.remove();
+ notifyChildRemoval(node);
}
} else {
getLogger().error("fo:marker must be an initial child: "
+ mcname);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]