}
Stack<String> stack = new Stack<String>();
- for (int i=0 ; i < ptgs.length; i++) {
- Ptg ptg = ptgs[i];
+ for (Ptg ptg : ptgs) {
// TODO - what about MemNoMemPtg?
if(ptg instanceof MemAreaPtg || ptg instanceof MemFuncPtg || ptg instanceof MemErrPtg) {
// marks the start of a list of area expressions which will be naturally combined
package org.apache.poi.ss.formula.ptg;
-import org.apache.poi.ss.util.AreaReference;
import org.apache.poi.ss.formula.ExternSheetReferenceToken;
import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
import org.apache.poi.ss.formula.WorkbookDependentFormula;
+import org.apache.poi.ss.util.AreaReference;
import org.apache.poi.util.LittleEndianInput;
import org.apache.poi.util.LittleEndianOutput;
setExternSheetIndex(externIdx);
}
+ @Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(getClass().getName());
return sb.toString();
}
+ @Override
public void write(LittleEndianOutput out) {
out.writeByte(sid + getPtgClass());
out.writeShort(field_1_index_extern_sheet);
writeCoordinates(out);
}
+ @Override
public int getSize() {
return SIZE;
}
public String toFormulaString(FormulaRenderingWorkbook book) {
return ExternSheetNameResolver.prependSheetName(book, field_1_index_extern_sheet, formatReferenceAsString());
}
+ @Override
public String toFormulaString() {
throw new RuntimeException("3D references need a workbook to determine formula text");
}
public AreaPtg(AreaReference areaRef) {
super(areaRef);
}
+ @Override
protected byte getSid() {
return sid;
}
package org.apache.poi.xssf.usermodel;
-import org.apache.poi.ss.formula.functions.FreeRefFunction;
-import org.apache.poi.ss.formula.ptg.NamePtg;
-import org.apache.poi.ss.formula.ptg.NameXPtg;
-import org.apache.poi.ss.formula.ptg.Ptg;
import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.EvaluationCell;
import org.apache.poi.ss.formula.EvaluationName;
import org.apache.poi.ss.formula.FormulaParsingWorkbook;
import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
import org.apache.poi.ss.formula.FormulaType;
-import org.apache.poi.ss.formula.udf.UDFFinder;
+import org.apache.poi.ss.formula.functions.FreeRefFunction;
+import org.apache.poi.ss.formula.ptg.NamePtg;
+import org.apache.poi.ss.formula.ptg.NameXPtg;
+import org.apache.poi.ss.formula.ptg.Ptg;
import org.apache.poi.ss.formula.udf.IndexedUDFFinder;
+import org.apache.poi.ss.formula.udf.UDFFinder;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName;
/**
* @return the external sheet index of the sheet with the given internal
* index. Used by some of the more obscure formula and named range things.
* Fairly easy on XSSF (we think...) since the internal and external
- * indicies are the same
+ * indices are the same
*/
private int convertToExternalSheetIndex(int sheetIndex) {
return sheetIndex;