aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-02-11 12:19:05 +0000
committerJeremias Maerki <jeremias@apache.org>2005-02-11 12:19:05 +0000
commit0de75c7c71bfac1809b3ec247f76817de5de3b65 (patch)
tree15dbadbc719e247e48d7f14b44a469168e47ec1c /src/java/org/apache
parent274e37e0b6d635fb0f32ac98abd1bbbc19d96f7c (diff)
downloadxmlgraphics-fop-0de75c7c71bfac1809b3ec247f76817de5de3b65.tar.gz
xmlgraphics-fop-0de75c7c71bfac1809b3ec247f76817de5de3b65.zip
empty-cells implemented.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198422 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r--src/java/org/apache/fop/fo/flow/TableCell.java5
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/Cell.java13
2 files changed, 15 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/fo/flow/TableCell.java b/src/java/org/apache/fop/fo/flow/TableCell.java
index 2f417cc15..9853a54ff 100644
--- a/src/java/org/apache/fop/fo/flow/TableCell.java
+++ b/src/java/org/apache/fop/fo/flow/TableCell.java
@@ -298,6 +298,11 @@ public class TableCell extends FObj {
return Math.max(columnNumber.getValue(), 0);
}
+ /** @return true if "empty-cells" is "show" */
+ public boolean showEmptyCells() {
+ return (this.emptyCells == EN_SHOW);
+ }
+
/**
* @return the "id" property.
*/
diff --git a/src/java/org/apache/fop/layoutmgr/table/Cell.java b/src/java/org/apache/fop/layoutmgr/table/Cell.java
index 4287676af..3d2ed3747 100644
--- a/src/java/org/apache/fop/layoutmgr/table/Cell.java
+++ b/src/java/org/apache/fop/layoutmgr/table/Cell.java
@@ -34,7 +34,6 @@ import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
-import org.apache.fop.area.CTM;
import org.apache.fop.area.Trait;
import org.apache.fop.traits.MinOptMax;
@@ -61,6 +60,7 @@ public class Cell extends BlockStackingLayoutManager {
private int rowHeight;
private int usedBPD;
private int borderAndPaddingBPD;
+ private boolean emptyCell = true;
/**
* Create a new Cell layout manager.
@@ -168,6 +168,9 @@ public class Cell extends BlockStackingLayoutManager {
}
usedBPD = stackSize.opt;
+ if (usedBPD > 0) {
+ emptyCell = false;
+ }
LengthRangeProperty specifiedBPD = fobj.getBlockProgressionDimension();
if (specifiedBPD.getEnum() != EN_AUTO) {
@@ -249,6 +252,12 @@ public class Cell extends BlockStackingLayoutManager {
addID(fobj.getId());
}
+ if (!emptyCell || (getTable().getBorderCollapse() == EN_SEPARATE
+ && fobj.showEmptyCells())) {
+ TraitSetter.addBorders(curBlockArea, fobj.getCommonBorderPaddingBackground());
+ TraitSetter.addBackground(curBlockArea, fobj.getCommonBorderPaddingBackground());
+ }
+
//Handle display-align
if (usedBPD < rowHeight) {
if (fobj.getDisplayAlign() == EN_CENTER) {
@@ -277,8 +286,6 @@ public class Cell extends BlockStackingLayoutManager {
}
}
- TraitSetter.addBorders(curBlockArea, fobj.getCommonBorderPaddingBackground());
- TraitSetter.addBackground(curBlockArea, fobj.getCommonBorderPaddingBackground());
int contentBPD = rowHeight;
contentBPD -= borderAndPaddingBPD;