pietsch 2003/07/27 13:09:24
Modified: src/org/apache/fop/fo Tag: fop-0_20_2-maintain FObj.java
src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain
TableRow.java
Log:
Better error messages if table cells don't fit available
columns for any reason.
Revision Changes Path
No revision
No revision
1.20.2.10 +13 -1 xml-fop/src/org/apache/fop/fo/Attic/FObj.java
Index: FObj.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FObj.java,v
retrieving revision 1.20.2.9
retrieving revision 1.20.2.10
diff -u -r1.20.2.9 -r1.20.2.10
--- FObj.java 11 Apr 2003 00:24:37 -0000 1.20.2.9
+++ FObj.java 27 Jul 2003 20:09:23 -0000 1.20.2.10
@@ -91,6 +91,18 @@
setWritingMode();
}
+ public String getSystemId() {
+ return systemId;
+ }
+
+ public int getLine() {
+ return line;
+ }
+
+ public int getColumn() {
+ return column;
+ }
+
protected PropertyManager makePropertyManager(PropertyList propertyList) {
return new PropertyManager(propertyList);
}
No revision
No revision
1.51.2.13 +10 -9 xml-fop/src/org/apache/fop/fo/flow/Attic/TableRow.java
Index: TableRow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/TableRow.java,v
retrieving revision 1.51.2.12
retrieving revision 1.51.2.13
diff -u -r1.51.2.12 -r1.51.2.13
--- TableRow.java 20 Jul 2003 20:49:28 -0000 1.51.2.12
+++ TableRow.java 27 Jul 2003 20:09:23 -0000 1.51.2.13
@@ -501,7 +501,7 @@
* Before starting layout for the first time, initialize information
* about spanning rows, empty cells and spanning columns.
*/
- private void initCellArray() {
+ private void initCellArray() throws FOPException {
cellArray = new CellArray(rowSpanMgr, columns.size());
int colNum = 1;
for (int i = 0; i< children.size(); i++) {
@@ -519,30 +519,31 @@
// cell.setColumnNumber(colNum);
// If cellColNum "off the end", this cell is in limbo!
if (colNum < 1) {
- // ERROR!!!
- continue;
+ throw new FOPException("Cell (#"+i+") implicitely positioned
beyond number of columns", cell.getSystemId(), cell.getLine(), cell.getColumn());
} else
cellColNum = colNum;
} else if (cellColNum > columns.size()) {
- // Explicit specification out of range!
- // Skip it and print an ERROR MESSAGE
+ // Explicit colomn number specification out of range, skip it.
+ log.error(" "+systemId+':'+cell.getLine()+':'+cell.getColumn()+":
Cell (#"+ i +") explicitely positioned beyond number of columns, dropped");
continue;
}
// see if it fits and doesn't overwrite anything
if (cellColNum + numCols - 1 > columns.size()) {
- // MESSAGE: TOO MANY COLUMNS SPANNED!
+ // Too many columns spanned.
+ log.error(" "+systemId+':'+cell.getLine()+':'+cell.getColumn()+":
Cell (#"+i+") spans columns beyond available number, clipped");
numCols = columns.size() - cellColNum + 1;
}
// Check for overwriting other cells (returns false)
if (cellArray.storeCell(cell, cellColNum, numCols) == false) {
- // Print out some kind of warning message.
+ log.error(" "+systemId+':'+cell.getLine()+':'+cell.getColumn()+":
Cell +(#"+i+") overwrites other cells");
}
if (cellColNum > colNum) {
// Cells are initialized as empty already
colNum = cellColNum;
} else if (cellColNum < colNum) {
- // MESSAGE ? cells out of order?
+ // Cells out of order
colNum = cellColNum; // CR "to the letter"!
+ log.debug(" "+systemId+':'+line+':'+column+": Cell positioned out
of order");
}
int cellWidth = getCellWidth(cellColNum, numCols);
cell.setWidth(cellWidth);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]