// the workbook
case BOFRecord.sid:
BOFRecord bof = (BOFRecord) record;
- if (bof.getType() == bof.TYPE_WORKBOOK || bof.getType() == bof.TYPE_WORKSHEET) {
+ if (bof.getType() == BOFRecord.TYPE_WORKBOOK ||
+ bof.getType() == BOFRecord.TYPE_WORKSHEET) {
// Reset the row and column counts - new workbook / worksheet
resetCounts();
}
// Record this as the last row we saw
lastRowRow = rowrec.getRowNumber();
+ lastCellColumn = -1;
break;
case SharedFormulaRecord.sid:
// If we're on cells, and this cell isn't in the same
// row as the last one, then fire the
// dummy end-of-row records
- if(thisRow != lastCellRow && lastCellRow > -1) {
+ if(thisRow != lastCellRow && thisRow > 0) {
+ if (lastCellRow == -1) lastCellRow = 0;
for(int i=lastCellRow; i<thisRow; i++) {
int cols = -1;
if(i == lastCellRow) {
// Now onto the cells
// Because the 3 first rows are missing, should have last-of-row records first
- // TODO Fix!
+ assertEquals(LastCellOfRowDummyRecord.class, r[pos].getClass());
+ assertEquals(0, ((LastCellOfRowDummyRecord)r[pos]).getRow());
+ assertEquals(-1, ((LastCellOfRowDummyRecord)r[pos]).getLastColumnNumber());
+ pos++;
+ assertEquals(LastCellOfRowDummyRecord.class, r[pos].getClass());
+ assertEquals(1, ((LastCellOfRowDummyRecord)r[pos]).getRow());
+ assertEquals(-1, ((LastCellOfRowDummyRecord)r[pos]).getLastColumnNumber());
+ pos++;
+ assertEquals(LastCellOfRowDummyRecord.class, r[pos].getClass());
+ assertEquals(2, ((LastCellOfRowDummyRecord)r[pos]).getRow());
+ assertEquals(-1, ((LastCellOfRowDummyRecord)r[pos]).getLastColumnNumber());
+ pos++;
// Onto row 4 (=3)