mirror of
https://github.com/dream-num/univer.git
synced 2026-09-24 15:32:18 +08:00
fix(formula): fix formula update operation (#4026)
Co-authored-by: wpxp123456 <Wpxp1223456>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
import type { ICellData, IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
||||
import type { ISetRangeValuesMutationParams } from '@univerjs/sheets';
|
||||
import { cellToRange, Direction, isFormulaId, isFormulaString, ObjectMatrix, Rectangle } from '@univerjs/core';
|
||||
import { cellToRange, Direction, isFormulaId, isFormulaString, ObjectMatrix, Rectangle, Tools } from '@univerjs/core';
|
||||
import { deserializeRangeWithSheetWithCache, type IFormulaData, type IFormulaDataItem, type IRangeChange, type ISequenceNode, sequenceNodeType, serializeRangeToRefString } from '@univerjs/engine-formula';
|
||||
import { EffectRefRangId, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, runRefRangeMutations, SetRangeValuesMutation } from '@univerjs/sheets';
|
||||
import { checkFormulaDataNull } from './offset-formula-data';
|
||||
@@ -151,6 +151,14 @@ export function getFormulaReferenceRange(oldFormulaData: IFormulaData,
|
||||
const { sheetId: subUnitId, unitId } = formulaReferenceMoveParam;
|
||||
const { redoFormulaData, undoFormulaData } = refRangeFormula(oldFormulaData, newFormulaData, formulaReferenceMoveParam);
|
||||
|
||||
// If the formula data is the same, no operation is required
|
||||
if (Tools.diffValue(redoFormulaData, undoFormulaData)) {
|
||||
return {
|
||||
undos: [],
|
||||
redos: [],
|
||||
};
|
||||
}
|
||||
|
||||
const redos: IMutationInfo[] = [];
|
||||
const undos: IMutationInfo[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user