From 50af1f9ad4d4d9732e60f0d0d1ae92c6d20d2adc Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 20 Mar 2008 10:06:59 +0000 Subject: [PATCH] Test relating to bug #44636 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@639231 13f79535-47bb-0310-9956-ffa450edef68 --- .../hssf/usermodel/HSSFFormulaEvaluator.java | 30 ++++++ .../usermodel/TestFormulaEvaluatorBugs.java | 88 ++++++++++++++++++ .../org/apache/poi/hssf/data/44636.xls | Bin 0 -> 13824 bytes 3 files changed, 118 insertions(+) create mode 100644 src/scratchpad/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java create mode 100644 src/testcases/org/apache/poi/hssf/data/44636.xls diff --git a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java index 58ab5b47ae..bb16fdfadd 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java +++ b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java @@ -19,6 +19,7 @@ package org.apache.poi.hssf.usermodel; import java.lang.reflect.Constructor; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import java.util.Stack; @@ -251,6 +252,35 @@ public class HSSFFormulaEvaluator { } return cell; } + + /** + * Loops over all cells in all sheets of the supplied + * workbook. + * For cells that contain formulas, their formulas are + * evaluated, and the results are saved. These cells + * remain as formula cells. + * For cells that do not contain formulas, no changes + * are made. + * This is a helpful wrapper around looping over all + * cells, and calling evaluateFormulaCell on each one. + */ + public static void evaluateAllFormulaCells(HSSFWorkbook wb) { + for(int i=0; ihq5fwwCs0r``$ddR2jl@?75&sn9KY#d$L`k6Qch240?vqp#jE|YknYnZ3 z%sFSinS1AP?|$)l?eNhLW?VyFSPm~n(&Z@2;#<6)?&gDFc{(jwH=V|7vP}3FAy6J* zN0#|fZC{%3Ns5AS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