aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-10-24 13:42:59 +0000
committerJeremias Maerki <jeremias@apache.org>2008-10-24 13:42:59 +0000
commit46c9aca22be22f20ed5bddbf21618ed1abdfe287 (patch)
treecae67b343158bd70928a509150fe283b2c6b5415 /src/java/org
parent35516dcedaffc643ae48349c280adcba172c57a2 (diff)
downloadxmlgraphics-fop-46c9aca22be22f20ed5bddbf21618ed1abdfe287.tar.gz
xmlgraphics-fop-46c9aca22be22f20ed5bddbf21618ed1abdfe287.zip
Fixed a problem where the BPD or a block area could be wrong if there is a nested, absolutely positioned area (for example a block-container).
This was most probably introduced by rev 618992. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@707631 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/area/Block.java2
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java17
2 files changed, 8 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/area/Block.java b/src/java/org/apache/fop/area/Block.java
index 7a2465859..5faec9f7a 100644
--- a/src/java/org/apache/fop/area/Block.java
+++ b/src/java/org/apache/fop/area/Block.java
@@ -79,7 +79,7 @@ public class Block extends BlockParent {
* @param autoHeight increase the height of the block.
*/
public void addBlock(Block block, boolean autoHeight) {
- if (autoHeight && allowBPDUpdate) {
+ if (autoHeight && allowBPDUpdate && block.isStacked()) {
bpd += block.getAllocBPD();
}
addChildArea(block);
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
index d83cca642..a4e8982f7 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
@@ -26,6 +26,7 @@ import java.util.ListIterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
import org.apache.fop.fo.flow.ListItem;
@@ -537,14 +538,6 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
label.addAreas(labelIter, lc);
}
- // reset the area bpd after adding the label areas and before adding the body areas
- int savedBPD = 0;
- if (labelFirstIndex <= labelLastIndex
- && bodyFirstIndex <= bodyLastIndex) {
- savedBPD = curBlockArea.getBPD();
- curBlockArea.setBPD(0);
- }
-
// add body areas
if (bodyFirstIndex <= bodyLastIndex) {
KnuthPossPosIter bodyIter = new KnuthPossPosIter(bodyList,
@@ -559,9 +552,13 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
// after adding body areas, set the maximum area bpd
- if (curBlockArea.getBPD() < savedBPD) {
- curBlockArea.setBPD(savedBPD);
+ int childCount = curBlockArea.getChildAreas().size();
+ assert childCount >= 1 && childCount <= 2;
+ int itemBPD = ((Block)curBlockArea.getChildAreas().get(0)).getAllocBPD();
+ if (childCount == 2) {
+ itemBPD = Math.max(itemBPD, ((Block)curBlockArea.getChildAreas().get(1)).getAllocBPD());
}
+ curBlockArea.setBPD(itemBPD);
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));