pretty printing from AttrPtg, submitted by Werner Froidevaux

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352673 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Avik Sengupta 2002-06-11 21:17:44 +00:00
parent e27d8be5e1
commit 4c62750ea5

View File

@ -191,10 +191,15 @@ public class AttrPtg
return SIZE;
}
public String toFormulaString()
{
return "ATTR";
public String toFormulaString(String[] operands) {
if(space.isSet(field_1_options)) {
return operands[ 0 ];
}
else {
return toFormulaString() + "(" + operands[ 0 ] + ")";
}
}
public int getNumberOfOperands()
{
@ -206,9 +211,31 @@ public class AttrPtg
return -1;
}
public String toFormulaString(String[] operands) {
return "SUM(" + operands[ 0 ] + ")";
}
public String toFormulaString() {
if(semiVolatile.isSet(field_1_options)) {
return "ATTR(semiVolatile)";
}
if(optiIf.isSet(field_1_options)) {
return "IF";
}
if( optiChoose.isSet(field_1_options)) {
return "CHOOSE";
}
if(optGoto.isSet(field_1_options)) {
return "GOTO";
}
if(sum.isSet(field_1_options)) {
return "SUM";
}
if(baxcel.isSet(field_1_options)) {
return "ATTR(baxcel)";
}
if(space.isSet(field_1_options)) {
return "";
}
return "UNKNOWN ATTRIBUTE";
}
public byte getDefaultOperandClass() {return Ptg.CLASS_VALUE;}