Commit cf217760 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

trigger("updateWorksheetByModel"), trigger("asc_onSheetsChanged") перенесены в History

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56534 954022d7-b5bf-4e40-9824-e11837661b57
parent 5081ef4b
...@@ -411,6 +411,8 @@ CHistory.prototype = ...@@ -411,6 +411,8 @@ CHistory.prototype =
var isRedrawAll = true; var isRedrawAll = true;
var bChangeWorksheetUpdate = false; var bChangeWorksheetUpdate = false;
var oChangeWorksheetUpdate = {}; var oChangeWorksheetUpdate = {};
var bUpdateWorksheetByModel = false;
var bOnSheetsChanged = false;
var oCurWorksheet = this.workbook.getWorksheet(this.workbook.getActive()); var oCurWorksheet = this.workbook.getWorksheet(this.workbook.getActive());
if(null != Point.nLastSheetId && Point.nLastSheetId != oCurWorksheet.getId()) if(null != Point.nLastSheetId && Point.nLastSheetId != oCurWorksheet.getId())
this.workbook.handlers.trigger("showWorksheet", Point.nLastSheetId); this.workbook.handlers.trigger("showWorksheet", Point.nLastSheetId);
...@@ -427,8 +429,14 @@ CHistory.prototype = ...@@ -427,8 +429,14 @@ CHistory.prototype =
bChangeWorksheetUpdate = true; bChangeWorksheetUpdate = true;
oChangeWorksheetUpdate[Item.SheetId] = Item.SheetId; oChangeWorksheetUpdate[Item.SheetId] = Item.SheetId;
} }
if (g_oUndoRedoWorksheet === Item.Class && historyitem_Worksheet_SetViewSettings === Item.Type) else if (g_oUndoRedoWorksheet === Item.Class && historyitem_Worksheet_SetViewSettings === Item.Type)
isReInit = true; isReInit = true;
else if (g_oUndoRedoWorkbook === Item.Class && (historyitem_Workbook_SheetAdd === Item.Type || historyitem_Workbook_SheetRemove === Item.Type || historyitem_Workbook_SheetMove === Item.Type || historyitem_Workbook_SheetPositions === Item.Type)) {
bUpdateWorksheetByModel = true;
bOnSheetsChanged = true;
}
else if (g_oUndoRedoWorksheet === Item.Class && (historyitem_Worksheet_Rename === Item.Type || historyitem_Worksheet_Hide === Item.Type))
bOnSheetsChanged = true;
} }
var wsViews = Asc["editor"].wb.wsViews; var wsViews = Asc["editor"].wb.wsViews;
for(var i = 0; i < wsViews.length; ++i) for(var i = 0; i < wsViews.length; ++i)
...@@ -450,7 +458,10 @@ CHistory.prototype = ...@@ -450,7 +458,10 @@ CHistory.prototype =
for(var i in oChangeWorksheetUpdate) for(var i in oChangeWorksheetUpdate)
this.workbook.handlers.trigger("changeWorksheetUpdate", oChangeWorksheetUpdate[i]); this.workbook.handlers.trigger("changeWorksheetUpdate", oChangeWorksheetUpdate[i]);
} }
if (bUpdateWorksheetByModel)
this.workbook.handlers.trigger("updateWorksheetByModel");
if (bOnSheetsChanged)
this.workbook.handlers.trigger("asc_onSheetsChanged");
this._sendCanUndoRedo(); this._sendCanUndoRedo();
...@@ -511,11 +522,17 @@ CHistory.prototype = ...@@ -511,11 +522,17 @@ CHistory.prototype =
} }
if (g_oUndoRedoWorksheet === Class && historyitem_Worksheet_SetViewSettings === Type) if (g_oUndoRedoWorksheet === Class && historyitem_Worksheet_SetViewSettings === Type)
oRedoObjectParam.bIsReInit = true; oRedoObjectParam.bIsReInit = true;
if (g_oUndoRedoWorksheet === Class && (historyitem_Worksheet_RowProp == Type || historyitem_Worksheet_ColProp == Type)) else if (g_oUndoRedoWorksheet === Class && (historyitem_Worksheet_RowProp == Type || historyitem_Worksheet_ColProp == Type))
{ {
oRedoObjectParam.bChangeWorksheetUpdate = true; oRedoObjectParam.bChangeWorksheetUpdate = true;
oRedoObjectParam.oChangeWorksheetUpdate[sheetid] = sheetid; oRedoObjectParam.oChangeWorksheetUpdate[sheetid] = sheetid;
} }
else if (g_oUndoRedoWorkbook === Class && (historyitem_Workbook_SheetAdd === Type || historyitem_Workbook_SheetRemove === Type || historyitem_Workbook_SheetMove === Type || historyitem_Workbook_SheetPositions === Type)) {
oRedoObjectParam.bUpdateWorksheetByModel = true;
oRedoObjectParam.bOnSheetsChanged = true;
}
else if (g_oUndoRedoWorksheet === Class && (historyitem_Worksheet_Rename === Type || historyitem_Worksheet_Hide === Type))
oRedoObjectParam.bOnSheetsChanged = true;
}, },
RedoExecute : function(Point, oRedoObjectParam) RedoExecute : function(Point, oRedoObjectParam)
{ {
...@@ -537,11 +554,17 @@ CHistory.prototype = ...@@ -537,11 +554,17 @@ CHistory.prototype =
} }
if (g_oUndoRedoWorksheet === Item.Class && historyitem_Worksheet_SetViewSettings === Item.Type) if (g_oUndoRedoWorksheet === Item.Class && historyitem_Worksheet_SetViewSettings === Item.Type)
oRedoObjectParam.bIsReInit = true; oRedoObjectParam.bIsReInit = true;
if (g_oUndoRedoWorksheet === Item.Class && (historyitem_Worksheet_RowProp == Item.Type || historyitem_Worksheet_ColProp == Item.Type)) else if (g_oUndoRedoWorksheet === Item.Class && (historyitem_Worksheet_RowProp == Item.Type || historyitem_Worksheet_ColProp == Item.Type))
{ {
oRedoObjectParam.bChangeWorksheetUpdate = true; oRedoObjectParam.bChangeWorksheetUpdate = true;
oRedoObjectParam.oChangeWorksheetUpdate[Item.SheetId] = Item.SheetId; oRedoObjectParam.oChangeWorksheetUpdate[Item.SheetId] = Item.SheetId;
} }
else if (g_oUndoRedoWorkbook === Item.Class && (historyitem_Workbook_SheetAdd === Item.Type || historyitem_Workbook_SheetRemove === Item.Type || historyitem_Workbook_SheetMove === Item.Type || historyitem_Workbook_SheetPositions === Item.Type)) {
oRedoObjectParam.bUpdateWorksheetByModel = true;
oRedoObjectParam.bOnSheetsChanged = true;
}
else if (g_oUndoRedoWorksheet === Item.Class && (historyitem_Worksheet_Rename === Item.Type || historyitem_Worksheet_Hide === Item.Type))
oRedoObjectParam.bOnSheetsChanged = true;
} }
CollaborativeEditing.Apply_LinkData(); CollaborativeEditing.Apply_LinkData();
var wsViews = Asc["editor"].wb.wsViews; var wsViews = Asc["editor"].wb.wsViews;
...@@ -601,6 +624,10 @@ CHistory.prototype = ...@@ -601,6 +624,10 @@ CHistory.prototype =
for(var i in oRedoObjectParam.oChangeWorksheetUpdate) for(var i in oRedoObjectParam.oChangeWorksheetUpdate)
this.workbook.handlers.trigger("changeWorksheetUpdate", oRedoObjectParam.oChangeWorksheetUpdate[i]); this.workbook.handlers.trigger("changeWorksheetUpdate", oRedoObjectParam.oChangeWorksheetUpdate[i]);
} }
if (oRedoObjectParam.bUpdateWorksheetByModel)
this.workbook.handlers.trigger("updateWorksheetByModel");
if (oRedoObjectParam.bOnSheetsChanged)
this.workbook.handlers.trigger("asc_onSheetsChanged");
//if (Point.SelectionState != null) //if (Point.SelectionState != null)
// this.workbook.handlers.trigger("setSelectionState", Point.SelectionState); // this.workbook.handlers.trigger("setSelectionState", Point.SelectionState);
......
...@@ -2772,11 +2772,6 @@ UndoRedoWorkbook.prototype = { ...@@ -2772,11 +2772,6 @@ UndoRedoWorkbook.prototype = {
this.wb.theme.themeElements.clrScheme = Data.newVal; this.wb.theme.themeElements.clrScheme = Data.newVal;
this.wb.oApi.asc_AfterChangeColorScheme(); this.wb.oApi.asc_AfterChangeColorScheme();
} }
if(bNeedTrigger)
{
this.wb.handlers.trigger("updateWorksheetByModel");
this.wb.handlers.trigger("asc_onSheetsChanged");
}
} }
}; };
...@@ -3243,7 +3238,6 @@ UndoRedoWoorksheet.prototype = { ...@@ -3243,7 +3238,6 @@ UndoRedoWoorksheet.prototype = {
} }
ws.setName(name); ws.setName(name);
} }
ws.workbook.handlers.trigger("asc_onSheetsChanged");
} }
else if(historyitem_Worksheet_Hide == Type) else if(historyitem_Worksheet_Hide == Type)
{ {
...@@ -3251,7 +3245,6 @@ UndoRedoWoorksheet.prototype = { ...@@ -3251,7 +3245,6 @@ UndoRedoWoorksheet.prototype = {
ws.setHidden(Data.from); ws.setHidden(Data.from);
else else
ws.setHidden(Data.to); ws.setHidden(Data.to);
ws.workbook.handlers.trigger("asc_onSheetsChanged");
} }
else if(historyitem_Worksheet_CreateRow == Type) else if(historyitem_Worksheet_CreateRow == Type)
{ {
......
...@@ -1161,6 +1161,8 @@ ...@@ -1161,6 +1161,8 @@
this.bIsReInit = false; this.bIsReInit = false;
this.bChangeWorksheetUpdate = false; this.bChangeWorksheetUpdate = false;
this.oChangeWorksheetUpdate = {}; this.oChangeWorksheetUpdate = {};
this.bUpdateWorksheetByModel = false;
this.bOnSheetsChanged = false;
} }
/** @constructor */ /** @constructor */
......
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