poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwool...@apache.org
Subject svn commit: r1798289 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
Date Sat, 10 Jun 2017 01:04:41 GMT
Author: gwoolsey
Date: Sat Jun 10 01:04:40 2017
New Revision: 1798289

URL: http://svn.apache.org/viewvc?rev=1798289&view=rev
Log:
Don't report data table master cells as formula cells, since POI doesn't evaluate data table
formulas.

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=1798289&r1=1798288&r2=1798289&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java Sat Jun 10 01:04:40
2017
@@ -655,8 +655,18 @@ public final class XSSFCell implements C
         }
     }
     
+    /**
+     * 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 C
     }
 
     /**
-     * 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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message