aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-07-25 15:27:36 +0000
committerJeremias Maerki <jeremias@apache.org>2005-07-25 15:27:36 +0000
commit3952bd4dfb46b8b28488d8c72481499efdd56586 (patch)
tree937570398acf8eee4084fe25cdd0df70c0fca37a
parent12408dd7499da05cbefce3070c2bf9035794508f (diff)
downloadxmlgraphics-fop-3952bd4dfb46b8b28488d8c72481499efdd56586.tar.gz
xmlgraphics-fop-3952bd4dfb46b8b28488d8c72481499efdd56586.zip
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
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java17
1 files changed, 12 insertions, 5 deletions
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());
}