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());
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);
}
}
setFinished(true);
- return returnedList;
+ return returnList;
}
private LinkedList getCombinedKnuthElementsForListItem(LinkedList labelElements,
}
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());
}