Skip to content

Commit 54a0dc6

Browse files
authored
Merge pull request #98 from whicken/master
Implement getCachedFormulaResultTypeEnum. Some comments are now out o…
2 parents fbd174e + 71aadce commit 54a0dc6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/main/java/com/monitorjbl/xlsx/impl/StreamingCell.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -282,19 +282,27 @@ public String getCellFormula() {
282282
*/
283283
@Override
284284
public int getCachedFormulaResultType() {
285+
return getCachedFormulaResultTypeEnum().getCode();
286+
}
287+
288+
/**
289+
* Not supported
290+
*/
291+
@Override
292+
public CellType getCachedFormulaResultTypeEnum() {
285293
if (type != null && "str".equals(type)) {
286294
if(contents == null || cachedFormulaResultType == null) {
287-
return CELL_TYPE_BLANK;
295+
return CellType.BLANK;
288296
} else if("n".equals(cachedFormulaResultType)) {
289-
return CELL_TYPE_NUMERIC;
297+
return CellType.NUMERIC;
290298
} else if("s".equals(cachedFormulaResultType) || "inlineStr".equals(cachedFormulaResultType)) {
291-
return CELL_TYPE_STRING;
299+
return CellType.STRING;
292300
} else if("str".equals(cachedFormulaResultType)) {
293-
return CELL_TYPE_FORMULA;
301+
return CellType.FORMULA;
294302
} else if("b".equals(cachedFormulaResultType)) {
295-
return CELL_TYPE_BOOLEAN;
303+
return CellType.BOOLEAN;
296304
} else if("e".equals(cachedFormulaResultType)) {
297-
return CELL_TYPE_ERROR;
305+
return CellType.ERROR;
298306
} else {
299307
throw new UnsupportedOperationException("Unsupported cell type '" + cachedFormulaResultType + "'");
300308
}
@@ -304,14 +312,6 @@ public int getCachedFormulaResultType() {
304312
}
305313
}
306314

307-
/**
308-
* Not supported
309-
*/
310-
@Override
311-
public CellType getCachedFormulaResultTypeEnum() {
312-
throw new NotSupportedException();
313-
}
314-
315315
/* Not supported */
316316

317317
/**

0 commit comments

Comments
 (0)