Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formula helpers and named expressions with formulas (#167)
* Add initial version of calculateFormula() Issue: #24 * Add test which checks whether external formula is recomputed * Add possibility to change contents of external formula * Add possibility to normalize formula * Refactoring: Introduce ChangeList type * Add test ensuring that it works for more formulas * Refactoring: Split test suite into two * Add basic validation of external formulas * Add documentation * External formula is not valid if it has lexical errors * Literal error is ok (if that's what user want) * Extract NamedReferences module * Refactoring: Rename HyperFormula#calculateFormula -> HyperFormula#addNamedExpression * Add ability to retrieve value of named expression by it's name Temporarily changing named expression formula is forbidden, need to do new API for that which does not use -1 sheet internal. * Allow to add only one expression for given name * Add assertion ensuring that NamedExpression won't contain duplicates * Add basic validation of named expressions * Refactoring: Rename NamedExpressionAlreadyTaken -> NamedExpressionNameIsAlreadyTaken * Refactoring: Extract error classes out to separate file They still belongs to the responsibility of the HyperFormula unit, but majority of this code is just formatting the error. So I think it's cleaner when they are in separate file. * Refactoring: Remove unused return value * Refactoring: Rename ivar NamedExpressions#nextExternalFormulaId -> nextNamedExpressionRow * Make it possible to retrieve value of non existing named expression * Add API for removing named expressions * Refactoring: extract NamedExpressions#buildAddress method * Refactoring: Remove magic constant * SparseStrategy will not leak memory in the long run for named expressions * Allow again to change formulas in named expressions * Refactoring * Does not allow to change not existing named expression * Add possibility to list existing named expressions * Prerefactoring: Extract class NamedExpression * Remove unnecessary bang * Add assertion in NamedExpressions#changeNamedExpressionFormula * Make named expressions names to be case insensitive * Refactoring: Extract a NamedExpressionsStore * Refactoring: Extract method NamedExpressions#storeFormulaInCell * No longer workarounds for keeping sheet = -1 * Refactoring: Use ChangeList instead of CellValueChange[] Because in a moment I want to add different kind of element to ChangeList -- the one which will tell that named expression has changed. * lint-fix * Add documentation * Fixes after merge conflict * Resolving conflicts is so. much. fun. Co-authored-by: Jakub Kowalski <kowalski_jakub@hotmail.com>
- Loading branch information