Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
weird94 committed Sep 19, 2024
1 parent 42ce257 commit 13105e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/shared/__tests__/range.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ describe('mergeRanges', () => {
endRow: 10,
},
{
startColumn: 6,
startColumn: 4,
startRow: 8,
endColumn: 7,
endRow: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export class DataValidationCopyPasteController extends Disposable {

if (copyInfo.unitId !== unitId || subUnitId !== copyInfo.subUnitId) {
const ruleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(copyInfo.unitId, copyInfo.subUnitId).clone();
const additionMatrix = new ObjectMatrix();
const addRules = new Set<string>();

const { ranges: [vCopyRange, vPastedRange], mapFunc } = virtualizeDiscreteRanges([copyInfo.copyRange, pastedRange]);

Expand All @@ -139,10 +141,14 @@ export class DataValidationCopyPasteController extends Disposable {
}

const { row: startRow, col: startColumn } = mapFunc(range.startRow, range.startColumn);
// ruleMatrix.setValue(startRow, startColumn, transformedRuleId);
addRules.add(transformedRuleId);
additionMatrix.setValue(startRow, startColumn, transformedRuleId);
});
});

const additions = Array.from(addRules).map((id) => ({ id, ranges: queryObjectMatrix(additionMatrix, (value) => value === id) }));
ruleMatrix.addRangeRules(additions);

const { redoMutations, undoMutations } = getDataValidationDiffMutations(
copyInfo.unitId,
copyInfo.subUnitId,
Expand Down

0 comments on commit 13105e0

Please sign in to comment.