Commit e307044a authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 33464

parent 58f12a67
...@@ -9744,350 +9744,349 @@ ...@@ -9744,350 +9744,349 @@
return true; return true;
}; };
WorksheetView.prototype.changeWorksheet = function (prop, val) { WorksheetView.prototype.changeWorksheet = function (prop, val) {
// Проверка глобального лока // Проверка глобального лока
if (this.collaborativeEditing.getGlobalLock()) { if (this.collaborativeEditing.getGlobalLock()) {
return; return;
} }
var t = this;
var arn = this.model.selectionRange.getLast().clone();
var checkRange = arn.getAllRange();
var range;
var oRecalcType = AscCommonExcel.recalcType.recalc;
var reinitRanges = false;
var updateDrawingObjectsInfo = null;
var updateDrawingObjectsInfo2 = null;//{bInsert: false, operType: c_oAscInsertOptions.InsertColumns, updateRange: arn}
var isUpdateCols = false, isUpdateRows = false;
var isCheckChangeAutoFilter;
var functionModelAction = null;
var lockDraw = false; // Параметр, при котором не будет отрисовки (т.к. мы просто обновляем информацию на неактивном листе)
var oChangeData = new AscFormat.CChangeTableData(null, null, null, null); // Обновление для диаграмм
var onChangeWorksheetCallback = function (isSuccess) {
if (false === isSuccess) {
return;
}
asc_applyFunction(functionModelAction);
t._initCellsArea(oRecalcType);
if (oRecalcType) {
t.cache.reset();
}
t._cleanCellsTextMetricsCache();
t._prepareCellTextMetricsCache();
if (t.objectRender) {
if (reinitRanges && t.objectRender.drawingArea) {
t.objectRender.drawingArea.reinitRanges();
}
if (null !== updateDrawingObjectsInfo) {
t.objectRender.updateSizeDrawingObjects(updateDrawingObjectsInfo);
}
if (null !== updateDrawingObjectsInfo2) {
t.objectRender.updateDrawingObject(updateDrawingObjectsInfo2.bInsert,
updateDrawingObjectsInfo2.operType, updateDrawingObjectsInfo2.updateRange);
}
t.objectRender.rebuildChartGraphicObjects(oChangeData);
}
t.draw(lockDraw);
t.handlers.trigger("reinitializeScroll");
if (isUpdateCols) {
t._updateVisibleColsCount();
}
if (isUpdateRows) {
t._updateVisibleRowsCount();
}
t.handlers.trigger("selectionChanged");
t.handlers.trigger("selectionMathInfoChanged", t.getSelectionMathInfo());
};
switch (prop) {
case "colWidth":
functionModelAction = function () {
t.model.setColWidth(val, checkRange.c1, checkRange.c2);
isUpdateCols = true;
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: checkRange.c1};
};
this._isLockedAll(onChangeWorksheetCallback);
break;
case "showCols":
functionModelAction = function () {
t.model.setColHidden(/*bHidden*/false, arn.c1, arn.c2);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1};
};
oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
this._isLockedAll(onChangeWorksheetCallback);
break;
case "hideCols":
functionModelAction = function () {
t.model.setColHidden(/*bHidden*/true, arn.c1, arn.c2);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1};
};
oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
this._isLockedAll(onChangeWorksheetCallback);
break;
case "rowHeight":
functionModelAction = function () {
// Приводим к px (чтобы было ровно)
val = val / 0.75;
val = (val | val) * 0.75; // 0.75 - это размер 1px в pt (можно было 96/72)
t.model.setRowHeight(Math.min(val, t.maxRowHeight), checkRange.r1, checkRange.r2, true);
isUpdateRows = true;
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: checkRange.r1};
};
return this._isLockedAll(onChangeWorksheetCallback);
case "showRows":
functionModelAction = function () {
t.model.setRowHidden(/*bHidden*/false, arn.r1, arn.r2);
t.model.autoFilters.reDrawFilter(arn);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1};
};
oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2);
this._isLockedAll(onChangeWorksheetCallback);
break;
case "hideRows":
functionModelAction = function () {
t.model.setRowHidden(/*bHidden*/true, arn.r1, arn.r2);
t.model.autoFilters.reDrawFilter(arn);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1};
};
oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2);
this._isLockedAll(onChangeWorksheetCallback);
break;
case "insCell":
range = t.model.getRange3(arn.r1, arn.c1, arn.r2, arn.c2);
switch (val) {
case c_oAscInsertOptions.InsertCellsAndShiftRight:
isCheckChangeAutoFilter =
t.af_checkInsDelCells(arn, c_oAscInsertOptions.InsertCellsAndShiftRight, prop);
if (isCheckChangeAutoFilter === false) {
return;
}
functionModelAction = function () {
History.Create_NewPoint();
History.StartTransaction();
if (range.addCellsShiftRight()) {
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
t.cellCommentator.updateCommentsDependencies(true, val, arn);
updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
}
History.EndTransaction();
};
oChangeData.changedRange = new asc_Range(arn.c1, arn.r1, gc_nMaxCol0, arn.r2); var t = this;
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); var arn = this.model.selectionRange.getLast().clone();
break; var checkRange = arn.getAllRange();
case c_oAscInsertOptions.InsertCellsAndShiftDown:
isCheckChangeAutoFilter = var range;
t.af_checkInsDelCells(arn, c_oAscInsertOptions.InsertCellsAndShiftDown, prop); var oRecalcType = AscCommonExcel.recalcType.recalc;
if (isCheckChangeAutoFilter === false) { var reinitRanges = false;
return; var updateDrawingObjectsInfo = null;
} var updateDrawingObjectsInfo2 = null;//{bInsert: false, operType: c_oAscInsertOptions.InsertColumns, updateRange: arn}
var isUpdateCols = false, isUpdateRows = false;
var isCheckChangeAutoFilter;
var functionModelAction = null;
var lockDraw = false; // Параметр, при котором не будет отрисовки (т.к. мы просто обновляем информацию на неактивном листе)
var lockRange, arrChangedRanges = [];
var onChangeWorksheetCallback = function (isSuccess) {
if (false === isSuccess) {
return;
}
functionModelAction = function () { asc_applyFunction(functionModelAction);
History.Create_NewPoint();
History.StartTransaction();
if (range.addCellsShiftBottom()) {
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
t.cellCommentator.updateCommentsDependencies(true, val, arn);
updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
}
History.EndTransaction();
};
oChangeData.changedRange = new asc_Range(arn.c1, arn.r1, arn.c2, gc_nMaxRow0); t._initCellsArea(oRecalcType);
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); if (oRecalcType) {
break; t.cache.reset();
case c_oAscInsertOptions.InsertColumns: }
isCheckChangeAutoFilter = t.model.autoFilters.isRangeIntersectionSeveralTableParts(arn); t._cleanCellsTextMetricsCache();
if (isCheckChangeAutoFilter === true) { t._prepareCellTextMetricsCache();
this.model.workbook.handlers.trigger("asc_onError",
c_oAscError.ID.AutoFilterChangeFormatTableError, c_oAscError.Level.NoCritical); if (t.objectRender) {
return; if (reinitRanges && t.objectRender.drawingArea) {
} t.objectRender.drawingArea.reinitRanges();
}
if (null !== updateDrawingObjectsInfo) {
t.objectRender.updateSizeDrawingObjects(updateDrawingObjectsInfo);
}
if (null !== updateDrawingObjectsInfo2) {
t.objectRender.updateDrawingObject(updateDrawingObjectsInfo2.bInsert,
updateDrawingObjectsInfo2.operType, updateDrawingObjectsInfo2.updateRange);
}
t.model.onUpdateRanges(arrChangedRanges);
t.objectRender.rebuildChartGraphicObjects(arrChangedRanges);
}
t.draw(lockDraw);
functionModelAction = function () { t.handlers.trigger("reinitializeScroll");
History.Create_NewPoint();
History.StartTransaction();
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
t.model.insertColsBefore(arn.c1, arn.c2 - arn.c1 + 1);
updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
t.cellCommentator.updateCommentsDependencies(true, val, arn);
History.EndTransaction();
};
oChangeData.added = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); if (isUpdateCols) {
this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns, t._updateVisibleColsCount();
onChangeWorksheetCallback); }
break; if (isUpdateRows) {
case c_oAscInsertOptions.InsertRows: t._updateVisibleRowsCount();
functionModelAction = function () { }
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
t.model.insertRowsBefore(arn.r1, arn.r2 - arn.r1 + 1);
updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
t.cellCommentator.updateCommentsDependencies(true, val, arn);
};
oChangeData.added = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2); t.handlers.trigger("selectionChanged");
this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertRows, t.handlers.trigger("selectionMathInfoChanged", t.getSelectionMathInfo());
onChangeWorksheetCallback); };
break;
} switch (prop) {
break; case "colWidth":
case "delCell": functionModelAction = function () {
range = t.model.getRange3(checkRange.r1, checkRange.c1, checkRange.r2, checkRange.c2); t.model.setColWidth(val, checkRange.c1, checkRange.c2);
switch (val) { isUpdateCols = true;
case c_oAscDeleteOptions.DeleteCellsAndShiftLeft: oRecalcType = AscCommonExcel.recalcType.full;
isCheckChangeAutoFilter = reinitRanges = true;
t.af_checkInsDelCells(arn, c_oAscDeleteOptions.DeleteCellsAndShiftLeft, prop); updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: checkRange.c1};
if (isCheckChangeAutoFilter === false) { };
return; this._isLockedAll(onChangeWorksheetCallback);
} break;
case "showCols":
functionModelAction = function () {
t.model.setColHidden(/*bHidden*/false, arn.c1, arn.c2);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1};
};
arrChangedRanges.push(new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0));
this._isLockedAll(onChangeWorksheetCallback);
break;
case "hideCols":
functionModelAction = function () {
t.model.setColHidden(/*bHidden*/true, arn.c1, arn.c2);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1};
};
arrChangedRanges.push(new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0));
this._isLockedAll(onChangeWorksheetCallback);
break;
case "rowHeight":
functionModelAction = function () {
// Приводим к px (чтобы было ровно)
val = val / 0.75;
val = (val | val) * 0.75; // 0.75 - это размер 1px в pt (можно было 96/72)
t.model.setRowHeight(Math.min(val, t.maxRowHeight), checkRange.r1, checkRange.r2, true);
isUpdateRows = true;
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: checkRange.r1};
};
return this._isLockedAll(onChangeWorksheetCallback);
case "showRows":
functionModelAction = function () {
t.model.setRowHidden(/*bHidden*/false, arn.r1, arn.r2);
t.model.autoFilters.reDrawFilter(arn);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1};
};
arrChangedRanges.push(new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2));
this._isLockedAll(onChangeWorksheetCallback);
break;
case "hideRows":
functionModelAction = function () {
t.model.setRowHidden(/*bHidden*/true, arn.r1, arn.r2);
t.model.autoFilters.reDrawFilter(arn);
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1};
};
arrChangedRanges.push(new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2));
this._isLockedAll(onChangeWorksheetCallback);
break;
case "insCell":
range = t.model.getRange3(arn.r1, arn.c1, arn.r2, arn.c2);
switch (val) {
case c_oAscInsertOptions.InsertCellsAndShiftRight:
isCheckChangeAutoFilter =
t.af_checkInsDelCells(arn, c_oAscInsertOptions.InsertCellsAndShiftRight, prop);
if (isCheckChangeAutoFilter === false) {
return;
}
functionModelAction = function () { functionModelAction = function () {
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
if (isCheckChangeAutoFilter === true) { if (range.addCellsShiftRight()) {
t.model.autoFilters.isEmptyAutoFilters(arn, oRecalcType = AscCommonExcel.recalcType.full;
c_oAscDeleteOptions.DeleteCellsAndShiftLeft); reinitRanges = true;
} t.cellCommentator.updateCommentsDependencies(true, val, arn);
if (range.deleteCellsShiftLeft(function () { updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
t._cleanCache(oChangeData.changedRange); }
t.cellCommentator.updateCommentsDependencies(false, val, checkRange); History.EndTransaction();
})) { };
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
} arrChangedRanges.push(lockRange = new asc_Range(arn.c1, arn.r1, gc_nMaxCol0, arn.r2));
History.EndTransaction(); this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
reinitRanges = true; break;
}; case c_oAscInsertOptions.InsertCellsAndShiftDown:
isCheckChangeAutoFilter =
t.af_checkInsDelCells(arn, c_oAscInsertOptions.InsertCellsAndShiftDown, prop);
if (isCheckChangeAutoFilter === false) {
return;
}
oChangeData.changedRange = functionModelAction = function () {
new asc_Range(checkRange.c1, checkRange.r1, gc_nMaxCol0, checkRange.r2); History.Create_NewPoint();
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); History.StartTransaction();
break; if (range.addCellsShiftBottom()) {
case c_oAscDeleteOptions.DeleteCellsAndShiftTop: oRecalcType = AscCommonExcel.recalcType.full;
isCheckChangeAutoFilter = reinitRanges = true;
t.af_checkInsDelCells(arn, c_oAscDeleteOptions.DeleteCellsAndShiftTop, prop); t.cellCommentator.updateCommentsDependencies(true, val, arn);
if (isCheckChangeAutoFilter === false) { updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
return; }
} History.EndTransaction();
};
arrChangedRanges.push(lockRange = new asc_Range(arn.c1, arn.r1, arn.c2, gc_nMaxRow0));
this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
break;
case c_oAscInsertOptions.InsertColumns:
isCheckChangeAutoFilter = t.model.autoFilters.isRangeIntersectionSeveralTableParts(arn);
if (isCheckChangeAutoFilter === true) {
this.model.workbook.handlers.trigger("asc_onError",
c_oAscError.ID.AutoFilterChangeFormatTableError, c_oAscError.Level.NoCritical);
return;
}
functionModelAction = function () { functionModelAction = function () {
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
if (isCheckChangeAutoFilter === true) { oRecalcType = AscCommonExcel.recalcType.full;
t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteCellsAndShiftTop); reinitRanges = true;
} t.model.insertColsBefore(arn.c1, arn.c2 - arn.c1 + 1);
if (range.deleteCellsShiftUp(function () { updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
t._cleanCache(oChangeData.changedRange); t.cellCommentator.updateCommentsDependencies(true, val, arn);
t.cellCommentator.updateCommentsDependencies(false, val, checkRange); History.EndTransaction();
})) { };
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
} arrChangedRanges.push(lockRange = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0));
History.EndTransaction(); this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.InsertColumns,
onChangeWorksheetCallback);
break;
case c_oAscInsertOptions.InsertRows:
functionModelAction = function () {
oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true;
t.model.insertRowsBefore(arn.r1, arn.r2 - arn.r1 + 1);
updateDrawingObjectsInfo2 = {bInsert: true, operType: val, updateRange: arn};
t.cellCommentator.updateCommentsDependencies(true, val, arn);
};
arrChangedRanges.push(lockRange = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2));
this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.InsertRows, onChangeWorksheetCallback);
break;
}
break;
case "delCell":
range = t.model.getRange3(checkRange.r1, checkRange.c1, checkRange.r2, checkRange.c2);
switch (val) {
case c_oAscDeleteOptions.DeleteCellsAndShiftLeft:
isCheckChangeAutoFilter =
t.af_checkInsDelCells(arn, c_oAscDeleteOptions.DeleteCellsAndShiftLeft, prop);
if (isCheckChangeAutoFilter === false) {
return;
}
reinitRanges = true; functionModelAction = function () {
}; History.Create_NewPoint();
History.StartTransaction();
if (isCheckChangeAutoFilter === true) {
t.model.autoFilters.isEmptyAutoFilters(arn,
c_oAscDeleteOptions.DeleteCellsAndShiftLeft);
}
if (range.deleteCellsShiftLeft(function () {
t._cleanCache(lockRange);
t.cellCommentator.updateCommentsDependencies(false, val, checkRange);
})) {
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
}
History.EndTransaction();
reinitRanges = true;
};
arrChangedRanges.push(
lockRange = new asc_Range(checkRange.c1, checkRange.r1, gc_nMaxCol0, checkRange.r2));
this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
break;
case c_oAscDeleteOptions.DeleteCellsAndShiftTop:
isCheckChangeAutoFilter =
t.af_checkInsDelCells(arn, c_oAscDeleteOptions.DeleteCellsAndShiftTop, prop);
if (isCheckChangeAutoFilter === false) {
return;
}
oChangeData.changedRange = functionModelAction = function () {
new asc_Range(checkRange.c1, checkRange.r1, checkRange.c2, gc_nMaxRow0); History.Create_NewPoint();
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); History.StartTransaction();
break; if (isCheckChangeAutoFilter === true) {
case c_oAscDeleteOptions.DeleteColumns: t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteCellsAndShiftTop);
isCheckChangeAutoFilter = t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange, }
c_oAscDeleteOptions.DeleteColumns, prop); if (range.deleteCellsShiftUp(function () {
if (isCheckChangeAutoFilter === false) { t._cleanCache(lockRange);
return; t.cellCommentator.updateCommentsDependencies(false, val, checkRange);
} })) {
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
}
History.EndTransaction();
functionModelAction = function () { reinitRanges = true;
oRecalcType = AscCommonExcel.recalcType.full; };
reinitRanges = true;
History.Create_NewPoint(); arrChangedRanges.push(
History.StartTransaction(); lockRange = new asc_Range(checkRange.c1, checkRange.r1, checkRange.c2, gc_nMaxRow0));
t.cellCommentator.updateCommentsDependencies(false, val, checkRange); this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteColumns); break;
t.model.removeCols(checkRange.c1, checkRange.c2); case c_oAscDeleteOptions.DeleteColumns:
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn}; isCheckChangeAutoFilter = t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange,
History.EndTransaction(); c_oAscDeleteOptions.DeleteColumns, prop);
}; if (isCheckChangeAutoFilter === false) {
return;
}
oChangeData.removed = new asc_Range(checkRange.c1, 0, checkRange.c2, gc_nMaxRow0); functionModelAction = function () {
this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteColumns, oRecalcType = AscCommonExcel.recalcType.full;
onChangeWorksheetCallback); reinitRanges = true;
break; History.Create_NewPoint();
case c_oAscDeleteOptions.DeleteRows: History.StartTransaction();
isCheckChangeAutoFilter = t.cellCommentator.updateCommentsDependencies(false, val, checkRange);
t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange, c_oAscDeleteOptions.DeleteRows, t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteColumns);
prop); t.model.removeCols(checkRange.c1, checkRange.c2);
if (isCheckChangeAutoFilter === false) { updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
return; History.EndTransaction();
} };
arrChangedRanges.push(lockRange = new asc_Range(checkRange.c1, 0, checkRange.c2, gc_nMaxRow0));
this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.DeleteColumns,
onChangeWorksheetCallback);
break;
case c_oAscDeleteOptions.DeleteRows:
isCheckChangeAutoFilter =
t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange, c_oAscDeleteOptions.DeleteRows,
prop);
if (isCheckChangeAutoFilter === false) {
return;
}
functionModelAction = function () { functionModelAction = function () {
oRecalcType = AscCommonExcel.recalcType.full; oRecalcType = AscCommonExcel.recalcType.full;
reinitRanges = true; reinitRanges = true;
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
checkRange = t.model.autoFilters.checkDeleteAllRowsFormatTable(checkRange, true); checkRange = t.model.autoFilters.checkDeleteAllRowsFormatTable(checkRange, true);
t.cellCommentator.updateCommentsDependencies(false, val, checkRange); t.cellCommentator.updateCommentsDependencies(false, val, checkRange);
t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteRows); t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteRows);
t.model.removeRows(checkRange.r1, checkRange.r2); t.model.removeRows(checkRange.r1, checkRange.r2);
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn}; updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
History.EndTransaction(); History.EndTransaction();
}; };
oChangeData.removed = new asc_Range(0, checkRange.r1, gc_nMaxCol0, checkRange.r2); arrChangedRanges.push(lockRange = new asc_Range(0, checkRange.r1, gc_nMaxCol0, checkRange.r2));
this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteRows, this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.DeleteRows, onChangeWorksheetCallback);
onChangeWorksheetCallback); break;
break; }
} this.handlers.trigger("selectionNameChanged", t.getSelectionName(/*bRangeText*/false));
this.handlers.trigger("selectionNameChanged", t.getSelectionName(/*bRangeText*/false)); break;
break; case "sheetViewSettings":
case "sheetViewSettings": functionModelAction = function () {
functionModelAction = function () { t.model.setSheetViewSettings(val);
t.model.setSheetViewSettings(val);
isUpdateCols = true;
isUpdateCols = true; isUpdateRows = true;
isUpdateRows = true; oRecalcType = AscCommonExcel.recalcType.full;
oRecalcType = AscCommonExcel.recalcType.full; reinitRanges = true;
reinitRanges = true; };
};
this._isLockedAll(onChangeWorksheetCallback);
this._isLockedAll(onChangeWorksheetCallback); break;
break; case "update":
case "update": if (val !== undefined) {
if (val !== undefined) { lockDraw = true === val.lockDraw;
lockDraw = true === val.lockDraw; reinitRanges = !!val.reinitRanges;
reinitRanges = !!val.reinitRanges; }
} onChangeWorksheetCallback(true);
onChangeWorksheetCallback(true); break;
break; }
} };
};
WorksheetView.prototype.expandColsOnScroll = function (isNotActive, updateColsCount, newColsCount) { WorksheetView.prototype.expandColsOnScroll = function (isNotActive, updateColsCount, newColsCount) {
var maxColObjects = this.objectRender ? this.objectRender.getMaxColRow().col : -1; var maxColObjects = this.objectRender ? this.objectRender.getMaxColRow().col : -1;
...@@ -11173,9 +11172,7 @@ ...@@ -11173,9 +11172,7 @@
} }
this.model.onUpdateRanges(arrChanged); this.model.onUpdateRanges(arrChanged);
this.objectRender.rebuildChartGraphicObjects(arrChanged);
this.objectRender.rebuildChartGraphicObjects(
new AscFormat.CChangeTableData(null, null, null, null, arrChanged));
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
this.handlers.trigger("onDocumentPlaceChanged"); this.handlers.trigger("onDocumentPlaceChanged");
this.draw(lockDraw); this.draw(lockDraw);
...@@ -11779,9 +11776,9 @@ ...@@ -11779,9 +11776,9 @@
if (this.objectRender && this.objectRender.drawingArea) { if (this.objectRender && this.objectRender.drawingArea) {
this.objectRender.drawingArea.reinitRanges(); this.objectRender.drawingArea.reinitRanges();
} }
var oChangeData = new AscFormat.CChangeTableData(null, null, null, null); // Обновление для диаграмм var arrChanged = [new asc_Range(range.c1, 0, range.c2, gc_nMaxRow0)];
oChangeData.change = new asc_Range(range.c1, 0, range.c2, gc_nMaxRow0); this.model.onUpdateRanges(arrChanged);
this.objectRender.rebuildChartGraphicObjects(oChangeData); this.objectRender.rebuildChartGraphicObjects(arrChanged);
this.draw(); this.draw();
this.handlers.trigger("reinitializeScroll"); this.handlers.trigger("reinitializeScroll");
} else { } else {
......
...@@ -2963,33 +2963,10 @@ function DrawingObjects() { ...@@ -2963,33 +2963,10 @@ function DrawingObjects() {
if(!worksheet) if(!worksheet)
return; return;
AscFormat.ExecuteNoHistory(function(){ AscFormat.ExecuteNoHistory(function(){
var i;
var wsViews = Asc["editor"].wb.wsViews; var wsViews = Asc["editor"].wb.wsViews;
var changedArr = []; var changedArr = [];
if(data.changedRange) for (var i = 0; i < data.length; ++i) {
{ changedArr.push(new BBoxInfo(worksheet.model, data[i]));
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.changedRange.c1, data.changedRange.r1, data.changedRange.c2, data.changedRange.r2)))
}
if(data.added)
{
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.added.c1, data.added.r1, gc_nMaxCol, gc_nMaxRow)))
}
if(data.hided)
{
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.hided.c1, data.hided.r1, data.hided.c2, data.hided.r2)))
}
if(data.removed)
{
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.removed.c1, data.removed.r1, gc_nMaxCol, gc_nMaxRow)))
}
if(Array.isArray(data.arrChanged))
{
for(i = 0; i < data.arrChanged.length; ++i)
{
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.arrChanged[i].c1, data.arrChanged[i].r1, data.arrChanged[i].c2, data.arrChanged[i].r2)))
}
} }
for(i = 0; i < wsViews.length; ++i) for(i = 0; i < wsViews.length; ++i)
......
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