diff options
author | Josh Micich <josh@apache.org> | 2008-10-30 21:55:50 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2008-10-30 21:55:50 +0000 |
commit | 2b9938194aeb72c5ec3e4f0c98488f99b713a39a (patch) | |
tree | f99f424c0305f75f3c6c71504cf54f8fb705c5f5 /src/java/org/apache/poi/ss | |
parent | f6db815fbb59f15f9eb21ee5f7edcb7219858fd8 (diff) | |
download | poi-2b9938194aeb72c5ec3e4f0c98488f99b713a39a.tar.gz poi-2b9938194aeb72c5ec3e4f0c98488f99b713a39a.zip |
Fixed compilation error introduced in r708982
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@709260 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/ss')
-rwxr-xr-x | src/java/org/apache/poi/ss/usermodel/DataFormatter.java | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java index a8f01ca720..2d621eea1b 100755 --- a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java +++ b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java @@ -63,7 +63,7 @@ import java.text.*; * @author James May (james dot may at fmr dot com)
*
*/
-public class DataFormatter {
+public final class DataFormatter {
/** Pattern to find a number format: "0" or "#" */
private static final Pattern numPattern = Pattern.compile("[0#]+");
@@ -469,28 +469,20 @@ public class DataFormatter { * @param evaluator The FormulaEvaluator (can be null)
* @return a string value of the cell
*/
- public String formatCellValue(Cell cell,
- FormulaEvaluator evaluator) throws IllegalArgumentException {
+ public String formatCellValue(Cell cell, FormulaEvaluator evaluator) {
if (cell == null) {
return "";
}
int cellType = cell.getCellType();
- if (evaluator != null && cellType == Cell.CELL_TYPE_FORMULA) {
- try {
- cellType = evaluator.evaluateFormulaCell(cell);
- } catch (RuntimeException e) {
- throw new RuntimeException("Did you forget to set the current" +
- " row on the FormulaEvaluator?", e);
+ if (cellType == Cell.CELL_TYPE_FORMULA) {
+ if (evaluator == null) {
+ return cell.getCellFormula();
}
+ cellType = evaluator.evaluateFormulaCell(cell);
}
- switch (cellType)
- {
- case Cell.CELL_TYPE_FORMULA :
- // should only occur if evaluator is null
- return cell.getCellFormula();
-
+ switch (cellType) {
case Cell.CELL_TYPE_NUMERIC :
if (DateUtil.isCellDateFormatted(cell)) {
|