Package org.apache.poi.hssf.record

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


   * as part of the value records
   */
  public void testSharedFormula() {
    List<Record> records = new ArrayList<Record>();
    records.add(new FormulaRecord());
    records.add(new SharedFormulaRecord());
    records.add(new WindowTwoRecord());

    constructValueRecord(records);
    CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
    //Ensure that the SharedFormulaRecord has been converted
View Full Code Here


    }
    _arrayRecords = toList(arrayRecords);
    _tableRecords = tableRecords;
    Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<SharedFormulaRecord, SharedFormulaGroup>(nShF * 3 / 2);
    for (int i = 0; i < nShF; i++) {
      SharedFormulaRecord sfr = sharedFormulaRecords[i];
      m.put(sfr, new SharedFormulaGroup(sfr, firstCells[i]));
    }
    _groupsBySharedFormulaRecord = m;
  }
View Full Code Here

    notifyFormulaChanging();
    _formulaRecord.setParsedExpression(ptgs);
  }

  public void unlinkSharedFormula() {
    SharedFormulaRecord sfr = _sharedFormulaRecord;
    if (sfr == null) {
      throw new IllegalStateException("Formula not linked to shared formula");
    }
    Ptg[] ptgs = sfr.getFormulaTokens(_formulaRecord);
    _formulaRecord.setParsedExpression(ptgs);
    //Now its not shared!
    _formulaRecord.setSharedFormula(false);
    _sharedFormulaRecord = null;
  }
View Full Code Here

    int column = formula.getColumn();
    // Traverse the list of shared formulas in
    // reverse order, and try to find the correct one
    // for us
    for (int i = 0; i < _sfrs.length; i++) {
      SharedFormulaRecord shrd = _sfrs[i];
      if (shrd.isInRange(row, column)) {
        shrd.convertSharedFormulaRecord(formula);
        return;
      }
    }
    // not found
    handleMissingSharedFormulaRecord(formula);
View Full Code Here

     * as part of the value records
     */
    public void testSharedFormula() {
        List records = new ArrayList();
        records.add( new FormulaRecord() );
        records.add( new SharedFormulaRecord() );
        records.add(new WindowTwoRecord());

        constructValueRecord(records);
        Iterator iterator = valueRecord.getIterator();
        RecordBase record = (RecordBase) iterator.next();
View Full Code Here

   */
    @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
  public void testSharedFormula() {
    List<Record> records = new ArrayList<Record>();
    records.add(new FormulaRecord());
    records.add(new SharedFormulaRecord());
    records.add(new WindowTwoRecord());

    constructValueRecord(records);
    CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
    //Ensure that the SharedFormulaRecord has been converted
View Full Code Here

    notifyFormulaChanging();
    _formulaRecord.setParsedExpression(ptgs);
  }

  public void unlinkSharedFormula() {
    SharedFormulaRecord sfr = _sharedFormulaRecord;
    if (sfr == null) {
      throw new IllegalStateException("Formula not linked to shared formula");
    }
    Ptg[] ptgs = sfr.getFormulaTokens(_formulaRecord);
    _formulaRecord.setParsedExpression(ptgs);
    //Now its not shared!
    _formulaRecord.setSharedFormula(false);
    _sharedFormulaRecord = null;
  }
View Full Code Here

     *
     */
    public void testSharedFormula() {
      List records = new ArrayList();
      records.add(new FormulaRecord());
      records.add(new SharedFormulaRecord());
     
      ValueRecordsAggregate valueRecord = new ValueRecordsAggregate();
      valueRecord.construct(0, records);
      Iterator iterator = valueRecord.getIterator();     
      Record record = (Record)iterator.next();
View Full Code Here

    notifyFormulaChanging();
    _formulaRecord.setParsedExpression(ptgs);
  }

  public void unlinkSharedFormula() {
    SharedFormulaRecord sfr = _sharedFormulaRecord;
    if (sfr == null) {
      throw new IllegalStateException("Formula not linked to shared formula");
    }
    Ptg[] ptgs = sfr.getFormulaTokens(_formulaRecord);
    _formulaRecord.setParsedExpression(ptgs);
    //Now its not shared!
    _formulaRecord.setSharedFormula(false);
    _sharedFormulaRecord = null;
  }
View Full Code Here

     *
     */
    public void testSharedFormula() {
      List records = new ArrayList();
      records.add(new FormulaRecord());
      records.add(new SharedFormulaRecord());
     
      ValueRecordsAggregate valueRecord = new ValueRecordsAggregate();
      valueRecord.construct(0, records);
      Iterator iterator = valueRecord.getIterator();     
      Record record = (Record)iterator.next();
View Full Code Here

TOP

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

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.