Commit 5027a97a authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix check for delete rows|columns with pivot table

parent 239ba42a
...@@ -10473,8 +10473,7 @@ ...@@ -10473,8 +10473,7 @@
} }
lockRange = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); lockRange = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
count = arn.c2 - arn.c1 + 1; count = arn.c2 - arn.c1 + 1;
if (this.model.checkShiftPivotTable(lockRange, if (this.model.checkShiftPivotTable(lockRange, new AscCommonExcel.CRangeOffset(count, 0))) {
new AscCommonExcel.CRangeOffset(count, 0))) {
this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot, this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot,
c_oAscError.Level.NoCritical); c_oAscError.Level.NoCritical);
return; return;
...@@ -10498,8 +10497,7 @@ ...@@ -10498,8 +10497,7 @@
case c_oAscInsertOptions.InsertRows: case c_oAscInsertOptions.InsertRows:
lockRange = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2); lockRange = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2);
count = arn.r2 - arn.r1 + 1; count = arn.r2 - arn.r1 + 1;
if (this.model.checkShiftPivotTable(lockRange, if (this.model.checkShiftPivotTable(lockRange, new AscCommonExcel.CRangeOffset(0, count))) {
new AscCommonExcel.CRangeOffset(0, count))) {
this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot, this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot,
c_oAscError.Level.NoCritical); c_oAscError.Level.NoCritical);
return; return;
...@@ -10593,6 +10591,13 @@ ...@@ -10593,6 +10591,13 @@
if (isCheckChangeAutoFilter === false) { if (isCheckChangeAutoFilter === false) {
return; return;
} }
lockRange = new asc_Range(checkRange.c1, 0, checkRange.c2, gc_nMaxRow0);
count = checkRange.c2 - checkRange.c1 + 1;
if (this.model.checkShiftPivotTable(lockRange, new AscCommonExcel.CRangeOffset(-count, 0))) {
this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot,
c_oAscError.Level.NoCritical);
return;
}
functionModelAction = function () { functionModelAction = function () {
oRecalcType = AscCommonExcel.recalcType.full; oRecalcType = AscCommonExcel.recalcType.full;
...@@ -10606,12 +10611,7 @@ ...@@ -10606,12 +10611,7 @@
History.EndTransaction(); History.EndTransaction();
}; };
arrChangedRanges.push(lockRange = new asc_Range(checkRange.c1, 0, checkRange.c2, gc_nMaxRow0)); arrChangedRanges.push(lockRange);
if (this.model.inPivotTable(lockRange)) {
this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot,
c_oAscError.Level.NoCritical);
return;
}
this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.DeleteColumns, this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.DeleteColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break; break;
...@@ -10622,6 +10622,13 @@ ...@@ -10622,6 +10622,13 @@
if (isCheckChangeAutoFilter === false) { if (isCheckChangeAutoFilter === false) {
return; return;
} }
lockRange = new asc_Range(0, checkRange.r1, gc_nMaxCol0, checkRange.r2);
count = checkRange.r2 - checkRange.r1 + 1;
if (this.model.checkShiftPivotTable(lockRange, new AscCommonExcel.CRangeOffset(0, -count))) {
this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot,
c_oAscError.Level.NoCritical);
return;
}
functionModelAction = function () { functionModelAction = function () {
oRecalcType = AscCommonExcel.recalcType.full; oRecalcType = AscCommonExcel.recalcType.full;
...@@ -10636,12 +10643,7 @@ ...@@ -10636,12 +10643,7 @@
History.EndTransaction(); History.EndTransaction();
}; };
arrChangedRanges.push(lockRange = new asc_Range(0, checkRange.r1, gc_nMaxCol0, checkRange.r2)); arrChangedRanges.push(lockRange);
if (this.model.inPivotTable(lockRange)) {
this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot,
c_oAscError.Level.NoCritical);
return;
}
this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.DeleteRows, onChangeWorksheetCallback); this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.DeleteRows, onChangeWorksheetCallback);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment