use of org.apache.poi.hssf.record.DimensionsRecord in project poi by apache.
the class TestSheet method testRowAggregation.
/**
* Makes sure all rows registered for this sheet are aggregated, they were being skipped
*
*/
@Test
public void testRowAggregation() {
List<Record> records = new ArrayList<Record>();
records.add(InternalSheet.createBOF());
records.add(new DimensionsRecord());
records.add(new RowRecord(0));
records.add(new RowRecord(1));
FormulaRecord formulaRecord = new FormulaRecord();
formulaRecord.setCachedResultTypeString();
records.add(formulaRecord);
records.add(new StringRecord());
records.add(new RowRecord(2));
records.add(createWindow2Record());
records.add(EOFRecord.instance);
InternalSheet sheet = createSheet(records);
assertNotNull("Row [2] was skipped", sheet.getRow(2));
}
use of org.apache.poi.hssf.record.DimensionsRecord in project poi by apache.
the class TestSheet method testMovingMergedRegion.
/**
* Bug: 22922 (Reported by Xuemin Guan)
* <p>
* Remove mergedregion fails when a sheet loses records after an initial CreateSheet
* fills up the records.
*
*/
@Test
public void testMovingMergedRegion() {
List<Record> records = new ArrayList<Record>();
CellRangeAddress[] cras = { new CellRangeAddress(0, 1, 0, 2) };
MergeCellsRecord merged = new MergeCellsRecord(cras, 0, cras.length);
records.add(BOFRecord.createSheetBOF());
records.add(new DimensionsRecord());
records.add(new RowRecord(0));
records.add(new RowRecord(1));
records.add(new RowRecord(2));
records.add(createWindow2Record());
records.add(EOFRecord.instance);
records.add(merged);
InternalSheet sheet = createSheet(records);
// TODO - what does this line do?
sheet.getRecords().remove(0);
//stub object to throw off list INDEX operations
sheet.removeMergedRegion(0);
assertEquals("Should be no more merged regions", 0, sheet.getNumMergedRegions());
}
Aggregations