]> source.dussan.org Git - poi.git/commitdiff
[bug-65492] XSSFExportToXml does not handle formula type cells with boolean values
authorPJ Fanning <fanningpj@apache.org>
Mon, 9 Aug 2021 23:37:13 +0000 (23:37 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 9 Aug 2021 23:37:13 +0000 (23:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892146 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java

index c6afb6655881af879058b3e126b7c24dc2715234..f893c8b61a45f1534b254763043bab6d39a1a8cf 100644 (file)
@@ -277,7 +277,11 @@ public class XSSFExportToXml implements Comparator<String>{
         case FORMULA:
            if (cell.getCachedFormulaResultType() == CellType.STRING) {
                value = cell.getStringCellValue();
-           } else {
+           } else if (cell.getCachedFormulaResultType() == CellType.BOOLEAN) {
+               value += cell.getBooleanCellValue();
+           } else if (cell.getCachedFormulaResultType() == CellType.ERROR) {
+               value = cell.getErrorCellString();
+           } else if (cell.getCachedFormulaResultType() == CellType.NUMERIC) {
                if (DateUtil.isCellDateFormatted(cell)) {
                   value = getFormattedDate(cell);
                } else {