Commit aae458b5 authored by konovalovsergey's avatar konovalovsergey

for bug 32828. set active sheet as last action sheet

parent 029aecdf
...@@ -302,6 +302,9 @@ CHistory.prototype.UndoRedoPrepare = function (oRedoObjectParam, bUndo) { ...@@ -302,6 +302,9 @@ CHistory.prototype.UndoRedoPrepare = function (oRedoObjectParam, bUndo) {
} }
} }
} }
if (window["NATIVE_EDITOR_ENJINE"] || !this.workbook.oApi.IsSendDocumentLoadCompleate) {
oRedoObjectParam.bChangeActive = true;
}
}; };
CHistory.prototype.RedoAdd = function(oRedoObjectParam, Class, Type, sheetid, range, Data, LocalChange) CHistory.prototype.RedoAdd = function(oRedoObjectParam, Class, Type, sheetid, range, Data, LocalChange)
{ {
...@@ -317,6 +320,12 @@ CHistory.prototype.RedoAdd = function(oRedoObjectParam, Class, Type, sheetid, ra ...@@ -317,6 +320,12 @@ CHistory.prototype.RedoAdd = function(oRedoObjectParam, Class, Type, sheetid, ra
if(bNeedOff) if(bNeedOff)
this.TurnOff(); this.TurnOff();
var bChangeActive = oRedoObjectParam.bChangeActive && AscCommonExcel.g_oUndoRedoWorkbook === Class;
if (bChangeActive && null != oRedoObjectParam.activeSheet) {
//it can be delete action, so set active and get after action
this.workbook.setActiveById(oRedoObjectParam.activeSheet);
}
// ToDo Убрать это!!! // ToDo Убрать это!!!
if(Class && !Class.Load_Changes && !Class.Load) if(Class && !Class.Load_Changes && !Class.Load)
{ {
...@@ -354,6 +363,9 @@ CHistory.prototype.RedoAdd = function(oRedoObjectParam, Class, Type, sheetid, ra ...@@ -354,6 +363,9 @@ CHistory.prototype.RedoAdd = function(oRedoObjectParam, Class, Type, sheetid, ra
} }
} }
} }
if (bChangeActive) {
oRedoObjectParam.activeSheet = this.workbook.getActiveWs().getId();
}
var curPoint = this.Points[this.Index]; var curPoint = this.Points[this.Index];
if (curPoint) { if (curPoint) {
this._addRedoObjectParam(oRedoObjectParam, curPoint.Items[curPoint.Items.length - 1]); this._addRedoObjectParam(oRedoObjectParam, curPoint.Items[curPoint.Items.length - 1]);
...@@ -512,6 +524,9 @@ CHistory.prototype.UndoRedoEnd = function (Point, oRedoObjectParam, bUndo) { ...@@ -512,6 +524,9 @@ CHistory.prototype.UndoRedoEnd = function (Point, oRedoObjectParam, bUndo) {
this.lastDrawingObjects = null; this.lastDrawingObjects = null;
} }
} }
if (oRedoObjectParam.bChangeActive && null != oRedoObjectParam.activeSheet) {
this.workbook.setActiveById(oRedoObjectParam.activeSheet);
}
} }
...@@ -566,7 +581,10 @@ CHistory.prototype._addRedoObjectParam = function (oRedoObjectParam, Point) { ...@@ -566,7 +581,10 @@ CHistory.prototype._addRedoObjectParam = function (oRedoObjectParam, Point) {
oRedoObjectParam.bAddRemoveRowCol = true; oRedoObjectParam.bAddRemoveRowCol = true;
else if(AscCommonExcel.g_oUndoRedoAutoFilters === Point.Class && AscCH.historyitem_AutoFilter_ChangeTableInfo === Point.Type) else if(AscCommonExcel.g_oUndoRedoAutoFilters === Point.Class && AscCH.historyitem_AutoFilter_ChangeTableInfo === Point.Type)
oRedoObjectParam.oChangeWorksheetUpdate[Point.SheetId] = Point.SheetId; oRedoObjectParam.oChangeWorksheetUpdate[Point.SheetId] = Point.SheetId;
if (null != Point.SheetId) {
oRedoObjectParam.activeSheet = Point.SheetId;
}
}; };
CHistory.prototype.Get_RecalcData = function(Point2) CHistory.prototype.Get_RecalcData = function(Point2)
{ {
......
...@@ -1441,6 +1441,10 @@ ...@@ -1441,6 +1441,10 @@
} }
return false; return false;
}; };
Workbook.prototype.setActiveById=function(sheetId){
var ws = this.getWorksheetById(sheetId);
return this.setActive(ws.getIndex());
};
Workbook.prototype.getSheetIdByIndex = function(index) { Workbook.prototype.getSheetIdByIndex = function(index) {
var ws = this.getWorksheet(index); var ws = this.getWorksheet(index);
return ws ? ws.getId() : null; return ws ? ws.getId() : null;
......
...@@ -1900,6 +1900,8 @@ ...@@ -1900,6 +1900,8 @@
this.oOnUpdateTabColor = {}; this.oOnUpdateTabColor = {};
this.oOnUpdateSheetViewSettings = {}; this.oOnUpdateSheetViewSettings = {};
this.bAddRemoveRowCol = false; this.bAddRemoveRowCol = false;
this.bChangeActive = false;
this.activeSheet = null;
} }
......
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