Skip to content

Commit

Permalink
fix(formula): array cache error (#1644)
Browse files Browse the repository at this point in the history
* fix(formula): array cache error

* fix(sheet): type error
  • Loading branch information
DR-Univer authored Mar 20, 2024
1 parent 2244791 commit 19d9612
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export class ArrayValueObject extends BaseValueObject {

for (let r = startRow; r <= endRow; r++) {
for (let c = startColumn; c <= endColumn; c++) {
if (callback(valueList[r][c], r, c) === false) {
if (callback(valueList[r]?.[c], r, c) === false) {
return;
}
}
Expand Down Expand Up @@ -1366,9 +1366,6 @@ export class ArrayValueObject extends BaseValueObject {
}

const result: BaseValueObject[][] = [];
for (let r = 0; r < rowCount; r++) {
result[r] = [];
}

for (let c = 0; c < columnCount; c++) {
const value = valueList[c];
Expand Down Expand Up @@ -1417,7 +1414,11 @@ export class ArrayValueObject extends BaseValueObject {

if (rowPositions != null) {
rowPositions.forEach((row) => {
result[row][column] = BooleanValueObject.create(true);
const r = row - startRow;
if (result[r] == null) {
result[r] = [];
}
result[r][column] = BooleanValueObject.create(true);
});
// for (let r = 0; r < rowCount; r++) {
// if (rowPositions.has(r + startRow)) {
Expand Down
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 19d9612

Please sign in to comment.