aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-05-18 16:03:38 +0000
committerJeremias Maerki <jeremias@apache.org>2005-05-18 16:03:38 +0000
commitd8d40c99b9654e0974f4939a2028137253cfeea5 (patch)
tree30575ea0f537385c76dab1de8490e78905d67793 /src/java/org
parenta85df35d8276407cf282434201ddf24f4dc2913a (diff)
downloadxmlgraphics-fop-d8d40c99b9654e0974f4939a2028137253cfeea5.tar.gz
xmlgraphics-fop-d8d40c99b9654e0974f4939a2028137253cfeea5.zip
Bugfix for a ClassCastException on autoheight block-containers where Position instances come through for normal penalties between blocks.
Additional fix so a distinction is made between space-related positions and the penalties that caused the problem above. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198655 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
index 8a1c3c86d..d9e06a5ff 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
@@ -585,7 +585,10 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
while (parentIter.hasNext()) {
pos = (Position) parentIter.next();
/* LF *///System.out.println("pos = " + pos.getClass().getName());
- Position innerPosition = ((NonLeafPosition) pos).getPosition();
+ Position innerPosition = null;
+ if (pos instanceof NonLeafPosition) {
+ innerPosition = ((NonLeafPosition)pos).getPosition();
+ }
if (pos instanceof BlockContainerPosition) {
if (bcpos != null) {
throw new IllegalStateException("Only one BlockContainerPosition allowed");
@@ -594,17 +597,19 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
//Add child areas inside the reference area
//bcpos.getBreaker().addContainedAreas();
} else if (innerPosition == null) {
- // pos was created by this BCLM and was inside an element
- // representing space before or after
- // this means the space was not discarded
- if (positionList.size() == 0 && bcpos == null) {
- // pos was in the element representing space-before
- bSpaceBefore = true;
- /* LF *///System.out.println(" space-before");
+ if (pos instanceof NonLeafPosition) {
+ // pos was created by this BCLM and was inside an element
+ // representing space before or after
+ // this means the space was not discarded
+ if (positionList.size() == 0 && bcpos == null) {
+ // pos was in the element representing space-before
+ bSpaceBefore = true;
+ } else {
+ // pos was in the element representing space-after
+ bSpaceAfter = true;
+ }
} else {
- // pos was in the element representing space-after
- bSpaceAfter = true;
- /* LF *///System.out.println(" space-after");
+ //ignore (probably a Position for a simple penalty between blocks)
}
} else if (innerPosition.getLM() == this
&& !(innerPosition instanceof MappingPosition)) {