aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-02-03 08:18:27 +0000
committerJeremias Maerki <jeremias@apache.org>2005-02-03 08:18:27 +0000
commit69d42ce2637062798b0829d36511f4fceb74b97a (patch)
tree50c456a8b1ae83695467c31b5745ccf8890813e8 /src/java/org/apache/fop/fo
parentcabefa5972e2671e0249b45706b37502f62f986e (diff)
downloadxmlgraphics-fop-69d42ce2637062798b0829d36511f4fceb74b97a.tar.gz
xmlgraphics-fop-69d42ce2637062798b0829d36511f4fceb74b97a.zip
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.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198368 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo')
-rw-r--r--src/java/org/apache/fop/fo/FObj.java12
-rw-r--r--src/java/org/apache/fop/fo/flow/Block.java15
2 files changed, 21 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index 3281a4c27..87dc3bb1e 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -262,7 +262,16 @@ public abstract class FObj extends FONode implements Constants {
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 @@ public abstract class FObj extends FONode implements Constants {
return;
} else {
iter.remove();
+ notifyChildRemoval(node);
}
} else {
getLogger().error("fo:marker must be an initial child: " + mcname);
diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java
index b99d49c40..234abb6ce 100644
--- a/src/java/org/apache/fop/fo/flow/Block.java
+++ b/src/java/org/apache/fop/fo/flow/Block.java
@@ -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.CommonMarginBlock;
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 @@ public class Block extends FObjMixed {
}
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");