]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added warning for non-applicable borders in case of separate border-model
authorAndreas L. Delmelle <adelmelle@apache.org>
Fri, 23 Sep 2005 19:33:04 +0000 (19:33 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Fri, 23 Sep 2005 19:33:04 +0000 (19:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@291194 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/flow/TableFObj.java
src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java

index 54fa15135a8d3f799d9efb49a330f71b8759087e..f40c46c89c4683bc385c646456f7e9d987446a29 100644 (file)
@@ -77,6 +77,14 @@ public abstract class TableFObj extends FObj {
         borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE).getNumeric();
         borderEndPrecedence = pList.get(PR_BORDER_END_PRECEDENCE).getNumeric();
         borderStartPrecedence = pList.get(PR_BORDER_START_PRECEDENCE).getNumeric();
+        //Complain if table has separate border-model and fo is not a table or cell
+        //see: Rec 6.7.4, 6.7.6 - 6.7.9
+        if (getNameId() != FO_TABLE && getNameId() != FO_TABLE_CELL
+                && getTable().isSeparateBorderModel()
+                && getCommonBorderPaddingBackground().hasBorderInfo()) {
+            getLogger().warn("Borders on " + getName() 
+                    + " non-applicable for table with border-collapse=\"separate\"");
+        }
     }
     
     /**
@@ -85,7 +93,7 @@ public abstract class TableFObj extends FObj {
      * @return the "border-precedence" value for the given side
      */
     public Numeric getBorderPrecedence(int side) {
-        switch( side ) {
+        switch (side) {
         case CommonBorderPaddingBackground.BEFORE:
             return borderBeforePrecedence;
         case CommonBorderPaddingBackground.AFTER:
@@ -98,7 +106,7 @@ public abstract class TableFObj extends FObj {
             return null;
         }
     }
-        
+
     /**
      * Returns the current column index of the given TableFObj
      * (overridden for Table, TableBody, TableRow)
index c4ba929bd6234d80d1df8bf2d1d3897f8310fb61..4a92280ff059e3bc0d1d94e23f5636682ac86b73 100755 (executable)
@@ -366,4 +366,9 @@ public class CommonBorderPaddingBackground implements Cloneable {
                 + getPaddingStart(false, context) + getPaddingEnd(false, context)) > 0);
     }
     
+    /** @return true if there are any borders defined. */
+    public boolean hasBorderInfo() {
+        return (borderInfo[BEFORE] != null || borderInfo[AFTER] != null
+                || borderInfo[START] != null || borderInfo[END] != null);
+    }
 }