aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/flow/table
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2008-05-07 22:45:46 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2008-05-07 22:45:46 +0000
commited1db93f52dc1fb48c34a938103f999df5c8f16f (patch)
tree5c82045c92daa50b3cf618321bd57f2627b78b57 /src/java/org/apache/fop/fo/flow/table
parent92e9727bae29acaa5d7567ebef7ca3fd9fd41d2d (diff)
downloadxmlgraphics-fop-ed1db93f52dc1fb48c34a938103f999df5c8f16f.tar.gz
xmlgraphics-fop-ed1db93f52dc1fb48c34a938103f999df5c8f16f.zip
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
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/table')
-rw-r--r--src/java/org/apache/fop/fo/flow/table/TableFObj.java48
1 files changed, 36 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/flow/table/TableFObj.java b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
index 9b60de740..731b2f77f 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableFObj.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
@@ -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} */