diff options
author | Simon Steiner <ssteiner@apache.org> | 2020-01-02 16:28:29 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2020-01-02 16:28:29 +0000 |
commit | 4ff004719b5ded58bbed329eeb276dcff7e9a6fb (patch) | |
tree | 3d8e5413ce152244a5cfec1201c7fc85d0a2f4f3 /fop-core/src/main | |
parent | c668267826963ff998b71ca6090b8b371081407a (diff) | |
download | xmlgraphics-fop-4ff004719b5ded58bbed329eeb276dcff7e9a6fb.tar.gz xmlgraphics-fop-4ff004719b5ded58bbed329eeb276dcff7e9a6fb.zip |
FOP-2898: Only use zero glue for change ipd
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1872250 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core/src/main')
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java | 6 | ||||
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableStepper.java | 14 |
2 files changed, 12 insertions, 8 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index 6069dbcc3..3e8bd992b 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -88,6 +88,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager private Position auxiliaryPosition; private int contentAreaIPD; + private boolean isRestartAtLM; /** * @param node the fo this LM deals with @@ -244,6 +245,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager @Override public List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack, Position restartPosition, LayoutManager restartAtLM) { + isRestartAtLM = restartAtLM != null; referenceIPD = context.getRefIPD(); updateContentAreaIPDwithOverconstrainedAdjust(); @@ -1257,5 +1259,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager } return false; } + + public boolean isRestartAtLM() { + return isRestartAtLM; + } } diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableStepper.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableStepper.java index 3bcec5e9a..3261a0afb 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableStepper.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableStepper.java @@ -30,14 +30,15 @@ import org.apache.fop.fo.Constants; import org.apache.fop.fo.flow.table.EffRow; import org.apache.fop.fo.flow.table.GridUnit; import org.apache.fop.fo.flow.table.PrimaryGridUnit; +import org.apache.fop.layoutmgr.BlockStackingLayoutManager; import org.apache.fop.layoutmgr.BreakElement; import org.apache.fop.layoutmgr.Keep; import org.apache.fop.layoutmgr.KnuthBlockBox; import org.apache.fop.layoutmgr.KnuthBox; -import org.apache.fop.layoutmgr.KnuthElement; import org.apache.fop.layoutmgr.KnuthGlue; import org.apache.fop.layoutmgr.KnuthPenalty; import org.apache.fop.layoutmgr.LayoutContext; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.Position; import org.apache.fop.util.BreakUtil; @@ -278,13 +279,10 @@ public class TableStepper { int shrink = 0; int stretch = 0; int width = -penaltyOrGlueLen; - if (keep.getPenalty() == KnuthElement.INFINITE) { - width = (boxLen + -penaltyOrGlueLen) / 2; - if (-penaltyOrGlueLen > maxRemainingHeight) { - width = 0; - } - stretch = Math.max(boxLen, -penaltyOrGlueLen); - shrink = Math.min(boxLen, -penaltyOrGlueLen); + LayoutManager bslm = getTableLM().getParent(); + if (bslm instanceof BlockStackingLayoutManager && ((BlockStackingLayoutManager)bslm).isRestartAtLM() + && keep.getPenalty() == KnuthPenalty.INFINITE) { + width = 0; } returnList.add(new KnuthGlue(width, stretch, shrink, new Position(null), true)); } |