From: Nick Burch Date: Mon, 17 Sep 2007 16:29:07 +0000 (+0000) Subject: Ensure that evaluateInCell sets the underlying cell type properly (fix from Pavel... X-Git-Tag: REL_3_0_2_BETA1~49 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eb97c149b84ea22266823081e79051934b5122b6;p=poi.git 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 --- 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 349c3fbb64..3ca3fdb667 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java +++ b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java @@ -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: