Package org.apache.poi.hssf.record

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


    }

    public String toFormulaString()
    {
        // table(....)[][]
        throw new RecordFormatException("Table and Arrays are not yet supported");
    }
View Full Code Here


      return field_2_first_col;
    }   

    public String toFormulaString()
    {
        throw new RecordFormatException("Coding Error: Expected ExpPtg to be converted from Shared to Non-Shared Formula by ValueRecordsAggregate, but it wasn't");
    }
View Full Code Here

            maxDgId = Math.max(maxDgId, field_5_fileIdClusters[i].getDrawingGroupId());
            size += 8;
        }
        bytesRemaining         -= size;
        if (bytesRemaining != 0)
            throw new RecordFormatException("Expecting no remaining data but got " + bytesRemaining + " byte(s).");
        return 8 + size + bytesRemaining;
    }
View Full Code Here

    return true;
  }

  private void checkNotPresent(Record rec) {
    if (rec != null) {
      throw new RecordFormatException("Duplicate PageSettingsBlock record (sid=0x"
          + Integer.toHexString(rec.getSid()) + ")");
    }
  }
View Full Code Here

        return;
      case 10:
        // as per "MICROSOFT OFFICE EXCEL 97-2007 BINARY FILE FORMAT SPECIFICATION" pdf
        break;
      default:
        throw new RecordFormatException("Unexpected remaining size (" + in.remaining() + ")");
    }
    int cchSubName = in.readUShort();
    _reserved1 = in.readInt();
    _reserved2 = in.readInt();
    if (cchSubName != STRING_NOT_PRESENT_LEN) {
View Full Code Here

  private final FieldInfo[] _fieldInfos;

  public PageItemRecord(RecordInputStream in) {
    int dataSize = in.remaining();
    if (dataSize % FieldInfo.ENCODED_SIZE != 0) {
      throw new RecordFormatException("Bad data size " + dataSize);
    }

    int nItems = dataSize / FieldInfo.ENCODED_SIZE;

    FieldInfo[] fis = new FieldInfo[nItems];
View Full Code Here

    if (svm == null) {
      throw new IllegalArgumentException("sfm must not be null");
    }
    if (formulaRec.hasCachedResultString()) {
      if (stringRec == null) {
        throw new RecordFormatException("Formula record flag is set but String record was not found");
      }
      _stringRecord = stringRec;
    } else {
      // Usually stringRec is null here (in agreement with what the formula rec says).
      // In the case where an extra StringRecord is erroneously present, Excel (2007)
View Full Code Here

   */
  private static void handleMissingSharedFormulaRecord(FormulaRecord formula) {
    // make sure 'unshared' formula is actually available
    Ptg firstToken = formula.getParsedExpression()[0];
    if (firstToken instanceof ExpPtg) {
      throw new RecordFormatException(
          "SharedFormulaRecord not found for FormulaRecord with (isSharedFormula=true)");
    }
    // could log an info message here since this is a fairly unusual occurrence.
    formula.setSharedFormula(false); // no point leaving the flag erroneously set
  }
View Full Code Here

                req.processRecord(rec);
            }
        }
        catch (IOException e)
        {
            throw new RecordFormatException("Error reading bytes");
        }

        // Record[] retval = new Record[ records.size() ];
        // retval = ( Record [] ) records.toArray(retval);
        // return null;
View Full Code Here

    return true;
  }

  private void checkNotPresent(Record rec) {
    if (rec != null) {
      throw new RecordFormatException("Duplicate PageSettingsBlock record (sid=0x"
          + Integer.toHexString(rec.getSid()) + ")");
    }
  }
View Full Code Here

TOP

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

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.