*
* @param newIndex the new column index
*/
- protected void setCurrentColumnIndex(int newIndex) {
+ public void setCurrentColumnIndex(int newIndex) {
columnIndex = newIndex;
}
//in the current row => error!
if (((TableFObj) parent).isColumnNumberUsed(columnIndex)) {
throw new FOPException("fo:table-cell overlaps in column "
- + i, locator);
+ + columnIndex, locator);
}
}
- //if column-number was explicitly specified, force the parent's current
- //column index to the specified value, so that the updated index will
- //be the correct initial value for the next cell (see Rec 7.26.8)
- if (pList.getExplicit(PR_COLUMN_NUMBER) != null) {
- ((TableFObj) parent).setCurrentColumnIndex(columnNumber.getValue());
- }
}
/**
visibility = pList.get(PR_VISIBILITY).getEnum();
super.bind(pList);
- if (pList.getExplicit(PR_COLUMN_NUMBER) != null) {
- if (getTable().isColumnNumberUsed(columnNumber.getValue())) {
- throw new PropertyException("Specified column-number \""
- + columnNumber
- + "\" has already been assigned to a previous column");
- } else {
- //force parent table's current column index
- //to the specified value, so that the updated index
- //will be the correct initial value for the next column
- //(see Rec 7.26.8)
- getTable().setCurrentColumnIndex(columnNumber.getValue());
- }
+ if (getTable().isColumnNumberUsed(columnNumber.getValue())) {
+ throw new PropertyException("column-number \"" + columnNumber
+ + "\" has already been assigned to a previous column");
}
if (numberColumnsRepeated.getValue() <= 0) {
throw new PropertyException("number-columns-repeated must be 1 or bigger, "
*
* @param newIndex new value for column index
*/
- protected void setCurrentColumnIndex(int newIndex) {
+ public void setCurrentColumnIndex(int newIndex) {
//do nothing by default
}
*
* @param newIndex new value for column index
*/
- protected void setCurrentColumnIndex(int newIndex) {
+ public void setCurrentColumnIndex(int newIndex) {
columnIndex = newIndex;
}
Property p = super.get(0, propertyList, tryInherit, tryDefault);
FObj fo = propertyList.getFObj();
+ TableFObj parent = (TableFObj) propertyList.getParentFObj();
if (p.getNumeric().getValue() <= 0) {
- TableFObj parent = (TableFObj) propertyList.getParentFObj();
int columnIndex = parent.getCurrentColumnIndex();
fo.getLogger().warn("Specified negative or zero value for "
+ "column-number on " + fo.getName() + ": "
return new NumberProperty(columnIndex);
}
//TODO: check for non-integer value and round
+
+ //if column-number was explicitly specified, force the parent's current
+ //column index to the specified value, so that the updated index will
+ //be the correct initial value for the next cell (see Rec 7.26.8)
+ if (propertyList.getExplicit(Constants.PR_COLUMN_NUMBER) != null) {
+ parent.setCurrentColumnIndex(p.getNumeric().getValue());
+ }
return p;
}
}