Search in sources :

Example 6 with CellRangeAddress8Bit

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]);
}
Also used : CellRangeAddress8Bit(org.apache.poi.hssf.util.CellRangeAddress8Bit)

Example 7 with CellRangeAddress8Bit

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());
}
Also used : CellRangeAddress8Bit(org.apache.poi.hssf.util.CellRangeAddress8Bit) SharedValueRecordBase(org.apache.poi.hssf.record.SharedValueRecordBase)

Example 8 with CellRangeAddress8Bit

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());
}
Also used : CellRangeAddress8Bit(org.apache.poi.hssf.util.CellRangeAddress8Bit) CellRangeAddress(org.apache.poi.ss.util.CellRangeAddress)

Aggregations

CellRangeAddress8Bit (org.apache.poi.hssf.util.CellRangeAddress8Bit)8 ArrayRecord (org.apache.poi.hssf.record.ArrayRecord)2 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)2 SharedValueRecordBase (org.apache.poi.hssf.record.SharedValueRecordBase)1 Ptg (org.apache.poi.ss.formula.ptg.Ptg)1 CellReference (org.apache.poi.ss.util.CellReference)1