Return-Path:
Delivered-To: apmail-poi-commits-archive@locus.apache.org
Received: (qmail 17545 invoked from network); 24 Jan 2008 14:13:38 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2)
by minotaur.apache.org with SMTP; 24 Jan 2008 14:13:38 -0000
Received: (qmail 23375 invoked by uid 500); 24 Jan 2008 14:13:28 -0000
Delivered-To: apmail-poi-commits-archive@poi.apache.org
Received: (qmail 23335 invoked by uid 500); 24 Jan 2008 14:13:28 -0000
Mailing-List: contact commits-help@poi.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: dev@poi.apache.org
Delivered-To: mailing list commits@poi.apache.org
Received: (qmail 23326 invoked by uid 99); 24 Jan 2008 14:13:28 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jan 2008 06:13:28 -0800
X-ASF-Spam-Status: No, hits=-100.0 required=10.0
tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jan 2008 14:13:10 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
id AAD0F1A9832; Thu, 24 Jan 2008 06:13:16 -0800 (PST)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r614878 - in /poi/trunk/src: documentation/content/xdocs/
documentation/content/xdocs/hssf/ java/org/apache/poi/hssf/usermodel/
scratchpad/src/org/apache/poi/hssf/usermodel/
scratchpad/testcases/org/apache/poi/hssf/usermodel/
Date: Thu, 24 Jan 2008 14:13:12 -0000
To: commits@poi.apache.org
From: nick@apache.org
X-Mailer: svnmailer-1.0.8
Message-Id: <20080124141316.AAD0F1A9832@eris.apache.org>
X-Virus-Checked: Checked by ClamAV on apache.org
Author: nick
Date: Thu Jan 24 06:13:05 2008
New Revision: 614878
URL: http://svn.apache.org/viewvc?rev=614878&view=rev
Log:
Add another formula evaluation method, evaluateFormulaCell(cell), which will re-calculate the value for a formula, without affecting the formula itself. Add tests too, and update the documentation
Added:
poi/trunk/src/scratchpad/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorDocs.java (with props)
Modified:
poi/trunk/src/documentation/content/xdocs/changes.xml
poi/trunk/src/documentation/content/xdocs/hssf/eval.xml
poi/trunk/src/documentation/content/xdocs/status.xml
poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
poi/trunk/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java
Modified: poi/trunk/src/documentation/content/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/changes.xml?rev=614878&r1=614877&r2=614878&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/changes.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/changes.xml Thu Jan 24 06:13:05 2008
@@ -36,6 +36,7 @@
+ Add another formula evaluation method, evaluateFormulaCell(cell), which will re-calculate the value for a formula, without affecting the formula itself.41726 - Fix how we handle signed cell offsets in relative areas and references44233 - Support for getting and setting a flag on the sheet, which tells excel to re-calculate all formulas on it at next reload44201 - Enable cloning of sheets with data validation rules
Modified: poi/trunk/src/documentation/content/xdocs/hssf/eval.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/hssf/eval.xml?rev=614878&r1=614877&r2=614878&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/hssf/eval.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/hssf/eval.xml Thu Jan 24 06:13:05 2008
@@ -55,10 +55,12 @@
The following code demonstrates how to use the HSSFFormulaEvaluator
in the context of other POI excel reading code.
-
There are two ways in which you can use the HSSFFormulaEvalutator API.
+
There are several ways in which you can use the HSSFFormulaEvalutator API.
Using HSSFFormulaEvaluator.evaluate(HSSFCell cell)
+
This evaluates a given cell, and returns the new value,
+ without affecting the cell
+
+ Using HSSFFormulaEvaluator.evaluateFormulaCell(HSSFCell cell)
+
evaluateFormulaCell(HSSFCell cell)
+ will check to see if the supplied cell is a formula cell.
+ If it isn't, then no changes will be made to it. If it is,
+ then the formula is evaluated. The value for the formula
+ is saved alongside it, to be displayed in excel. The
+ formula remains in the cell, just with a new value
+
The return of the function is the type of the
+ formula result, such as HSSFCell.CELL_TYPE_BOOLEAN
+
+
+
Using HSSFFormulaEvaluator.evaluateInCell(HSSFCell cell)
evaluateInCell(HSSFCell cell) will check to
see if the supplied cell is a formula cell. If it isn't,
then no changes will be made to it. If it is, then the
- formula is evaluated, and the new value saved into the cell.
+ formula is evaluated, and the new value saved into the cell,
+ in place of the old formula.