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

fix bug 33464

parent 58f12a67
...@@ -9763,7 +9763,7 @@ ...@@ -9763,7 +9763,7 @@
var isCheckChangeAutoFilter; var isCheckChangeAutoFilter;
var functionModelAction = null; var functionModelAction = null;
var lockDraw = false; // Параметр, при котором не будет отрисовки (т.к. мы просто обновляем информацию на неактивном листе) var lockDraw = false; // Параметр, при котором не будет отрисовки (т.к. мы просто обновляем информацию на неактивном листе)
var oChangeData = new AscFormat.CChangeTableData(null, null, null, null); // Обновление для диаграмм var lockRange, arrChangedRanges = [];
var onChangeWorksheetCallback = function (isSuccess) { var onChangeWorksheetCallback = function (isSuccess) {
if (false === isSuccess) { if (false === isSuccess) {
...@@ -9790,7 +9790,8 @@ ...@@ -9790,7 +9790,8 @@
t.objectRender.updateDrawingObject(updateDrawingObjectsInfo2.bInsert, t.objectRender.updateDrawingObject(updateDrawingObjectsInfo2.bInsert,
updateDrawingObjectsInfo2.operType, updateDrawingObjectsInfo2.updateRange); updateDrawingObjectsInfo2.operType, updateDrawingObjectsInfo2.updateRange);
} }
t.objectRender.rebuildChartGraphicObjects(oChangeData); t.model.onUpdateRanges(arrChangedRanges);
t.objectRender.rebuildChartGraphicObjects(arrChangedRanges);
} }
t.draw(lockDraw); t.draw(lockDraw);
...@@ -9825,7 +9826,7 @@ ...@@ -9825,7 +9826,7 @@
reinitRanges = true; reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1}; updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1};
}; };
oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); arrChangedRanges.push(new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0));
this._isLockedAll(onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break; break;
case "hideCols": case "hideCols":
...@@ -9835,7 +9836,7 @@ ...@@ -9835,7 +9836,7 @@
reinitRanges = true; reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1}; updateDrawingObjectsInfo = {target: c_oTargetType.ColumnResize, col: arn.c1};
}; };
oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); arrChangedRanges.push(new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0));
this._isLockedAll(onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break; break;
case "rowHeight": case "rowHeight":
...@@ -9858,7 +9859,7 @@ ...@@ -9858,7 +9859,7 @@
reinitRanges = true; reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1}; updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1};
}; };
oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2); arrChangedRanges.push(new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2));
this._isLockedAll(onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break; break;
case "hideRows": case "hideRows":
...@@ -9869,7 +9870,7 @@ ...@@ -9869,7 +9870,7 @@
reinitRanges = true; reinitRanges = true;
updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1}; updateDrawingObjectsInfo = {target: c_oTargetType.RowResize, row: arn.r1};
}; };
oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2); arrChangedRanges.push(new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2));
this._isLockedAll(onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break; break;
case "insCell": case "insCell":
...@@ -9894,8 +9895,8 @@ ...@@ -9894,8 +9895,8 @@
History.EndTransaction(); History.EndTransaction();
}; };
oChangeData.changedRange = new asc_Range(arn.c1, arn.r1, gc_nMaxCol0, arn.r2); arrChangedRanges.push(lockRange = new asc_Range(arn.c1, arn.r1, gc_nMaxCol0, arn.r2));
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
break; break;
case c_oAscInsertOptions.InsertCellsAndShiftDown: case c_oAscInsertOptions.InsertCellsAndShiftDown:
isCheckChangeAutoFilter = isCheckChangeAutoFilter =
...@@ -9916,8 +9917,8 @@ ...@@ -9916,8 +9917,8 @@
History.EndTransaction(); History.EndTransaction();
}; };
oChangeData.changedRange = new asc_Range(arn.c1, arn.r1, arn.c2, gc_nMaxRow0); arrChangedRanges.push(lockRange = new asc_Range(arn.c1, arn.r1, arn.c2, gc_nMaxRow0));
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
break; break;
case c_oAscInsertOptions.InsertColumns: case c_oAscInsertOptions.InsertColumns:
isCheckChangeAutoFilter = t.model.autoFilters.isRangeIntersectionSeveralTableParts(arn); isCheckChangeAutoFilter = t.model.autoFilters.isRangeIntersectionSeveralTableParts(arn);
...@@ -9938,8 +9939,8 @@ ...@@ -9938,8 +9939,8 @@
History.EndTransaction(); History.EndTransaction();
}; };
oChangeData.added = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); arrChangedRanges.push(lockRange = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0));
this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns, this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.InsertColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break; break;
case c_oAscInsertOptions.InsertRows: case c_oAscInsertOptions.InsertRows:
...@@ -9951,9 +9952,8 @@ ...@@ -9951,9 +9952,8 @@
t.cellCommentator.updateCommentsDependencies(true, val, arn); t.cellCommentator.updateCommentsDependencies(true, val, arn);
}; };
oChangeData.added = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2); arrChangedRanges.push(lockRange = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2));
this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertRows, this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.InsertRows, onChangeWorksheetCallback);
onChangeWorksheetCallback);
break; break;
} }
break; break;
...@@ -9975,7 +9975,7 @@ ...@@ -9975,7 +9975,7 @@
c_oAscDeleteOptions.DeleteCellsAndShiftLeft); c_oAscDeleteOptions.DeleteCellsAndShiftLeft);
} }
if (range.deleteCellsShiftLeft(function () { if (range.deleteCellsShiftLeft(function () {
t._cleanCache(oChangeData.changedRange); t._cleanCache(lockRange);
t.cellCommentator.updateCommentsDependencies(false, val, checkRange); t.cellCommentator.updateCommentsDependencies(false, val, checkRange);
})) { })) {
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn}; updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
...@@ -9984,9 +9984,9 @@ ...@@ -9984,9 +9984,9 @@
reinitRanges = true; reinitRanges = true;
}; };
oChangeData.changedRange = arrChangedRanges.push(
new asc_Range(checkRange.c1, checkRange.r1, gc_nMaxCol0, checkRange.r2); lockRange = new asc_Range(checkRange.c1, checkRange.r1, gc_nMaxCol0, checkRange.r2));
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
break; break;
case c_oAscDeleteOptions.DeleteCellsAndShiftTop: case c_oAscDeleteOptions.DeleteCellsAndShiftTop:
isCheckChangeAutoFilter = isCheckChangeAutoFilter =
...@@ -10002,7 +10002,7 @@ ...@@ -10002,7 +10002,7 @@
t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteCellsAndShiftTop); t.model.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteCellsAndShiftTop);
} }
if (range.deleteCellsShiftUp(function () { if (range.deleteCellsShiftUp(function () {
t._cleanCache(oChangeData.changedRange); t._cleanCache(lockRange);
t.cellCommentator.updateCommentsDependencies(false, val, checkRange); t.cellCommentator.updateCommentsDependencies(false, val, checkRange);
})) { })) {
updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn}; updateDrawingObjectsInfo2 = {bInsert: false, operType: val, updateRange: arn};
...@@ -10012,9 +10012,9 @@ ...@@ -10012,9 +10012,9 @@
reinitRanges = true; reinitRanges = true;
}; };
oChangeData.changedRange = arrChangedRanges.push(
new asc_Range(checkRange.c1, checkRange.r1, checkRange.c2, gc_nMaxRow0); lockRange = new asc_Range(checkRange.c1, checkRange.r1, checkRange.c2, gc_nMaxRow0));
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(lockRange, null, onChangeWorksheetCallback);
break; break;
case c_oAscDeleteOptions.DeleteColumns: case c_oAscDeleteOptions.DeleteColumns:
isCheckChangeAutoFilter = t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange, isCheckChangeAutoFilter = t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange,
...@@ -10035,8 +10035,8 @@ ...@@ -10035,8 +10035,8 @@
History.EndTransaction(); History.EndTransaction();
}; };
oChangeData.removed = new asc_Range(checkRange.c1, 0, checkRange.c2, gc_nMaxRow0); arrChangedRanges.push(lockRange = new asc_Range(checkRange.c1, 0, checkRange.c2, gc_nMaxRow0));
this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteColumns, this._isLockedCells(lockRange, c_oAscLockTypeElemSubType.DeleteColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break; break;
case c_oAscDeleteOptions.DeleteRows: case c_oAscDeleteOptions.DeleteRows:
...@@ -10060,9 +10060,8 @@ ...@@ -10060,9 +10060,8 @@
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));
...@@ -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