From: Jeremias Maerki Date: Fri, 24 Oct 2008 13:42:59 +0000 (+0000) Subject: Fixed a problem where the BPD or a block area could be wrong if there is a nested... X-Git-Tag: fop-1_0~396 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=46c9aca22be22f20ed5bddbf21618ed1abdfe287;p=xmlgraphics-fop.git 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 --- 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)); diff --git a/status.xml b/status.xml index ae924fce2..046416b59 100644 --- a/status.xml +++ b/status.xml @@ -53,6 +53,10 @@ + + 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). + Bugzilla 40798: A conditional-page-master-reference with page-position="last" qualifies for a first page, if it is also the last. Additionally: also added support for diff --git a/test/layoutengine/standard-testcases/block-container_area-bpd.xml b/test/layoutengine/standard-testcases/block-container_area-bpd.xml new file mode 100644 index 000000000..9c00c8185 --- /dev/null +++ b/test/layoutengine/standard-testcases/block-container_area-bpd.xml @@ -0,0 +1,59 @@ + + + + + +

+ This test checks bpd values on block-containers. +

+
+ + + + + + + + + + Testing area BPDs... + + + bc1 + + + + Below + + + Above + + + + + + + + + + + + + + +