Browse Source

Corrected errors in ColumnNumberPropertyMaker.java; temporarily disabled two testcases for a non-standard feature

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@654314 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Andreas L. Delmelle 16 years ago
parent
commit
ed1db93f52

+ 36
- 12
src/java/org/apache/fop/fo/flow/table/TableFObj.java View File

@@ -27,9 +27,7 @@ import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.NumberProperty;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layoutmgr.table.CollapsingBorderModel;

/**
@@ -51,7 +49,7 @@ public abstract class TableFObj extends FObj {

/**
* Main constructor
*
*
* @param parent the parent node
*/
public TableFObj(FONode parent) {
@@ -76,7 +74,7 @@ public abstract class TableFObj extends FObj {
}

/**
*
*
* @param side the side for which to return the border precedence
* @return the "border-precedence" value for the given side
*/
@@ -98,9 +96,9 @@ public abstract class TableFObj extends FObj {
/**
* Convenience method to returns a reference
* to the base Table instance
*
*
* @return the base table instance
*
*
*/
public Table getTable() {
// Will be overridden in Table; for any other Table-node, recursive call to
@@ -142,7 +140,7 @@ public abstract class TableFObj extends FObj {
* Check the value of the column-number property.
* Return the parent's column index (initial value) in case
* of a negative or zero value
*
*
* @see org.apache.fop.fo.properties.PropertyMaker#make(PropertyList, String, FObj)
*/
public Property make(PropertyList propertyList, String value, FObj fo)
@@ -155,20 +153,46 @@ public abstract class TableFObj extends FObj {
int columnIndex = p.getNumeric().getValue();
int colSpan = propertyList.get(Constants.PR_NUMBER_COLUMNS_SPANNED)
.getNumeric().getValue();
int i = -1;
while (++i < colSpan) {
if (columnIndexManager.isColumnNumberUsed(columnIndex + i)) {
int i = columnIndex - 1;
int lastIndex = (columnIndex + colSpan) - 1;
while (++i < lastIndex) {
if (columnIndexManager.isColumnNumberUsed(i)) {
/* if column-number is already in use by another
* cell/column => error!
*/
TableEventProducer eventProducer = TableEventProducer.Provider.get(
fo.getUserAgent().getEventBroadcaster());
eventProducer.cellOverlap(this, fo.getName(), columnIndex + 1, fo.getLocator());
eventProducer.cellOverlap(this, propertyList.getFObj().getName(),
i, fo.getLocator());
}
}

return p;
}

/**
* If the value is not positive, return a property with value of the next
* free column number
*
* {@inheritDoc}
*/
public Property convertProperty(Property p,
PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof EnumProperty) {
return EnumNumber.getInstance(p);
}
Number val = p.getNumber();
if (val != null) {
int i = val.intValue();
if (i <= 0) {
i = 1;
}
return NumberProperty.getInstance(i);
}
return convertPropertyDatatype(p, propertyList, fo);
}
}

/** {@inheritDoc} */

+ 10
- 0
test/fotree/disabled-testcases.xml View File

@@ -28,4 +28,14 @@
<description>The code currently evaluates this function according to the column in which the
marker appears in the source document, rather than the column it is retrieved in.</description>
</testcase>
<testcase>
<name>column-number_negative-or-zero</name>
<file>column-number_negative-or-zero.fo</file>
<description></description>
</testcase>
<testcase>
<name>column-number_non-integer</name>
<file>column-number_non-integer.fo</file>
<description></description>
</testcase>
</disabled-testcases>

Loading…
Cancel
Save