Hello @devs Here's the case I've been talking about. The Cell interface if designed so that it gives an impression that FORMULA is a "value" type, although IMHO it shouldn't be. A cell is either BLANK, or a BOOLEAN/NUMERIC/STRING/ERROR, possibly with a FORMULA. Setting a cached value may be useful for copying cells and, even more important, for circular references which I intend to implement.
There may be a reasonable objection that Excel doesn't allow to enter a cached value for a formula (so why should POI?). However, in Excel stale formula results are possible: in manual recalculation mode, or in presence of external references, or when iterative evaluation is switched off. Either we stick to the "formula is a value type", or I update javadoc for setters to clarify that setting a value (except BLANK) does not affeect the formula. Please comment. On 2019/04/11 02:59:27, bugzi...@apache.org wrote: > https://bz.apache.org/bugzilla/show_bug.cgi?id=63339 > > Bug ID: 63339 > Summary: Setting cached formula result corrupts workbook > Product: POI > Version: unspecified > Hardware: PC > Status: NEW > Severity: regression > Priority: P2 > Component: XSSF > Assignee: dev@poi.apache.org > Reporter: cowwoc2...@gmail.com > Target Milestone: --- > > Version 4.1.0 > > Bug #46885 is back. If one invokes setCellValue(String) on a cell of type > FORMULA, the new value will be ignored. One can workaround this issue by > explicitly changing the cell type prior to changing its value. > > XSSFCell.setCellValueImpl() invokes _cell.setT(STCellType.STR) but > _cell.isSetF() remains true. > > Expected behavior: _cell.isSetF() should return false after changing the cell > value from a FORMULA to String. > > -- > You are receiving this mail because: > You are the assignee for the bug. > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org > For additional commands, e-mail: dev-h...@poi.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org