Author: vhennebert
Date: Tue Nov 20 10:47:39 2007
New Revision: 596776

URL: http://svn.apache.org/viewvc?rev=596776&view=rev
Log:
Bugzilla #43803: table cells having no children are allowed in relaxed 
validation mode.

Modified:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
    xmlgraphics/fop/trunk/status.xml

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java?rev=596776&r1=596775&r2=596776&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java 
Tue Nov 20 10:47:39 2007
@@ -242,6 +242,8 @@
      * @return true if this cell's next step is inferior or equal to the next 
minimal step
      */
     boolean contributesContent() {
+        // return includedInLastStep() && the cell hasn't finished yet, 
otherwise there's
+        // nothing more to contribute
         return includedInLastStep() && end >= start;
     }
 

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java?rev=596776&r1=596775&r2=596776&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
 Tue Nov 20 10:47:39 2007
@@ -23,6 +23,9 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.fop.area.Area;
+import org.apache.fop.area.Block;
+import org.apache.fop.area.Trait;
 import org.apache.fop.datatypes.PercentBaseContext;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.flow.table.GridUnit;
@@ -34,18 +37,16 @@
 import org.apache.fop.layoutmgr.BlockLevelLayoutManager;
 import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
 import org.apache.fop.layoutmgr.BreakElement;
+import org.apache.fop.layoutmgr.KnuthBox;
 import org.apache.fop.layoutmgr.KnuthElement;
 import org.apache.fop.layoutmgr.KnuthGlue;
 import org.apache.fop.layoutmgr.KnuthPenalty;
 import org.apache.fop.layoutmgr.LayoutContext;
 import org.apache.fop.layoutmgr.ListElement;
-import org.apache.fop.layoutmgr.PositionIterator;
 import org.apache.fop.layoutmgr.Position;
+import org.apache.fop.layoutmgr.PositionIterator;
 import org.apache.fop.layoutmgr.SpaceResolver;
 import org.apache.fop.layoutmgr.TraitSetter;
-import org.apache.fop.area.Area;
-import org.apache.fop.area.Block;
-import org.apache.fop.area.Trait;
 import org.apache.fop.traits.MinOptMax;
 
 /**
@@ -232,8 +233,15 @@
         }
 
         returnedList = new LinkedList();
-        wrapPositionElements(contentList, returnList);
-
+        if (contentList.size() > 0) {
+            wrapPositionElements(contentList, returnList);
+        } else {
+            // In relaxed validation mode, table-cells having no children are 
authorised.
+            // Add a zero-width block here to not have to take this special 
case into
+            // account later
+            // Copied from BlockStackingLM
+            returnList.add(new KnuthBox(0, notifyPos(new Position(this)), 
true));
+        }
         //Space resolution
         SpaceResolver.resolveElementList(returnList);
 

Modified: xmlgraphics/fop/trunk/status.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=596776&r1=596775&r2=596776&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Tue Nov 20 10:47:39 2007
@@ -28,6 +28,10 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="VH" type="fix" fixes-bug="43803">
+        Restored proper handling of fo:table-cell having no children, which is 
allowed in relaxed
+        validation mode.
+      </action>
       <action context="Code" dev="JM" type="fix">
         Memory Leak fixed in the Property Cache. Fixed by Jeremias Maerki. 
Reported and Tested By
         Chris Bowditch.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to