Browse Source

Don't report data table master cells as formula cells, since POI doesn't evaluate data table formulas.

pull/1557/head
Antony Liu 3 months ago
parent
commit
ecaadec20f
  1. 21
      ooxml/XSSF/UserModel/XSSFCell.cs

21
ooxml/XSSF/UserModel/XSSFCell.cs

@ -759,12 +759,22 @@ namespace NPOI.XSSF.UserModel
} }
} }
} }
/// <summary>
/// POI currently supports these formula types:
/// <list type="bullet">
/// <item><description> <see cref="ST_CellFormulaType.normal" /></description></item>
/// <item><description> <see cref="ST_CellFormulaType.shared" /></description></item>
/// <item><description> <see cref="ST_CellFormulaType.array" /></description></item>
/// </list>
/// POI does not support <see cref="ST_CellFormulaType.dataTable" /> formulas.
/// </summary>
/// <return>true if the cell is of a formula type POI can handle
/// </return>
private bool IsFormulaCell private bool IsFormulaCell
{ {
get get
{ {
if (_cell.f != null || ((XSSFSheet)Sheet).IsCellInArrayFormulaContext(this))
if ((_cell.f != null && _cell.f.t != ST_CellFormulaType.dataTable) || ((XSSFSheet)Sheet).IsCellInArrayFormulaContext(this))
{ {
return true; return true;
} }
@ -773,7 +783,12 @@ namespace NPOI.XSSF.UserModel
} }
/// <summary> /// <summary>
/// Return the cell type.
/// Return the cell type. Tables in an array formula return
/// <see cref="CellType.FORMULA" /> for all cells, even though the formula is only defined
/// in the OOXML file for the top left cell of the array.
/// <para>
/// NOTE: POI does not support data table formulas.
/// Cells in a data table appear to POI as plain cells typed from their cached value.</para>
/// </summary> /// </summary>
public CellType CellType public CellType CellType
{ {

Loading…
Cancel
Save