Browse Source

Bugzilla #43803: table cells having no children are allowed in relaxed validation mode.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@596776 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-0_95beta
Vincent Hennebert 16 years ago
parent
commit
e190f45154

+ 2
- 0
src/java/org/apache/fop/layoutmgr/table/ActiveCell.java View File

@@ -242,6 +242,8 @@ class ActiveCell {
* @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;
}


+ 14
- 6
src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java View File

@@ -23,6 +23,9 @@ import java.util.LinkedList;

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.AreaAdditionUtil;
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 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
}

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);


+ 4
- 0
status.xml View File

@@ -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.

Loading…
Cancel
Save