Package org.apache.poi.hssf.record

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


    if (!(records.get(i) instanceof EOFRecord)) {
      throw new IllegalStateException("Last sheet record should be EOFRecord");
    }
    while (i > 0) {
      i--;
      RecordBase rb = records.get(i);
      if (isDVTPriorRecord(rb)) {
        Record nextRec = (Record) records.get(i + 1);
        if (!isDVTSubsequentRecord(nextRec.getSid())) {
          throw new IllegalStateException("Unexpected (" + nextRec.getClass().getName()
              + ") found after (" + rb.getClass().getName() + ")");
        }
        return i+1;
      }
      Record rec = (Record) rb;
      if (!isDVTSubsequentRecord(rec.getSid())) {
View Full Code Here


  private static int getGutsRecordInsertPos(List<RecordBase> records) {
    int dimensionsIndex = getDimensionsIndex(records);
    int i = dimensionsIndex-1;
    while (i > 0) {
      i--;
      RecordBase rb = records.get(i);
      if (isGutsPriorRecord(rb)) {
        return i+1;
      }
    }
    throw new RuntimeException("Did not find insert point for GUTS");
View Full Code Here

    if(rowCells == null) {
      return 0;
    }
    int result = 0;
    for (int i = 0; i < rowCells.length; i++) {
      RecordBase cvr = (RecordBase) rowCells[i];
      if(cvr == null) {
        continue;
      }
      int nBlank = countBlanks(rowCells, i);
      if (nBlank > 1) {
        result += (10 + 2*nBlank);
        i+=nBlank-1;
      } else {
        result += cvr.getRecordSize();
      }
    }
    return result;
  }
View Full Code Here

      throw new IllegalArgumentException("Row [" + rowIndex + "] is empty");
    }


    for (int i = 0; i < rowCells.length; i++) {
      RecordBase cvr = (RecordBase) rowCells[i];
      if(cvr == null) {
        continue;
      }
      int nBlank = countBlanks(rowCells, i);
      if (nBlank > 1) {
View Full Code Here

    protected static HSSFComment findCellComment(Sheet sheet, int row, int column){
        // TODO - optimise this code by searching backwards, find NoteRecord first, quit if not found. Find one TXO by id
        HSSFComment comment = null;
        HashMap<Integer, TextObjectRecord> txshapesByShapeId = new HashMap<Integer, TextObjectRecord>();
        for (Iterator<RecordBase> it = sheet.getRecords().iterator(); it.hasNext(); ) {
           RecordBase rec = it.next();
           if (rec instanceof NoteRecord){
               NoteRecord note = (NoteRecord)rec;
               if (note.getRow() == row && note.getColumn() == column){
                   TextObjectRecord txo = txshapesByShapeId.get(new Integer(note.getShapeId()));
                   comment = new HSSFComment(note, txo);
View Full Code Here

    /**
     * @return hyperlink associated with this cell or <code>null</code> if not found
     */
    public HSSFHyperlink getHyperlink(){
        for (Iterator<RecordBase> it = _sheet.getSheet().getRecords().iterator(); it.hasNext(); ) {
            RecordBase rec = it.next();
            if (rec instanceof HyperlinkRecord){
                HyperlinkRecord link = (HyperlinkRecord)rec;
                if(link.getFirstColumn() == _record.getColumn() && link.getFirstRow() == _record.getRow()){
                    return new HSSFHyperlink(link);
                }
View Full Code Here

     * belongs to a sheet.
     */
    public Sheet cloneSheet() {
        List<RecordBase> clonedRecords = new ArrayList<RecordBase>(records.size());
        for (int i = 0; i < records.size(); i++) {
            RecordBase rb = records.get(i);
            if (rb instanceof RecordAggregate) {
                ((RecordAggregate) rb).visitContainedRecords(new RecordCloner(clonedRecords));
                continue;
            }
            Record rec = (Record) ((Record) rb).clone();
View Full Code Here

        PositionTrackingVisitor ptv = new PositionTrackingVisitor(rv, offset);

        boolean haveSerializedIndex = false;

        for (int k = 0; k < records.size(); k++) {
            RecordBase record = records.get(k);

            if (record instanceof RecordAggregate) {
                RecordAggregate agg = (RecordAggregate) record;
                agg.visitContainedRecords(ptv);
            } else {
View Full Code Here

    private int getSizeOfInitialSheetRecords(int bofRecordIndex) {

        int result = 0;
        // start just after BOF record (INDEX is not present in this list)
        for (int j = bofRecordIndex + 1; j < records.size(); j++) {
            RecordBase tmpRec = records.get(j);
            if (tmpRec instanceof RowRecordsAggregate) {
                break;
            }
            result += tmpRec.getRecordSize();
        }
        if (_isUncalced) {
            result += UncalcedRecord.getStaticRecordSize();
        }
        return result;
View Full Code Here

     */
    public void preSerialize()
    {
        for ( Iterator iterator = getRecords().iterator(); iterator.hasNext(); )
        {
            RecordBase r = (RecordBase) iterator.next();
            if (r instanceof EscherAggregate)
                r.getRecordSize();   // Trigger flatterning of user model and corresponding update of dgg record.
        }
    }
View Full Code Here

TOP

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

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.