]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
empty-cells implemented.
authorJeremias Maerki <jeremias@apache.org>
Fri, 11 Feb 2005 12:19:05 +0000 (12:19 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 11 Feb 2005 12:19:05 +0000 (12:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198422 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/flow/TableCell.java
src/java/org/apache/fop/layoutmgr/table/Cell.java

index 2f417cc15fdae48649767358e7c0d6159267b56e..9853a54ff52a499423eacd7dfb2654349a32fc0f 100644 (file)
@@ -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.
      */
index 4287676af358de1c4d877200a224c2f071784acd..3d2ed37471590a93f952391d737c935588b5568f 100644 (file)
@@ -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;