summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Woolsey <gwoolsey@apache.org>2017-06-10 01:04:40 +0000
committerGreg Woolsey <gwoolsey@apache.org>2017-06-10 01:04:40 +0000
commit756f8b73735520f1ed65e431a5d8675fa710963e (patch)
treeb0fab97c93c156f93313acd8d82dd48a1b4eae0c
parent048ae39b1b10eae6e2a96e4871932936504fe2bd (diff)
downloadpoi-756f8b73735520f1ed65e431a5d8675fa710963e.tar.gz
poi-756f8b73735520f1ed65e431a5d8675fa710963e.zip
Don't report data table master cells as formula cells, since POI doesn't evaluate data table formulas.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798289 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
index a39fd47bf3..7afb3896f3 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
@@ -655,8 +655,18 @@ public final class XSSFCell implements Cell {
}
}
+ /**
+ * POI currently supports these formula types:
+ * <ul>
+ * <li> {@link STCellFormulaType#NORMAL}
+ * <li> {@link STCellFormulaType#SHARED}
+ * <li> {@link STCellFormulaType#ARRAY}
+ * </ul>
+ * POI does not support {@link STCellFormulaType#DATA_TABLE} formulas.
+ * @return true if the cell is of a formula type POI can handle
+ */
private boolean isFormulaCell() {
- if (_cell.getF() != null || getSheet().isCellInArrayFormulaContext(this)) {
+ if ( (_cell.isSetF() && _cell.getF().getT() != STCellFormulaType.DATA_TABLE ) || getSheet().isCellInArrayFormulaContext(this)) {
return true;
}
return false;
@@ -679,7 +689,12 @@ public final class XSSFCell implements Cell {
}
/**
- * Return the cell type.
+ * Return the cell type. Tables in an array formula return
+ * {@link CellType#FORMULA} for all cells, even though the formula is only defined
+ * in the OOXML file for the top left cell of the array.
+ * <p/>
+ * NOTE: POI does not support data table formulas.
+ * Cells in a data table appear to POI as plain cells typed from their cached value.
*
* @return the cell type
* @since POI 3.15 beta 3