aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-02-09 08:54:06 +0000
committerJeremias Maerki <jeremias@apache.org>2006-02-09 08:54:06 +0000
commit88879d05069e6d5fff9da743bd08f77d3a883f22 (patch)
treeebd124d6cc3fd309399229b91ec0e6b2e3e92ad4 /src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
parent3606df4b663e7b7189a625efeec89974eed5c41d (diff)
downloadxmlgraphics-fop-88879d05069e6d5fff9da743bd08f77d3a883f22.tar.gz
xmlgraphics-fop-88879d05069e6d5fff9da743bd08f77d3a883f22.zip
Bugfix: padding-top and padding-bottom on list-items could lead to wrong page break decisions and thus to overlapping text.
Bugfix: break-before and break-after were ignored on list-items. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@376226 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
index eb7a2599c..5c57796ce 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2005 The Apache Software Foundation.
+ * Copyright 1999-2006 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.
@@ -338,11 +338,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
contentList.addAll(returnedList);
if (((ListElement) returnedList.getLast()).isForcedBreak()) {
// a descendant of this block has break-after
- if (curLM.isFinished()) {
- // there is no other content in this block;
- // it's useless to add space after before a page break
- setFinished(true);
- }
/* extension: conversione di tutta la sequenza fin'ora ottenuta */
if (bpUnit > 0) {
@@ -356,11 +351,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return returnList;
}
- /*
- if (allocatedSpace.min > context.getStackLimit().max) {
- log.debug("Allocated space exceeds stack limit, returning early.");
- return returnList;
- }*/
}
// propagate and clear
context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING, childLC.isKeepWithNextPending());
@@ -863,6 +853,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
/**
* Creates Knuth elements for before border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
+ * @param isFirst true if this is the first time a layout manager instance needs to generate
+ * border and padding
*/
protected void addKnuthElementsForBorderPaddingBefore(LinkedList returnList, boolean isFirst) {
//Border and Padding (before)
@@ -888,6 +880,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
/**
* Creates Knuth elements for after border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
+ * @param isLast true if this is the last time a layout manager instance needs to generate
+ * border and padding
*/
protected void addKnuthElementsForBorderPaddingAfter(LinkedList returnList, boolean isLast) {
//Border and Padding (after)
@@ -913,6 +907,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
/**
* Creates Knuth elements for break-before and adds them to the return list.
* @param returnList return list to add the additional elements to
+ * @param context the layout context
* @return true if an element has been added due to a break-before.
*/
protected boolean addKnuthElementsForBreakBefore(LinkedList returnList,
@@ -922,6 +917,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
breakBefore = ((org.apache.fop.fo.flow.Block) fobj).getBreakBefore();
} else if (fobj instanceof org.apache.fop.fo.flow.BlockContainer) {
breakBefore = ((org.apache.fop.fo.flow.BlockContainer) fobj).getBreakBefore();
+ } else if (fobj instanceof org.apache.fop.fo.flow.ListBlock) {
+ breakBefore = ((org.apache.fop.fo.flow.ListBlock) fobj).getBreakBefore();
+ } else if (fobj instanceof org.apache.fop.fo.flow.ListItem) {
+ breakBefore = ((org.apache.fop.fo.flow.ListItem) fobj).getBreakBefore();
} else if (fobj instanceof org.apache.fop.fo.flow.Table) {
breakBefore = ((org.apache.fop.fo.flow.Table) fobj).getBreakBefore();
}
@@ -932,8 +931,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// return a penalty element, representing a forced page break
returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakBefore, context));
- //returnList.add(new KnuthPenalty(0, -KnuthElement.INFINITE, false,
- // breakBefore, getAuxiliaryPosition(), false));
return true;
} else {
return false;
@@ -943,6 +940,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
/**
* Creates Knuth elements for break-after and adds them to the return list.
* @param returnList return list to add the additional elements to
+ * @param context the layout context
* @return true if an element has been added due to a break-after.
*/
protected boolean addKnuthElementsForBreakAfter(LinkedList returnList,
@@ -952,6 +950,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
breakAfter = ((org.apache.fop.fo.flow.Block) fobj).getBreakAfter();
} else if (fobj instanceof org.apache.fop.fo.flow.BlockContainer) {
breakAfter = ((org.apache.fop.fo.flow.BlockContainer) fobj).getBreakAfter();
+ } else if (fobj instanceof org.apache.fop.fo.flow.ListBlock) {
+ breakAfter = ((org.apache.fop.fo.flow.ListBlock) fobj).getBreakAfter();
+ } else if (fobj instanceof org.apache.fop.fo.flow.ListItem) {
+ breakAfter = ((org.apache.fop.fo.flow.ListItem) fobj).getBreakAfter();
} else if (fobj instanceof org.apache.fop.fo.flow.Table) {
breakAfter = ((org.apache.fop.fo.flow.Table) fobj).getBreakAfter();
}
@@ -962,8 +964,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// add a penalty element, representing a forced page break
returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakAfter, context));
- //returnList.add(new KnuthPenalty(0, -KnuthElement.INFINITE, false,
- // breakAfter, getAuxiliaryPosition(), false));
return true;
} else {
return false;