adelmelle
Wed, 07 May 2008 15:46:14 -0700
Author: adelmelle Date: Wed May 7 15:45:46 2008 New Revision: 654314 URL: http://svn.apache.org/viewvc?rev=654314&view=rev Log: Corrected errors in ColumnNumberPropertyMaker.java; temporarily disabled two testcases for a non-standard feature Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFObj.java xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFObj.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFObj.java?rev=654314&r1=654313&r2=654314&view=diff ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFObj.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFObj.java Wed May 7 15:45:46 2008 @@ -27,9 +27,7 @@ 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 @@ /** * Main constructor - * + * * @param parent the parent node */ public TableFObj(FONode parent) { @@ -76,7 +74,7 @@ } /** - * + * * @param side the side for which to return the border precedence * @return the "border-precedence" value for the given side */ @@ -98,9 +96,9 @@ /** * 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 @@ * 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 @@ 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 + * + * [EMAIL PROTECTED] + */ + 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); + } } /** [EMAIL PROTECTED] */ Modified: xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml?rev=654314&r1=654313&r2=654314&view=diff ============================================================================== --- xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml (original) +++ xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml Wed May 7 15:45:46 2008 @@ -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> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]