Summary: | Versions greater than 5.1 damages structured references while setCellFormula | ||
---|---|---|---|
Product: | POI | Reporter: | Axel Richter <axel.richter.privat> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | regression | ||
Priority: | P2 | ||
Version: | 5.2.0-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Axel Richter
2022-04-28 05:56:35 UTC
I haven't validated this but the XSSFWorkbook has this method: ``` /** * Whether a call to {@link XSSFCell#setCellFormula(String)} will validate the formula or not. * * @param value true if the application will validate the formula is correct * @since 3.17 */ public void setCellFormulaValidation(final boolean value) { this.cellFormulaValidation = value; } ``` So in theory, the formula parser change logic will not kick if `setCellFormulaValidation(false)` is used. I added r1900375 - a test that shows that setCellFormulaValidation=false can help stopping the attempted reformatting of the formula. I think in a lot of cases, users don't want POI to reformat their formulas - but it will be hard to revert the changes because some users may rely on them. We may be able to change the code that kicks in when setCellFormulaValidation=true so that it correctly interprets this type of formula. |