SharedFormula clone patch that was already applied to HEAD
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353171 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c7f251cdca
commit
a6e14b5490
@ -607,8 +607,8 @@ public class FormulaRecord
|
||||
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;
|
||||
|
@ -82,6 +82,19 @@ public class FormulaRecordAggregate
|
||||
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 )
|
||||
@ -221,7 +234,10 @@ public class FormulaRecordAggregate
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
||||
@ -241,4 +257,14 @@ public class FormulaRecordAggregate
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -110,7 +110,10 @@ public class ExpPtg
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user