Browse Source

Use the same "is this a formula" logic for both getCellType and getCachedFormulaResultType

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1693767 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_13_FINAL
Nick Burch 9 years ago
parent
commit
b0fa6ed2f3
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java

+ 9
- 5
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java View File

_cell.setS(idx); _cell.setS(idx);
} }
} }
private boolean isFormulaCell() {
if (_cell.getF() != null || getSheet().isCellInArrayFormulaContext(this)) {
return true;
}
return false;
}


/** /**
* Return the cell type. * Return the cell type.
*/ */
@Override @Override
public int getCellType() { public int getCellType() {

if (_cell.getF() != null || getSheet().isCellInArrayFormulaContext(this)) {
return CELL_TYPE_FORMULA;
}
if (isFormulaCell()) return CELL_TYPE_FORMULA;


return getBaseCellType(true); return getBaseCellType(true);
} }
*/ */
@Override @Override
public int getCachedFormulaResultType() { public int getCachedFormulaResultType() {
if (_cell.getF() == null) {
if (! isFormulaCell()) {
throw new IllegalStateException("Only formula cells have cached results"); throw new IllegalStateException("Only formula cells have cached results");
} }



Loading…
Cancel
Save