diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-01-19 15:10:14 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-01-19 15:10:14 +0000 |
commit | 4a34763794b0293bbcf74a08f34d0035aeff61fe (patch) | |
tree | 5fbd7a0fd8b310a4ee4343fe697189f9131939eb /src/java/org/apache/fop/layoutmgr | |
parent | 9a01ca2474cad035c82810d6b541cde6dbd896aa (diff) | |
download | xmlgraphics-fop-4a34763794b0293bbcf74a08f34d0035aeff61fe.tar.gz xmlgraphics-fop-4a34763794b0293bbcf74a08f34d0035aeff61fe.zip |
Following a clarification by the XSL FO SG, space traits are only set on the first and last area generated by an FO, and not on every area anymore.
For details, see: http://wiki.apache.org/xmlgraphics-fop/XslFoSpecificationUncertainties/SpaceTraits
Note: this change brings another issue in column balancing to light. That's the reason for disabling one of the tests. I wasn't able to find a quick fix there.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@370494 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr')
6 files changed, 26 insertions, 44 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 455a7d8fc..658a92e0d 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -129,8 +129,8 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @return the content IPD */ @@ -241,17 +241,19 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager LinkedList contentList = new LinkedList(); LinkedList returnList = new LinkedList(); - if (!bBreakBeforeServed) { + if (!breakBeforeServed) { try { if (addKnuthElementsForBreakBefore(returnList, context)) { return returnList; } } finally { - bBreakBeforeServed = true; + breakBeforeServed = true; } } - addKnuthElementsForSpaceBefore(returnList, alignment); + if (!firstVisibleMarkServed) { + addKnuthElementsForSpaceBefore(returnList, alignment); + } addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed); firstVisibleMarkServed = true; diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index 0db92b30f..a303f18fd 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -110,8 +110,8 @@ public class BlockLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index c09ae8ae5..eb7a2599c 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -55,7 +55,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager /** Only used to store the original list when createUnitElements is called */ protected LinkedList storedList = null; /** Indicates whether break before has been served or not */ - protected boolean bBreakBeforeServed = false; + protected boolean breakBeforeServed = false; /** Indicates whether the first visible mark has been returned by this LM, yet */ protected boolean firstVisibleMarkServed = false; /** Reference IPD available */ @@ -235,17 +235,19 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager LinkedList contentList = new LinkedList(); LinkedList returnList = new LinkedList(); - if (!bBreakBeforeServed) { + if (!breakBeforeServed) { try { if (addKnuthElementsForBreakBefore(returnList, context)) { return returnList; } } finally { - bBreakBeforeServed = true; + breakBeforeServed = true; } } - addKnuthElementsForSpaceBefore(returnList, alignment); + if (!firstVisibleMarkServed) { + addKnuthElementsForSpaceBefore(returnList, alignment); + } addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed); firstVisibleMarkServed = true; @@ -316,18 +318,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager // blocks contentList.add(new BreakElement( new Position(this), KnuthElement.INFINITE, context)); - /* - contentList.add(new KnuthPenalty(0, - KnuthElement.INFINITE, false, - new Position(this), false)); - */ } else if (!((ListElement) contentList.getLast()).isGlue()) { // add a null penalty to allow a break between blocks contentList.add(new BreakElement( new Position(this), 0, context)); - /* - contentList.add(new KnuthPenalty(0, 0, false, - new Position(this), false));*/ } else { // the last element in contentList is a glue; // it is a feasible breakpoint, there is no need to add @@ -763,22 +757,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager * @param context the layout context */ protected void addPendingMarks(LayoutContext context) { - SpaceProperty spaceBefore = getSpaceBeforeProperty(); - if (spaceBefore != null - && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0 - && spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) { - context.addPendingBeforeMark(new SpaceElement(getAuxiliaryPosition(), spaceBefore, - RelSide.BEFORE, - true, false, this)); - } - SpaceProperty spaceAfter = getSpaceAfterProperty(); - if (spaceAfter != null - && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0 - && spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) { - context.addPendingAfterMark(new SpaceElement(getAuxiliaryPosition(), spaceAfter, - RelSide.AFTER, - false, true, this)); - } CommonBorderPaddingBackground borderAndPadding = getBorderPaddingBackground(); if (borderAndPadding != null) { if (borderAndPadding.getBorderBeforeWidth(false) > 0) { diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java index dcedfdbcb..e23639e0d 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java @@ -109,8 +109,8 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @see org.apache.fop.layoutmgr.BlockStackingLayoutManager */ diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 2dd7020a7..c402f37ae 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -168,8 +168,8 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @see org.apache.fop.layoutmgr.LayoutManager */ diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 5bfab332e..9aea85080 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -126,8 +126,8 @@ public class TableLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @return half the value of border-separation.block-progression-dimension. */ @@ -145,13 +145,13 @@ public class TableLayoutManager extends BlockStackingLayoutManager LinkedList returnList = new LinkedList(); - if (!bBreakBeforeServed) { + if (!breakBeforeServed) { try { if (addKnuthElementsForBreakBefore(returnList, context)) { return returnList; } } finally { - bBreakBeforeServed = true; + breakBeforeServed = true; } } @@ -202,7 +202,9 @@ public class TableLayoutManager extends BlockStackingLayoutManager } } - addKnuthElementsForSpaceBefore(returnList, alignment); + if (!firstVisibleMarkServed) { + addKnuthElementsForSpaceBefore(returnList, alignment); + } if (getTable().isSeparateBorderModel()) { addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed); |