Browse Source

Restore the previous behaviour of the column-number property, viz. if

it is negative, it is set the next free column


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@655578 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Simon Pepping 16 years ago
parent
commit
53e9608f1b
1 changed files with 30 additions and 1 deletions
  1. 30
    1
      src/java/org/apache/fop/fo/flow/table/TableFObj.java

+ 30
- 1
src/java/org/apache/fop/fo/flow/table/TableFObj.java View File

@@ -28,8 +28,11 @@ 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.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 @@ public abstract class TableFObj extends FObj {
* 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 @@ public abstract class TableFObj extends FObj {

return p;
}
/**
* If the value is not positive, return a property whose value is the next 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 = 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);
}

}

/** {@inheritDoc} */

Loading…
Cancel
Save