diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-05-24 09:41:32 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-05-24 09:41:32 +0000 |
commit | 9b3c25d9daff658a9144330172f58cfd4688eca3 (patch) | |
tree | e4648b25f0068defbf8e73903aed3bdfa0e1970a /src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java | |
parent | 1af57e403ba314e8acc33bb696b140bb3f9ccafa (diff) | |
download | xmlgraphics-fop-9b3c25d9daff658a9144330172f58cfd4688eca3.tar.gz xmlgraphics-fop-9b3c25d9daff658a9144330172f58cfd4688eca3.zip |
Modify keep-with-next and keep-with-previous handling to support "level-hopping" (see keep-with-next1a and keep-with-previous1a)
Full keep handling for tables (there's a remaning problem with keep-with-previous)
keep-together support for lists.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198683 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.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index 3399d05e6..5a69104f3 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -106,6 +106,10 @@ public class FlowLayoutManager extends BlockStackingLayoutManager // get elements from curLM returnedList = curLM.getNextKnuthElements(childLC, alignment); //log.debug("FLM.getNextKnuthElements> returnedList.size() = " + returnedList.size()); + if (returnList.size() == 0 && childLC.isKeepWithPreviousPending()) { + context.setFlags(LayoutContext.KEEP_WITH_PREVIOUS_PENDING); + childLC.setFlags(LayoutContext.KEEP_WITH_PREVIOUS_PENDING, false); + } // "wrap" the Position inside each element LinkedList tempList = returnedList; @@ -121,8 +125,11 @@ public class FlowLayoutManager extends BlockStackingLayoutManager } else { if (returnList.size() > 0) { // there is a block before this one - if (prevLM.mustKeepWithNext() - || curLM.mustKeepWithPrevious()) { + if (context.isKeepWithNextPending() + || childLC.isKeepWithPreviousPending()) { + //Clear pending keep flag + 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)); @@ -142,6 +149,11 @@ public class FlowLayoutManager extends BlockStackingLayoutManager } } } + if (childLC.isKeepWithNextPending()) { + //Clear and propagate + childLC.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING, false); + context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING); + } prevLM = curLM; } |