changes/status for #44675, #44695, #44691

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@642904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Josh Micich 2008-03-31 06:55:04 +00:00
parent ede1814a1d
commit 5b0efa8e57
23 changed files with 233 additions and 224 deletions

View File

@ -37,6 +37,7 @@
<!-- Don't forget to update status.xml too! --> <!-- Don't forget to update status.xml too! -->
<release version="3.0.3-beta1" date="2008-04-??"> <release version="3.0.3-beta1" date="2008-04-??">
<action dev="POI-DEVELOPERS" type="add">Various fixes: Recognising var-arg built-in functions #44675, ExternalNameRecord serialisation bug #44695, PMT() bug #44691</action>
<action dev="POI-DEVELOPERS" type="add">30311 - More work on Conditional Formatting</action> <action dev="POI-DEVELOPERS" type="add">30311 - More work on Conditional Formatting</action>
<action dev="POI-DEVELOPERS" type="add">Move the Formula Evaluator code out of scratchpad</action> <action dev="POI-DEVELOPERS" type="add">Move the Formula Evaluator code out of scratchpad</action>
<action dev="POI-DEVELOPERS" type="add">Move the missing record aware eventusermodel code out of scratchpad</action> <action dev="POI-DEVELOPERS" type="add">Move the missing record aware eventusermodel code out of scratchpad</action>

View File

@ -34,6 +34,7 @@
<!-- Don't forget to update changes.xml too! --> <!-- Don't forget to update changes.xml too! -->
<changes> <changes>
<release version="3.0.3-beta1" date="2008-04-??"> <release version="3.0.3-beta1" date="2008-04-??">
<action dev="POI-DEVELOPERS" type="add">Various fixes: Recognising var-arg built-in functions #44675, ExternalNameRecord serialisation bug #44695, PMT() bug #44691</action>
<action dev="POI-DEVELOPERS" type="add">30311 - More work on Conditional Formatting</action> <action dev="POI-DEVELOPERS" type="add">30311 - More work on Conditional Formatting</action>
<action dev="POI-DEVELOPERS" type="add">Move the Formula Evaluator code out of scratchpad</action> <action dev="POI-DEVELOPERS" type="add">Move the Formula Evaluator code out of scratchpad</action>
<action dev="POI-DEVELOPERS" type="add">Move the missing record aware eventusermodel code out of scratchpad</action> <action dev="POI-DEVELOPERS" type="add">Move the missing record aware eventusermodel code out of scratchpad</action>

View File

@ -28,8 +28,6 @@ import org.apache.poi.hssf.record.formula.*;
import org.apache.poi.hssf.record.formula.function.FunctionMetadata; import org.apache.poi.hssf.record.formula.function.FunctionMetadata;
import org.apache.poi.hssf.record.formula.function.FunctionMetadataRegistry; import org.apache.poi.hssf.record.formula.function.FunctionMetadataRegistry;
/** /**
* This class parses a formula string into a List of tokens in RPN order. * This class parses a formula string into a List of tokens in RPN order.
* Inspired by * Inspired by

View File

@ -15,7 +15,6 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
package org.apache.poi.hssf.record.formula; package org.apache.poi.hssf.record.formula;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
import org.apache.poi.hssf.record.RecordInputStream; import org.apache.poi.hssf.record.RecordInputStream;

View File

@ -17,6 +17,7 @@
package org.apache.poi.hssf.record.formula.function; package org.apache.poi.hssf.record.formula.function;
/** /**
* Holds information about Excel built-in functions.
* *
* @author Josh Micich * @author Josh Micich
*/ */

View File

