Skip to content

Commit

Permalink
[se] Fix bug #73182
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimailim authored and GoshaZotov committed Feb 12, 2025
1 parent 2113d87 commit c796e0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cell/model/FormulaObjects/parserFormula.js
Original file line number Diff line number Diff line change
Expand Up @@ -6777,9 +6777,15 @@ function parserFormula( formula, parent, _ws ) {
let nOperandType = found_operand.type;
let oRange = null;

if (!oParentCell) {
return false;
}
if (!(oParentCell instanceof AscCommonExcel.CCellWithFormula)) {
return false;
}
if (oParentCell.nRow == null && oParentCell.nCol == null) {
return false;
}
if (nOperandType === cElementType.name || nOperandType === cElementType.name3D) {
found_operand = found_operand.getValue();
nOperandType = found_operand.type;
Expand Down Expand Up @@ -6818,6 +6824,9 @@ function parserFormula( formula, parent, _ws ) {
const oRange = oCriteriaRange.getRange();
const oBbox = oRange.bbox;
const oParentCell = this.getParent();
if (!oParentCell || (oParentCell && oParentCell.nRow == null && oParentCell.nCol == null)) {
return false;
}
let bHasFormula = false;
let bVertical = oBbox.c1 === oBbox.c2;
let nRow = bVertical ? oBbox.r1 + (oParentCell.nRow - oBbox.r1) : oBbox.r1;
Expand All @@ -6843,6 +6852,9 @@ function parserFormula( formula, parent, _ws ) {
*/
parserFormula.prototype._calculateMatch = function (oFormulaArgs) {
const oParentCell = this.getParent();
if (!oParentCell || (oParentCell && oParentCell.nRow == null && oParentCell.nCol == null)) {
return false;
}
const oCalcRange = oFormulaArgs.calcRange;
let oCriteriaRange = oFormulaArgs.criteriaRange;
let oCondition = oFormulaArgs.condition;
Expand Down Expand Up @@ -8579,7 +8591,7 @@ function parserFormula( formula, parent, _ws ) {
this.outStack.push(operand);
}
}
if (bConditionalFormula && t.getParent() instanceof AscCommonExcel.CCellWithFormula && !t.ca) {
if (bConditionalFormula && t.getParent() && t.getParent() instanceof AscCommonExcel.CCellWithFormula && !t.ca) {
t.ca = t.isRecursiveCondFormula(levelFuncMap[0].func.name);
t.outStack.forEach(function (oOperand) {
if (oOperand.type === cElementType.name || oOperand.type === cElementType.name3D) {
Expand Down
3 changes: 3 additions & 0 deletions cell/model/Workbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -15386,6 +15386,9 @@
function _foreachListeners(fAction, oCell, oListeners) {
for (let i in oListeners) {
let oListenerCell = oListeners[i].getParent();
if (!oListenerCell) {
continue;
}
let nListenerCellIndex = null;
if (oListenerCell instanceof DefName) {
if (!oListeners[i].ca) {
Expand Down

0 comments on commit c796e0a

Please sign in to comment.