spepping
Mon, 12 May 2008 10:53:46 -0700
Author: spepping Date: Mon May 12 10:53:21 2008 New Revision: 655578 URL: http://svn.apache.org/viewvc?rev=655578&view=rev Log: Restore the previous behaviour of the column-number property, viz. if it is negative, it is set the next free column Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFObj.java 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=655578&r1=655577&r2=655578&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 Mon May 12 10:53:21 2008 @@ -28,8 +28,11 @@ 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.EnumNumber; +import org.apache.fop.fo.properties.EnumProperty; import org.apache.fop.fo.properties.NumberProperty; import org.apache.fop.fo.properties.Property; +import org.apache.fop.fo.properties.PropertyMaker; import org.apache.fop.layoutmgr.table.CollapsingBorderModel; /** @@ -117,7 +120,7 @@ * PropertyMaker subclass for the column-number property * */ - public static class ColumnNumberPropertyMaker extends NumberProperty.PositiveIntegerMaker { + public static class ColumnNumberPropertyMaker extends PropertyMaker { /** * Constructor @@ -172,6 +175,32 @@ return p; } + + /** + * If the value is not positive, return a property whose value is the next 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 = Math.round(val.floatValue()); + if (i <= 0) { + ColumnNumberManagerHolder parent = + (ColumnNumberManagerHolder) propertyList.getParentFObj(); + ColumnNumberManager columnIndexManager = parent.getColumnNumberManager(); + i = columnIndexManager.getCurrentColumnNumber(); + } + return NumberProperty.getInstance(i); + } + return convertPropertyDatatype(p, propertyList, fo); + } + } /** [EMAIL PROTECTED] */ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]