@ -19,7 +19,11 @@ package org.apache.poi.hssf.record.formula.function;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
/**
* Allows clients to get <tt>FunctionMetadata</tt> instances for any built-in function of Excel.
*
* @author Josh Micich
*/
public final class FunctionMetadataRegistry { public final class FunctionMetadataRegistry {
/** /**
* The name of the IF function (i.e. "IF"). Extracted as a constant for clarity. * The name of the IF function (i.e. "IF"). Extracted as a constant for clarity.
@ -35,7 +39,6 @@ public final class FunctionMetadataRegistry {
private static FunctionMetadataRegistry getInstance() { private static FunctionMetadataRegistry getInstance() {
if (_instance == null) { if (_instance == null) {
_instance = FunctionMetadataReader.createRegistry(); _instance = FunctionMetadataReader.createRegistry();
// _instance = POIFunctionMetadataCreator.createInstance();
} }
return _instance; return _instance;
} }

View File

@ -67,10 +67,10 @@ public final class Pmt extends FinanceFunction {
} }
double d = FinanceLib.pmt(rate, nper, pv, fv, arePaymentsAtPeriodBeginning); double d = FinanceLib.pmt(rate, nper, pv, fv, arePaymentsAtPeriodBeginning);
if (Double.isNaN(d)) { if (Double.isNaN(d)) {
return (ValueEval) ErrorEval.VALUE_INVALID; return ErrorEval.VALUE_INVALID;
} }
if (Double.isInfinite(d)) { if (Double.isInfinite(d)) {
return (ValueEval) ErrorEval.NUM_ERROR; return ErrorEval.NUM_ERROR;
} }
return new NumberEval(d); return new NumberEval(d);
} catch (EvaluationException e) { } catch (EvaluationException e) {

View File

@ -19,6 +19,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.hssf.record.aggregates.AllRecordAggregateTests; import org.apache.poi.hssf.record.aggregates.AllRecordAggregateTests;
import org.apache.poi.hssf.record.formula.AllFormulaTests; import org.apache.poi.hssf.record.formula.AllFormulaTests;
import org.apache.poi.hssf.record.formula.functions.AllIndividualFunctionEvaluationTests;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;

View File

@ -17,13 +17,15 @@
package org.apache.poi.hssf.record.formula; package org.apache.poi.hssf.record.formula;
import org.apache.poi.hssf.record.formula.eval.AllFormulaEvalTests;
import org.apache.poi.hssf.record.formula.function.AllFormulaFunctionTests; import org.apache.poi.hssf.record.formula.function.AllFormulaFunctionTests;
import org.apache.poi.hssf.record.formula.functions.AllIndividualFunctionEvaluationTests;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;
/** /**
* Collects all tests for this package. * Collects all tests for <tt>org.apache.poi.hssf.record.formula</tt>.
* *
* @author Josh Micich * @author Josh Micich
*/ */
@ -31,6 +33,10 @@ public class AllFormulaTests {
public static Test suite() { public static Test suite() {
TestSuite result = new TestSuite(AllFormulaTests.class.getName()); TestSuite result = new TestSuite(AllFormulaTests.class.getName());
result.addTest(AllFormulaEvalTests.suite());
result.addTest(AllFormulaFunctionTests.suite());
result.addTest(AllIndividualFunctionEvaluationTests.suite());
result.addTestSuite(TestArea3DPtg.class); result.addTestSuite(TestArea3DPtg.class);
result.addTestSuite(TestAreaErrPtg.class); result.addTestSuite(TestAreaErrPtg.class);
result.addTestSuite(TestAreaPtg.class); result.addTestSuite(TestAreaPtg.class);

View File

@ -21,7 +21,7 @@ import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;
/** /**
* Collects all tests for this package. * Collects all tests for this <tt>org.apache.poi.hssf.record.formula.function</tt>.
* *
* @author Josh Micich * @author Josh Micich
*/ */

View File

@ -56,7 +56,7 @@ import org.xml.sax.helpers.XMLReaderFactory;
* *
* @author Josh Micich * @author Josh Micich
*/ */
public class ExcelFileFormatDocFunctionExtractor { public final class ExcelFileFormatDocFunctionExtractor {
private static final String SOURCE_DOC_FILE_NAME = "excelfileformat.odt"; private static final String SOURCE_DOC_FILE_NAME = "excelfileformat.odt";
@ -453,8 +453,8 @@ public class ExcelFileFormatDocFunctionExtractor {
} }
private static File getSourceFile() { private static File getSourceFile() {
if (true) { if (false) {
File dir = new File("c:/josh/ref-docs"); File dir = new File("c:/temp");
File effDocFile = new File(dir, SOURCE_DOC_FILE_NAME); File effDocFile = new File(dir, SOURCE_DOC_FILE_NAME);
return effDocFile; return effDocFile;
} }
@ -499,5 +499,4 @@ public class ExcelFileFormatDocFunctionExtractor {
File outFile = new File("functionMetadata-asGenerated.txt"); File outFile = new File("functionMetadata-asGenerated.txt");
processFile(effDocFile, outFile); processFile(effDocFile, outFile);
} }
} }

View File

@ -18,6 +18,7 @@
package org.apache.poi.hssf.record.formula.function; package org.apache.poi.hssf.record.formula.function;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* *
* @author Josh Micich * @author Josh Micich

View File

@ -27,9 +27,8 @@ import junit.framework.TestSuite;
*/ */
public final class AllIndividualFunctionEvaluationTests { public final class AllIndividualFunctionEvaluationTests {
// TODO - have this suite incorporated into a higher level one
public static Test suite() { public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.hssf.record.formula.functions"); TestSuite result = new TestSuite(AllIndividualFunctionEvaluationTests.class.getName());
result.addTestSuite(TestAverage.class); result.addTestSuite(TestAverage.class);
result.addTestSuite(TestCountFuncs.class); result.addTestSuite(TestCountFuncs.class);
result.addTestSuite(TestDate.class); result.addTestSuite(TestDate.class);