if (field_8_parsed_expr != null)
size = field_8_parsed_expr.size();
for (int i=0; i< size; i++) {
- Ptg ptg = (Ptg)((Ptg)field_8_parsed_expr.get(i)).clone();
- rec.field_8_parsed_expr.set(i, ptg);
+ Ptg ptg = (Ptg)((Ptg)field_8_parsed_expr.get(i)).clone();
+ rec.field_8_parsed_expr.add(i, ptg);
}
rec.all_data = all_data;
return rec;
this.stringRecord = stringRecord;
}
+ /**
+ * Used only in the clone
+ * @param formulaRecord
+ * @param stringRecord
+ * @param sharedRecord
+ */
+ public FormulaRecordAggregate( FormulaRecord formulaRecord, StringRecord stringRecord, SharedFormulaRecord sharedRecord)
+ {
+ this.formulaRecord = formulaRecord;
+ this.stringRecord = stringRecord;
+ this.sharedFormulaRecord = sharedRecord;
+ }
+
protected void validateSid( short id )
* @see java.lang.Object#clone()
*/
public Object clone() {
- return new FormulaRecordAggregate((FormulaRecord) this.formulaRecord.clone(), (StringRecord) this.stringRecord.clone());
+ StringRecord clonedString = (stringRecord == null) ? null : (StringRecord)stringRecord.clone();
+ SharedFormulaRecord clonedShared = (sharedFormulaRecord == null) ? null : (SharedFormulaRecord)sharedFormulaRecord.clone();
+
+ return new FormulaRecordAggregate((FormulaRecord) this.formulaRecord.clone(), clonedString, clonedShared);
}
this.sharedFormulaRecord = sharedFormulaRecord;
}
+ /*
+ * Setting to true so that this value does not abort the whole ValueAggregation
+ * (non-Javadoc)
+ * @see org.apache.poi.hssf.record.Record#isInValueSection()
+ */
+ public boolean isInValueSection() {
+
+ return true;
+ }
+
}
public byte getDefaultOperandClass() {return Ptg.CLASS_VALUE;}
public Object clone() {
- throw new RuntimeException("NO IDEA SHARED FORMULA EXP PTG");
+ //can't clone one that doesnt have data can we??
+ if (this.existing == null) throw new RuntimeException("NO IDEA SHARED FORMULA EXP PTG");
+
+ return new ExpPtg(this.existing, 0);
}
}