aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-10-24 09:21:26 +0000
committerJeremias Maerki <jeremias@apache.org>2005-10-24 09:21:26 +0000
commit829cd8e6757340bbdcb53d59e0f0ed5948b9e2c4 (patch)
tree866c74ce05dc718cca64a2aafc0d157d9cea8134 /src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
parent94b582d886ed3dcc4222c6fc1bc3f57b48bede90 (diff)
downloadxmlgraphics-fop-829cd8e6757340bbdcb53d59e0f0ed5948b9e2c4.tar.gz
xmlgraphics-fop-829cd8e6757340bbdcb53d59e0f0ed5948b9e2c4.zip
Merged work on Temp_SpaceResolution branch into trunk (-r 320826:327988).
Source: http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_SpaceResolution/ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@328010 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
index 37e852cb6..3ec814bd2 100644
--- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
@@ -36,7 +36,6 @@ import java.util.ListIterator;
*/
public class FlowLayoutManager extends BlockStackingLayoutManager
implements BlockLevelLayoutManager {
- private Flow fobj;
/** Array of areas currently being filled stored by area class */
private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
@@ -51,7 +50,6 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
*/
public FlowLayoutManager(PageSequenceLayoutManager pslm, Flow node) {
super(node);
- fobj = node;
setParent(pslm);
}
@@ -84,6 +82,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
log.debug("span change from " + currentSpan + " to " + span);
context.signalSpanChange(span);
currentSpan = span;
+ SpaceResolver.resolveElementList(returnList);
return returnList;
}
@@ -109,10 +108,10 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
wrapPositionElements(tempList, returnedList);
if (returnedList.size() == 1
- && ((KnuthElement)returnedList.getFirst()).isPenalty()
- && ((KnuthPenalty)returnedList.getFirst()).getP() == -KnuthElement.INFINITE) {
+ && ElementListUtils.endsWithForcedBreak(returnedList)) {
// a descendant of this flow has break-before
returnList.addAll(returnedList);
+ SpaceResolver.resolveElementList(returnList);
return returnList;
} else {
if (returnList.size() > 0) {
@@ -123,20 +122,19 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING, false);
childLC.setFlags(LayoutContext.KEEP_WITH_PREVIOUS_PENDING, false);
// add an infinite penalty to forbid a break between blocks
- returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
- new Position(this), false));
- } else if (!((KnuthElement) returnList.getLast()).isGlue()) {
+ returnList.add(new BreakElement(
+ new Position(this), KnuthElement.INFINITE, context));
+ } else if (!((ListElement) returnList.getLast()).isGlue()) {
// add a null penalty to allow a break between blocks
- returnList.add(new KnuthPenalty(0, 0, false,
- new Position(this), false));
+ returnList.add(new BreakElement(
+ new Position(this), 0, context));
}
}
- if (returnedList.size() > 0) { // controllare!
+ if (returnedList.size() > 0) {
returnList.addAll(returnedList);
- if (((KnuthElement)returnedList.getLast()).isPenalty()
- && ((KnuthPenalty)returnedList.getLast()).getP()
- == -KnuthElement.INFINITE) {
+ if (ElementListUtils.endsWithForcedBreak(returnList)) {
// a descendant of this flow has break-after
+ SpaceResolver.resolveElementList(returnList);
return returnList;
}
}
@@ -148,6 +146,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
}
}
+ SpaceResolver.resolveElementList(returnList);
setFinished(true);
if (returnList.size() > 0) {