Commit 3b6dfb00 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

fix bug #26798

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58600 954022d7-b5bf-4e40-9824-e11837661b57
parent 9ec60620
...@@ -9357,6 +9357,8 @@ ...@@ -9357,6 +9357,8 @@
if (isUpdateCols) { t._updateVisibleColsCount(); } if (isUpdateCols) { t._updateVisibleColsCount(); }
if (isUpdateRows) { t._updateVisibleRowsCount(); } if (isUpdateRows) { t._updateVisibleRowsCount(); }
t.handlers.trigger("selectionChanged", t.getSelectionInfo());
t.handlers.trigger("selectionMathInfoChanged", t.getSelectionMathInfo());
}; };
switch (prop) { switch (prop) {
...@@ -9367,8 +9369,8 @@ ...@@ -9367,8 +9369,8 @@
isUpdateCols = true; isUpdateCols = true;
fullRecalc = true; fullRecalc = true;
}; };
return this._isLockedAll (onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break;
case "insColBefore": case "insColBefore":
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
...@@ -9376,8 +9378,9 @@ ...@@ -9376,8 +9378,9 @@
t.model.insertColsBefore(arn.c1, val); t.model.insertColsBefore(arn.c1, val);
}; };
oChangeData.added = new asc_Range(arn.c1, 0, arn.c1 + val - 1, gc_nMaxRow0); oChangeData.added = new asc_Range(arn.c1, 0, arn.c1 + val - 1, gc_nMaxRow0);
return this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns, this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break;
case "insColAfter": case "insColAfter":
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
...@@ -9385,31 +9388,34 @@ ...@@ -9385,31 +9388,34 @@
t.model.insertColsAfter(arn.c2, val); t.model.insertColsAfter(arn.c2, val);
}; };
oChangeData.added = new asc_Range(arn.c2, 0, arn.c2 + val - 1, gc_nMaxRow0); oChangeData.added = new asc_Range(arn.c2, 0, arn.c2 + val - 1, gc_nMaxRow0);
return this._isLockedCells (oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns, this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break;
case "delCol": case "delCol":
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
t.model.removeCols(arn.c1, arn.c2); t.model.removeCols(arn.c1, arn.c2);
}; };
oChangeData.removed = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); oChangeData.removed = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
return this._isLockedCells (oChangeData.removed, c_oAscLockTypeElemSubType.DeleteColumns, this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break;
case "showCols": case "showCols":
functionModelAction = function () { functionModelAction = function () {
t.model.setColHidden(/*bHidden*/false, arn.c1, arn.c2); t.model.setColHidden(/*bHidden*/false, arn.c1, arn.c2);
fullRecalc = true; fullRecalc = true;
}; };
oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
return this._isLockedAll (onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break;
case "hideCols": case "hideCols":
functionModelAction = function () { functionModelAction = function () {
t.model.setColHidden(/*bHidden*/true, arn.c1, arn.c2); t.model.setColHidden(/*bHidden*/true, arn.c1, arn.c2);
fullRecalc = true; fullRecalc = true;
}; };
oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0); oChangeData.hided = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
return this._isLockedAll (onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break;
case "rowHeight": case "rowHeight":
functionModelAction = function () { functionModelAction = function () {
// Приводим к px (чтобы было ровно) // Приводим к px (чтобы было ровно)
...@@ -9418,31 +9424,34 @@ ...@@ -9418,31 +9424,34 @@
isUpdateRows = true; isUpdateRows = true;
fullRecalc = true; fullRecalc = true;
}; };
return this._isLockedAll (onChangeWorksheetCallback); return this._isLockedAll(onChangeWorksheetCallback);
case "insRowBefore": case "insRowBefore":
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
t.model.insertRowsBefore(arn.r1, val); t.model.insertRowsBefore(arn.r1, val);
}; };
oChangeData.added = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r1 + val - 1); oChangeData.added = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r1 + val - 1);
return this._isLockedCells (oChangeData.added, c_oAscLockTypeElemSubType.InsertRows, this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertRows,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break;
case "insRowAfter": case "insRowAfter":
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
t.model.insertRowsAfter(arn.r2, val); t.model.insertRowsAfter(arn.r2, val);
}; };
oChangeData.added = new asc_Range(0, arn.r2, gc_nMaxCol0, arn.r2 + val - 1); oChangeData.added = new asc_Range(0, arn.r2, gc_nMaxCol0, arn.r2 + val - 1);
return this._isLockedCells (oChangeData.added, c_oAscLockTypeElemSubType.InsertRows, this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertRows,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break;
case "delRow": case "delRow":
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
t.model.removeRows(arn.r1, arn.r2); t.model.removeRows(arn.r1, arn.r2);
}; };
oChangeData.removed = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r1); oChangeData.removed = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r1);
return this._isLockedCells (oChangeData.removed, c_oAscLockTypeElemSubType.DeleteRows, this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteRows,
onChangeWorksheetCallback); onChangeWorksheetCallback);
break;
case "showRows": case "showRows":
functionModelAction = function () { functionModelAction = function () {
t.model.setRowHidden(/*bHidden*/false, arn.r1, arn.r2); t.model.setRowHidden(/*bHidden*/false, arn.r1, arn.r2);
...@@ -9450,7 +9459,8 @@ ...@@ -9450,7 +9459,8 @@
fullRecalc = true; fullRecalc = true;
}; };
oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2); oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2);
return this._isLockedAll (onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break;
case "hideRows": case "hideRows":
functionModelAction = function () { functionModelAction = function () {
t.model.setRowHidden(/*bHidden*/true, arn.r1, arn.r2); t.model.setRowHidden(/*bHidden*/true, arn.r1, arn.r2);
...@@ -9458,8 +9468,8 @@ ...@@ -9458,8 +9468,8 @@
fullRecalc = true; fullRecalc = true;
}; };
oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2); oChangeData.hided = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2);
return this._isLockedAll (onChangeWorksheetCallback); this._isLockedAll(onChangeWorksheetCallback);
break;
case "insCell": case "insCell":
bUndoRedo = val.range != undefined; bUndoRedo = val.range != undefined;
if (val && val.range) { if (val && val.range) {
...@@ -9497,7 +9507,7 @@ ...@@ -9497,7 +9507,7 @@
gc_nMaxCol0, _updateRangeIns.r2); gc_nMaxCol0, _updateRangeIns.r2);
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback);
} }
return; break;
case c_oAscInsertOptions.InsertCellsAndShiftDown: case c_oAscInsertOptions.InsertCellsAndShiftDown:
functionModelAction = function () { functionModelAction = function () {
var isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeIns, c_oAscInsertOptions.InsertCellsAndShiftDown, prop, bUndoRedo); var isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeIns, c_oAscInsertOptions.InsertCellsAndShiftDown, prop, bUndoRedo);
...@@ -9525,7 +9535,7 @@ ...@@ -9525,7 +9535,7 @@
_updateRangeIns.c2, gc_nMaxRow0); _updateRangeIns.c2, gc_nMaxRow0);
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback);
} }
return; break;
case c_oAscInsertOptions.InsertColumns: case c_oAscInsertOptions.InsertColumns:
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
...@@ -9546,7 +9556,7 @@ ...@@ -9546,7 +9556,7 @@
this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns, this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
} }
return; break;
case c_oAscInsertOptions.InsertRows: case c_oAscInsertOptions.InsertRows:
functionModelAction = function () { functionModelAction = function () {
fullRecalc = true; fullRecalc = true;
...@@ -9566,11 +9576,9 @@ ...@@ -9566,11 +9576,9 @@
this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertRows, this._isLockedCells(oChangeData.added, c_oAscLockTypeElemSubType.InsertRows,
onChangeWorksheetCallback); onChangeWorksheetCallback);
} }
return; break;
default: return;
} }
break; break;
case "delCell": case "delCell":
var isCheckChangeAutoFilter; var isCheckChangeAutoFilter;
bUndoRedo = val.range != undefined; bUndoRedo = val.range != undefined;
...@@ -9608,7 +9616,7 @@ ...@@ -9608,7 +9616,7 @@
gc_nMaxCol0, _updateRangeDel.r2); gc_nMaxCol0, _updateRangeDel.r2);
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback);
} }
return; break;
case c_oAscDeleteOptions.DeleteCellsAndShiftTop: case c_oAscDeleteOptions.DeleteCellsAndShiftTop:
isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeDel, c_oAscDeleteOptions.DeleteCellsAndShiftTop, prop, bUndoRedo); isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeDel, c_oAscDeleteOptions.DeleteCellsAndShiftTop, prop, bUndoRedo);
if(!isCheckChangeAutoFilter) if(!isCheckChangeAutoFilter)
...@@ -9635,7 +9643,7 @@ ...@@ -9635,7 +9643,7 @@
_updateRangeDel.c2, gc_nMaxRow0); _updateRangeDel.c2, gc_nMaxRow0);
this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback); this._isLockedCells(oChangeData.changedRange, null, onChangeWorksheetCallback);
} }
return; break;
case c_oAscDeleteOptions.DeleteColumns: case c_oAscDeleteOptions.DeleteColumns:
isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeDel, c_oAscDeleteOptions.DeleteColumns, prop, bUndoRedo); isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeDel, c_oAscDeleteOptions.DeleteColumns, prop, bUndoRedo);
if(!isCheckChangeAutoFilter) if(!isCheckChangeAutoFilter)
...@@ -9659,7 +9667,7 @@ ...@@ -9659,7 +9667,7 @@
this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteColumns, this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteColumns,
onChangeWorksheetCallback); onChangeWorksheetCallback);
} }
return; break;
case c_oAscDeleteOptions.DeleteRows: case c_oAscDeleteOptions.DeleteRows:
isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeDel, c_oAscDeleteOptions.DeleteRows, prop, bUndoRedo); isCheckChangeAutoFilter = t.autoFilters.isActiveCellsCrossHalfFTable(_updateRangeDel, c_oAscDeleteOptions.DeleteRows, prop, bUndoRedo);
if(!isCheckChangeAutoFilter) if(!isCheckChangeAutoFilter)
...@@ -9682,11 +9690,9 @@ ...@@ -9682,11 +9690,9 @@
this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteRows, this._isLockedCells(oChangeData.removed, c_oAscLockTypeElemSubType.DeleteRows,
onChangeWorksheetCallback); onChangeWorksheetCallback);
} }
return; break;
default: return;
} }
break; break;
case "sheetViewSettings": case "sheetViewSettings":
functionModelAction = function () { functionModelAction = function () {
t.model.setSheetViewSettings(val); t.model.setSheetViewSettings(val);
...@@ -9696,13 +9702,14 @@ ...@@ -9696,13 +9702,14 @@
fullRecalc = true; fullRecalc = true;
}; };
return this._isLockedAll (onChangeWorksheetCallback); this._isLockedAll (onChangeWorksheetCallback);
break;
case "update": case "update":
if (val !== undefined) { if (val !== undefined) {
fullRecalc = !!val.fullRecalc; fullRecalc = !!val.fullRecalc;
lockDraw = true === val.lockDraw; lockDraw = true === val.lockDraw;
} }
onChangeWorksheetCallback(true);
break; break;
case "updateRange": case "updateRange":
...@@ -9729,26 +9736,8 @@ ...@@ -9729,26 +9736,8 @@
t._updateCellsRange(val.range, val.canChangeColWidth, val.isLockDraw); t._updateCellsRange(val.range, val.canChangeColWidth, val.isLockDraw);
} }
return; break;
default: return;
}
t._initCellsArea(fullRecalc);
if (fullRecalc) {
t.cache.reset();
} else {
if (cleanCacheCols) { t._cleanCache(new asc_Range(arn.c1, 0, arn.c2, t.rows.length - 1)); }
if (cleanCacheRows) { t._cleanCache(new asc_Range(0, arn.r1, t.cols.length - 1, arn.r2)); }
} }
t._cleanCellsTextMetricsCache();
t._prepareCellTextMetricsCache();
t.draw(lockDraw);
t.handlers.trigger("reinitializeScroll");
if (isUpdateCols) { t._updateVisibleColsCount(); }
if (isUpdateRows) { t._updateVisibleRowsCount(); }
}; };
WorksheetView.prototype.expandColsOnScroll = function (isNotActive, updateColsCount, newColsCount) { WorksheetView.prototype.expandColsOnScroll = function (isNotActive, updateColsCount, newColsCount) {
......
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