diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-11-24 14:54:06 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-11-24 14:54:06 +0000 |
commit | 353393ea090a42231e76564d9e13ee155bcd1213 (patch) | |
tree | 7803d83f311973f5a09782a0dd226dee7fa1f438 /src | |
parent | 69aa3f301ca7b9f8951d3e16dbda69dd2b00c6cd (diff) | |
download | xmlgraphics-fop-353393ea090a42231e76564d9e13ee155bcd1213.tar.gz xmlgraphics-fop-353393ea090a42231e76564d9e13ee155bcd1213.zip |
Added support for border-separation.block-progression-direction (only inline-progression-direction worked before).
Bugfix for a special case with vertically spanned cells where a cell might have been swallowed as a whole.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@348745 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
4 files changed, 39 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java index de3f4d52f..547c941bf 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java @@ -316,6 +316,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager = gu.getCell().getCommonBorderPaddingBackground(); bpd -= cbpb.getPaddingBefore(false, this); bpd -= cbpb.getPaddingAfter(false, this); + bpd -= 2 * ((TableLayoutManager)getParent()).getHalfBorderSeparationBPD(); return bpd; } @@ -462,11 +463,6 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager indent += getTableCell() .getCommonBorderPaddingBackground().getPaddingStart(false, this); // set position - int halfBorderSep = 0; - if (isSeparateBorderModel()) { - halfBorderSep = getTableCell().getBorderSeparation().getLengthPair() - .getIPD().getLength().getValue(this) / 2; - } int borderAdjust = 0; if (!isSeparateBorderModel()) { if (gridUnit.hasSpanning()) { @@ -477,8 +473,11 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager } else { //borderAdjust += gridUnit.getBorders().getBorderBeforeWidth(false); } - curBlockArea.setXOffset(xoffset + inRowIPDOffset + halfBorderSep + indent); - curBlockArea.setYOffset(yoffset - borderAdjust); + TableLayoutManager tableLM = (TableLayoutManager)getParent(); + curBlockArea.setXOffset(xoffset + inRowIPDOffset + + tableLM.getHalfBorderSeparationIPD() + indent); + curBlockArea.setYOffset(yoffset - borderAdjust + + tableLM.getHalfBorderSeparationBPD()); curBlockArea.setIPD(cellIPD); //curBlockArea.setHeight(); diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 2708b440a..99028d915 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -103,7 +103,7 @@ public class TableContentLayoutManager implements PercentBaseContext { private boolean isSeparateBorderModel() { return getTableLM().getTable().isSeparateBorderModel(); } - + /** * @return the column setup of this table */ @@ -534,7 +534,9 @@ public class TableContentLayoutManager implements PercentBaseContext { = primary.getCell().getCommonBorderPaddingBackground(); padding += cbpb.getPaddingBefore(false, primary.getCellLM()); padding += cbpb.getPaddingAfter(false, primary.getCellLM()); - int effRowHeight = effCellContentHeight + padding + borderWidths; + int effRowHeight = effCellContentHeight + + padding + borderWidths + + 2 * getTableLM().getHalfBorderSeparationBPD(); for (int previous = 0; previous < gu.getRowSpanIndex(); previous++) { effRowHeight -= rowHeights[rgi - previous - 1].opt; } @@ -886,6 +888,7 @@ public class TableContentLayoutManager implements PercentBaseContext { if (readyCount == 0) { return 0; } + actualRowHeight += 2 * getTableLM().getHalfBorderSeparationBPD(); lastRowHeight = actualRowHeight; //Add areas for row diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index f805fe9c7..f1e1447c0 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -71,6 +71,9 @@ public class TableLayoutManager extends BlockStackingLayoutManager private MinOptMax effSpaceBefore; private MinOptMax effSpaceAfter; + private int halfBorderSeparationBPD; + private int halfBorderSeparationIPD; + /** * Create a new table layout manager. * @param node the table FO @@ -99,6 +102,16 @@ public class TableLayoutManager extends BlockStackingLayoutManager foSpaceAfter = new SpaceVal( getTable().getCommonMarginBlock().spaceAfter, this).getSpace(); + if (getTable().isSeparateBorderModel()) { + this.halfBorderSeparationBPD = getTable().getBorderSeparation().getBPD().getLength() + .getValue(this) / 2; + this.halfBorderSeparationIPD = getTable().getBorderSeparation().getIPD().getLength() + .getValue(this) / 2; + } else { + this.halfBorderSeparationBPD = 0; + this.halfBorderSeparationIPD = 0; + } + if (!getTable().isAutoLayout() && getTable().getInlineProgressionDimension().getOptimum(this).getEnum() != EN_AUTO) { @@ -122,6 +135,16 @@ public class TableLayoutManager extends BlockStackingLayoutManager return iIndents; } + /** @return half the value of border-separation.block-progression-dimension. */ + public int getHalfBorderSeparationBPD() { + return halfBorderSeparationBPD; + } + + /** @return half the value of border-separation.inline-progression-dimension. */ + public int getHalfBorderSeparationIPD() { + return halfBorderSeparationIPD; + } + /** @see org.apache.fop.layoutmgr.LayoutManager */ public LinkedList getNextKnuthElements(LayoutContext context, int alignment) { @@ -521,5 +544,5 @@ public class TableLayoutManager extends BlockStackingLayoutManager log.debug(this + ": Padding " + side + " -> " + effectiveLength); } } - + }
\ No newline at end of file diff --git a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java index 3aa91e80b..d27684b49 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java @@ -25,6 +25,7 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.Constants; +import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableRow; import org.apache.fop.layoutmgr.BreakElement; import org.apache.fop.layoutmgr.ElementListUtils; @@ -143,6 +144,7 @@ public class TableStepper { } int len = widths[i]; if (len > 0) { + len += 2 * getTableLM().getHalfBorderSeparationBPD(); len += borderBefore[i] + borderAfter[i]; len += paddingBefore[i] + paddingAfter[i]; } @@ -401,7 +403,7 @@ public class TableStepper { if (end[i] < elementLists[i].size()) { start[i] = end[i] + 1; if (end[i] + 1 < elementLists[i].size() - && getActivePrimaryGridUnit(i).isLastGridUnitRowSpan()) { + && getActiveGridUnit(i).isLastGridUnitRowSpan()) { rowPendingIndicator++; } } else { @@ -507,6 +509,7 @@ public class TableStepper { for (int prevRow = 0; prevRow < startRow[i]; prevRow++) { baseWidth[i] += rowGroup[prevRow].getHeight().opt; } + baseWidth[i] += 2 * getTableLM().getHalfBorderSeparationBPD(); baseWidth[i] += borderBefore[i] + borderAfter[i]; baseWidth[i] += paddingBefore[i] + paddingAfter[i]; if (end[i] >= start[i]) { |