Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.BlankRecord


    cvrs = valueRecord.getValueRecords();
    assertEquals(1, cvrs.length);
  }

  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
View Full Code Here


    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());
  }
View Full Code Here

  private static BlankRecord newBlankRecord() {
    return newBlankRecord( 2, 2 );
  }

  private static BlankRecord newBlankRecord(int col, int row) {
    BlankRecord blankRecord = new BlankRecord();
    blankRecord.setRow( row );
    blankRecord.setColumn( (short) col );
    return blankRecord;
  }
View Full Code Here

  /**
   * 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);
View Full Code Here

    InternalSheet sheet = InternalSheet.createSheet();

    RowRecord rr = new RowRecord(5);
    sheet.addRow(rr);

    CellValueRecordInterface cvr = new BlankRecord();
    cvr.setColumn((short)0);
    cvr.setRow(5);
    sheet.addValueRecord(5, cvr);


    int dbCellRecordPos = getDbCellRecordPos(sheet);
    if (dbCellRecordPos == 252) {
View Full Code Here

        HSSFSheet sheet = workbook.createSheet("Sheet1");
        RowRecord rowRec = new RowRecord(ROW_IX);
        rowRec.setFirstCol((short)2);
        rowRec.setLastCol((short)5);

        BlankRecord br = new BlankRecord();
        br.setRow(ROW_IX);
        br.setColumn((short)COL_IX);

        sheet.getSheet().addValueRecord(ROW_IX, br);
        HSSFRow row = new HSSFRow(workbook, sheet, rowRec);
        HSSFCell cell = row.createCellFromRecord(br);
View Full Code Here

                }
                _record = lrec;
                break;

            case CELL_TYPE_BLANK :
                BlankRecord brec = null;

                if (cellType != _cellType)
                {
                    brec = new BlankRecord();
                }
                else
                {
                    brec = ( BlankRecord ) _record;
                }
                brec.setColumn(col);

                // During construction the cellStyle may be null for a Blank cell.
                brec.setXFIndex(styleIndex);
                brec.setRow(row);
                _record = brec;
                break;

            case CELL_TYPE_BOOLEAN :
                BoolErrRecord boolRec = null;
View Full Code Here

                }
                record = lrec;
                break;

            case CELL_TYPE_BLANK :
                BlankRecord brec = null;

                if (cellType != this.cellType)
                {
                    brec = new BlankRecord();
                }
                else
                {
                    brec = ( BlankRecord ) record;
                }
                brec.setColumn(col);

                // During construction the cellStyle may be null for a Blank cell.
                brec.setXFIndex(styleIndex);
                brec.setRow(row);
                record = brec;
                break;

            case CELL_TYPE_BOOLEAN :
                BoolErrRecord boolRec = null;
View Full Code Here

    }

    private static List testData() {
        List records = new ArrayList();
        FormulaRecord formulaRecord = new FormulaRecord();
        BlankRecord blankRecord = new BlankRecord();
        formulaRecord.setRow( 1 );
        formulaRecord.setColumn( (short) 1 );
        blankRecord.setRow( 2 );
        blankRecord.setColumn( (short) 2 );
        records.add( formulaRecord );
        records.add( blankRecord );
        records.add(new WindowTwoRecord());
        return records;
    }
View Full Code Here

    public void testInsertCell() {
        Iterator iterator = valueRecord.getIterator();
        assertFalse( iterator.hasNext() );

        BlankRecord blankRecord = newBlankRecord();
        valueRecord.insertCell( blankRecord );
        iterator = valueRecord.getIterator();
        assertTrue( iterator.hasNext() );
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.BlankRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.