@univerjs/sheets-formula v0.5.4
Class: UpdateFormulaController
Defined in: submodules/univer/packages/sheets-formula/src/controllers/update-formula.controller.ts:87
Update formula process
-
Command intercepts, converts the command information to adapt refRange, offsets the formula content, and obtains the formula that requires offset content.
-
Use refRange to offset the formula position and return undo/redo data to setRangeValues mutation
- Redo data: Delete the old value at the old position on the match, and add the new value at the new position (the new value first checks whether the old position has offset content, if so, use the new offset content, if not, take the old value)
- Undo data: the old position on the match saves the old value, and the new position delete value. Using undos when undoing will operate the data after the offset position.
-
onCommandExecuted, before formula calculation, use the setRangeValues information to delete the old formulaData, ArrayFormula and ArrayFormulaCellData, and send the worker (complementary setRangeValues after collaborative conflicts, normal operation triggers formula update, undo/redo are captured and processed here)
Extends
Constructors
new UpdateFormulaController()
new UpdateFormulaController(
_univerInstanceService,
_commandService,
_lexerTreeBuilder,
_formulaDataModel,
_sheetInterceptorService,
_definedNamesService,
_configService,
_injector): UpdateFormulaController
Defined in: submodules/univer/packages/sheets-formula/src/controllers/update-formula.controller.ts:88
Parameters
Parameter | Type |
---|---|
_univerInstanceService | IUniverInstanceService |
_commandService | ICommandService |
_lexerTreeBuilder | LexerTreeBuilder |
_formulaDataModel | FormulaDataModel |
_sheetInterceptorService | SheetInterceptorService |
_definedNamesService | IDefinedNamesService |
_configService | IConfigService |
_injector | Injector |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_injector | readonly | Injector | undefined | - | submodules/univer/packages/sheets-formula/src/controllers/update-formula.controller.ts:96 |
Methods
dispose()
dispose(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109
Returns
void
Inherited from
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void