log.log(POILogger.DEBUG, "Sheet.setDimensions exiting");
}
public void visitContainedRecords(RecordVisitor rv, int offset) {
PositionTrackingVisitor ptv = new PositionTrackingVisitor(rv, offset);
boolean haveSerializedIndex = false;
for (int k = 0; k < records.size(); k++)
{
RecordBase record = (RecordBase) records.get(k);
if (record instanceof RecordAggregate) {
RecordAggregate agg = (RecordAggregate) record;
agg.visitContainedRecords(ptv);
} else {
ptv.visitRecord((Record) record);
}
// If the BOF record was just serialized then add the IndexRecord
if (record instanceof BOFRecord) {
if (!haveSerializedIndex) {
haveSerializedIndex = true;
// Add an optional UncalcedRecord. However, we should add
// it in only the once, after the sheet's own BOFRecord.
// If there are diagrams, they have their own BOFRecords,
// and one shouldn't go in after that!
if (_isUncalced) {
ptv.visitRecord(new UncalcedRecord());
}
//Can there be more than one BOF for a sheet? If not then we can
//remove this guard. So be safe it is left here.
if (_rowsAggregate != null) {
// find forward distance to first RowRecord
int initRecsSize = getSizeOfInitialSheetRecords(k);
int currentPos = ptv.getPosition();
ptv.visitRecord(_rowsAggregate.createIndexRecord(currentPos, initRecsSize));
}
}
}
}
}