]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #35534
authorJeremias Maerki <jeremias@apache.org>
Mon, 25 Jul 2005 15:27:36 +0000 (15:27 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 25 Jul 2005 15:27:36 +0000 (15:27 +0000)
space-* production for list-item.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@225133 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java

index c230bd7381f2500045c3da2109546495957da29f..76a193d70cb736222cf1dbd96eabe06c03094dbe 100644 (file)
@@ -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());
             }