From 312b7ff2dc5a00aeee644edc97cad09a23982e06 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Mon, 17 Sep 2007 16:29:07 +0000 Subject: [PATCH] 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 --- .../org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java | 3 +++ 1 file changed, 3 insertions(+) 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 349c3fbb6..3ca3fdb66 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: