From d2738922a873c40f9abc5a3873cd71258b71bdc7 Mon Sep 17 00:00:00 2001 From: "Andrew C. Oliver" Date: Sat, 27 Apr 2002 17:26:06 +0000 Subject: [PATCH] Fixes for formulas git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352502 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/record/formula/FormulaParser.java | 5 ++++- src/java/org/apache/poi/hssf/usermodel/HSSFCell.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java b/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java index 8f6da9da8..4c0cefe4f 100644 --- a/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java @@ -62,6 +62,8 @@ import java.util.Stack; import org.apache.poi.hssf.usermodel.*; import java.io.FileOutputStream; +import java.io.File; + /** * EXPERIMENTAL @@ -438,7 +440,8 @@ end; System.out.println("Converted Text form is : "+fp.toFormulaString(fp.getRPNPtg())); try { short rownum = 0; - FileOutputStream out = new FileOutputStream("test.xls"); + File file = File.createTempFile("testFormula",".xls"); + FileOutputStream out = new FileOutputStream(file); HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet s = wb.createSheet(); HSSFRow r = null; diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java index c2bb655a2..080e977da 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java @@ -701,7 +701,7 @@ public class HSSFCell fp.parse(); Ptg[] ptg = fp.getRPNPtg(); int size = 0; - System.out.println("got Ptgs " + ptg.length); + //System.out.println("got Ptgs " + ptg.length); for (int k = 0; k < ptg.length; k++) { size += ptg[ k ].getSize(); rec.pushExpressionToken(ptg[ k ]);