StringBuffer buf = new StringBuffer();
+ if (token instanceof ExpPtg) return;
buf.append(name=((OperationPtg) token).toFormulaString());
buf.append(sep);
switch (token.getPtgClass()) {
functionData[0][0]=new Byte(Ptg.CLASS_VALUE);functionData[0][1]=new byte[] {Ptg.CLASS_REF};functionData[0][2]=new Integer(-1);
functionData[2][0]=new Byte(Ptg.CLASS_VALUE);functionData[2][1]=new byte[] {Ptg.CLASS_VALUE};functionData[2][2]=new Integer(1);
functionData[3][0]=new Byte(Ptg.CLASS_VALUE);functionData[3][1]=new byte[] {Ptg.CLASS_VALUE};functionData[3][2]=new Integer(1);
-functionData[4][0]=new Byte(Ptg.CLASS_REF);functionData[4][1]=new byte[] {Ptg.CLASS_REF};functionData[4][2]=new Integer(-1);
+functionData[4][0]=new Byte(Ptg.CLASS_VALUE);functionData[4][1]=new byte[] {Ptg.CLASS_REF};functionData[4][2]=new Integer(-1);
functionData[5][0]=new Byte(Ptg.CLASS_VALUE);functionData[5][1]=new byte[] {Ptg.CLASS_REF};functionData[5][2]=new Integer(-1);
functionData[6][0]=new Byte(Ptg.CLASS_VALUE);functionData[6][1]=new byte[] {Ptg.CLASS_REF};functionData[6][2]=new Integer(-1);
functionData[7][0]=new Byte(Ptg.CLASS_VALUE);functionData[7][1]=new byte[] {Ptg.CLASS_REF};functionData[7][2]=new Integer(-1);
private Ptg function(String name,byte numArgs) {
Ptg retval = null;
-
- if (numArgs == 1 && name.equals("SUM")) {
+ retval = new FuncVarPtg(name,numArgs);
+ /** if (numArgs == 1 && name.equals("SUM")) {
AttrPtg ptg = new AttrPtg();
ptg.setData((short)1); //sums don't care but this is what excel does.
ptg.setSum(true);
retval = ptg;
} else {
retval = new FuncVarPtg(name,numArgs);
- }
+ }*/
- return retval;
+ return retval;
}
/** get arguments to a function */
c=r.createCell( (short) 5);
c.setCellFormula("SIN(A2)");
+ c=r.createCell( (short) 6);
+ c.setCellFormula("SUM(A2:A3)");
+
+ c=r.createCell( (short) 7);
+ c.setCellFormula("SUM(A2,A3)");
+
r = s.createRow((short) 1);c=r.createCell( (short) 0); c.setCellValue(2.0);
r = s.createRow((short) 2);c=r.createCell( (short) 0); c.setCellValue(3.0);