/** * Tests various manipulations of blank cells, to make sure that {@link MulBlankRecord}s are use * appropriately */ public void testMultipleBlanks() { BlankRecord brA2 = newBlankRecord(0, 1); BlankRecord brB2 = newBlankRecord(1, 1); BlankRecord brC2 = newBlankRecord(2, 1); BlankRecord brD2 = newBlankRecord(3, 1); BlankRecord brE2 = newBlankRecord(4, 1); BlankRecord brB3 = newBlankRecord(1, 2); BlankRecord brC3 = newBlankRecord(2, 2); valueRecord.insertCell(brA2); valueRecord.insertCell(brB2); valueRecord.insertCell(brD2); confirmMulBlank(3, 1, 1); valueRecord.insertCell(brC3); confirmMulBlank(4, 1, 2); valueRecord.insertCell(brB3); valueRecord.insertCell(brE2); confirmMulBlank(6, 3, 0); valueRecord.insertCell(brC2); confirmMulBlank(7, 2, 0); valueRecord.removeCell(brA2); confirmMulBlank(6, 2, 0); valueRecord.removeCell(brC2); confirmMulBlank(5, 2, 1); valueRecord.removeCell(brC3); confirmMulBlank(4, 1, 2); }
@SuppressWarnings( "deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()} public void testRemoveCell() { BlankRecord blankRecord1 = newBlankRecord(); valueRecord.insertCell(blankRecord1); BlankRecord blankRecord2 = newBlankRecord(); valueRecord.removeCell(blankRecord2); CellValueRecordInterface[] cvrs = valueRecord.getValueRecords(); assertEquals(0, cvrs.length); // removing an already empty cell just falls through valueRecord.removeCell(blankRecord2); }
public void testGetPhysicalNumberOfCells() { assertEquals(0, valueRecord.getPhysicalNumberOfCells()); BlankRecord blankRecord1 = newBlankRecord(); valueRecord.insertCell(blankRecord1); assertEquals(1, valueRecord.getPhysicalNumberOfCells()); valueRecord.removeCell(blankRecord1); assertEquals(0, valueRecord.getPhysicalNumberOfCells()); }
public void testGetLastCellNum() { assertEquals(-1, valueRecord.getLastCellNum()); valueRecord.insertCell(newBlankRecord(2, 2)); assertEquals(2, valueRecord.getLastCellNum()); valueRecord.insertCell(newBlankRecord(3, 3)); assertEquals(3, valueRecord.getLastCellNum()); // Note: Removal doesn't currently reset the last column. It probably should but it doesn't. valueRecord.removeCell(newBlankRecord(3, 3)); assertEquals(3, valueRecord.getLastCellNum()); }
public void removeCell(CellValueRecordInterface cvRec) { if (cvRec instanceof FormulaRecordAggregate) { ((FormulaRecordAggregate) cvRec).notifyFormulaChanging(); } _valuesAgg.removeCell(cvRec); }