use of org.apache.poi.hssf.util.CellRangeAddress8Bit in project poi by apache.
the class TestTableRecord method testStore.
public void testStore() {
// Offset 0x3bd9 (15321)
// recordid = 0x236, size = 16
// [TABLE]
// .row from = 3
// .row to = 8
// .column from = 4
// .column to = 6
// .flags = 0
// .always calc =false
// .reserved = 0
// .row input row = 4
// .col input row = 1
// .row input col = 4076
// .col input col = 0
// [/TABLE]
CellRangeAddress8Bit crab = new CellRangeAddress8Bit(3, 8, 4, 6);
TableRecord record = new TableRecord(crab);
record.setFlags((byte) 0);
record.setRowInputRow(4);
record.setColInputRow(1);
record.setRowInputCol(0x4076);
record.setColInputCol(0);
byte[] recordBytes = record.serialize();
assertEquals(recordBytes.length - 4, data.length);
for (int i = 0; i < data.length; i++) assertEquals("At offset " + i, data[i], recordBytes[i + 4]);
}
use of org.apache.poi.hssf.util.CellRangeAddress8Bit in project poi by apache.
the class TestRowRecordsAggregate method verifySharedFormula.
private static void verifySharedFormula(FormulaRecord firstFormula, Record rec) {
CellRangeAddress8Bit range = ((SharedValueRecordBase) rec).getRange();
assertEquals(range.getFirstRow(), firstFormula.getRow());
assertEquals(range.getFirstColumn(), firstFormula.getColumn());
}
use of org.apache.poi.hssf.util.CellRangeAddress8Bit in project poi by apache.
the class FormulaRecordAggregate method removeArrayFormula.
/**
* Removes an array formula
* @return the range of the array formula containing the specified cell. Never <code>null</code>
*/
public CellRangeAddress removeArrayFormula(int rowIndex, int columnIndex) {
CellRangeAddress8Bit a = _sharedValueManager.removeArrayFormula(rowIndex, columnIndex);
// at this point FormulaRecordAggregate#isPartOfArrayFormula() should return false
_formulaRecord.setParsedExpression(null);
return new CellRangeAddress(a.getFirstRow(), a.getLastRow(), a.getFirstColumn(), a.getLastColumn());
}
Aggregations