Ensure that evaluateInCell sets the underlying cell type properly (fix from Pavel Krupets)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@576504 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2007-09-17 16:29:07 +00:00
parent c4ca492849
commit 312b7ff2dc
1 changed files with 3 additions and 0 deletions

View File

@ -223,9 +223,11 @@ public class HSSFFormulaEvaluator {
CellValue cv = getCellValueForEval(internalEvaluate(cell, row, sheet, workbook));
switch (cv.getCellType()) {
case HSSFCell.CELL_TYPE_BOOLEAN:
cell.setCellType(HSSFCell.CELL_TYPE_BOOLEAN);
cell.setCellValue(cv.getBooleanValue());
break;
case HSSFCell.CELL_TYPE_ERROR:
cell.setCellType(HSSFCell.CELL_TYPE_ERROR);
cell.setCellValue(cv.getErrorValue());
break;
case HSSFCell.CELL_TYPE_NUMERIC:
@ -233,6 +235,7 @@ public class HSSFFormulaEvaluator {
cell.setCellValue(cv.getNumberValue());
break;
case HSSFCell.CELL_TYPE_STRING:
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setCellValue(cv.getRichTextStringValue());
break;
case HSSFCell.CELL_TYPE_BLANK: