From: Jeremias Maerki Date: Mon, 25 Jul 2005 15:27:36 +0000 (+0000) Subject: Bugzilla #35534 X-Git-Tag: fop-0_90-alpha1~483 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3952bd4dfb46b8b28488d8c72481499efdd56586;p=xmlgraphics-fop.git Bugzilla #35534 space-* production for list-item. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@225133 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index c230bd738..76a193d70 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -170,6 +170,13 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { referenceIPD = context.getRefIPD(); LayoutContext childLC; + LinkedList returnList = new LinkedList(); + + if (!bSpaceBeforeServed) { + addKnuthElementsForSpaceBefore(returnList, alignment); + bSpaceBeforeServed = true; + } + // label childLC = new LayoutContext(0); childLC.setRefIPD(context.getRefIPD()); @@ -192,10 +199,10 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { LinkedList returnedList = getCombinedKnuthElementsForListItem(labelList, bodyList); // "wrap" the Position inside each element - LinkedList tempList = returnedList; - returnedList = new LinkedList(); - wrapPositionElements(tempList, returnedList, true); + wrapPositionElements(returnedList, returnList, true); + addKnuthElementsForSpaceAfter(returnList, alignment); + if (keepWithNextPendingOnLabel || keepWithNextPendingOnBody || mustKeepWithNext()) { context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING); } @@ -204,7 +211,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { } setFinished(true); - return returnedList; + return returnList; } private LinkedList getCombinedKnuthElementsForListItem(LinkedList labelElements, @@ -439,7 +446,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { } lastPos = pos; } - if (pos instanceof NonLeafPosition) { + if (pos instanceof NonLeafPosition && pos.getPosition() != null) { // pos contains a ListItemPosition created by this ListBlockLM positionList.add(((NonLeafPosition) pos).getPosition()); }