diff --git a/cell/model/Workbook.js b/cell/model/Workbook.js index e76722a59b..605da9a64e 100644 --- a/cell/model/Workbook.js +++ b/cell/model/Workbook.js @@ -14007,15 +14007,13 @@ } if (!userId) { let oApi = Asc.editor; - userId = oApi.DocInfo && oApi.DocInfo.get_UserId(); + userId = oApi && oApi.DocInfo && oApi.DocInfo.get_UserId(); } - oCell = {col: oCell.nCol, row: oCell.nRow}; - if (this.userProtectedRanges && userId) { for (let i = 0; i < this.userProtectedRanges.length; i++) { let curUserProtectedRange = this.userProtectedRanges[i]; - if (curUserProtectedRange.contains2(oCell) && (notCheckUser || !curUserProtectedRange.isUserCanDoByType(userId, type))) { + if (curUserProtectedRange.contains(oCell.nCol, oCell.nRow) && (notCheckUser || !curUserProtectedRange.isUserCanDoByType(userId, type))) { return true; } } @@ -18288,6 +18286,9 @@ } } this._foreach(function(cell){ + if (cell.ws.isUserProtectedRangesIntersectionCell(cell)) { + return; + } var _val = val; if (_formula) { _formula.isParsed = false; diff --git a/cell/model/protectRange.js b/cell/model/protectRange.js index 6ea1f6a3b5..41c918b897 100644 --- a/cell/model/protectRange.js +++ b/cell/model/protectRange.js @@ -206,6 +206,9 @@ CUserProtectedRange.prototype.contains2 = function (oCell) { return this.ref && this.ref.contains2(oCell); }; + CUserProtectedRange.prototype.contains = function (c, r) { + return this.ref && this.ref.contains(c, r); + }; CUserProtectedRange.prototype.isUserCanDoByType = function (userId, type) { let res = false;