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

инициализация глобальных переменных перенесена из Workbook в Api

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52299 954022d7-b5bf-4e40-9824-e11837661b57
parent 941187f5
...@@ -478,13 +478,34 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -478,13 +478,34 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_OpenDocument: function(url, data) asc_OpenDocument: function(url, data)
{ {
var wb = new Workbook(url, this.handlers, this); var wb = new Workbook(url, this.handlers, this);
wb.initGlobalObjects(); this.initGlobalObjects(wb);
this.wbModel = wb; this.wbModel = wb;
var oBinaryFileReader = new BinaryFileReader(url); var oBinaryFileReader = new BinaryFileReader(url);
oBinaryFileReader.Read(data, wb); oBinaryFileReader.Read(data, wb);
return wb; return wb;
}, },
initGlobalObjects: function(wbModel)
{
// Histoey & global counters
History = new CHistory(wbModel);
g_oIdCounter = new CIdCounter();
g_oTableId = new CTableId();
if ( this.User )
g_oIdCounter.Set_UserId(this.User.asc_getId());
g_oUndoRedoCell = new UndoRedoCell(wbModel);
g_oUndoRedoWorksheet = new UndoRedoWoorksheet(wbModel);
g_oUndoRedoWorkbook = new UndoRedoWorkbook(wbModel);
g_oUndoRedoCol = new UndoRedoRowCol(wbModel, false);
g_oUndoRedoRow = new UndoRedoRowCol(wbModel, true);
g_oUndoRedoComment = new UndoRedoComment(wbModel);
g_oUndoRedoAutoFilters = new UndoRedoAutoFilters(wbModel);
g_oUndoRedoGraphicObjects = new UndoRedoGraphicObjects(wbModel);
g_oIdCounter.Set_Load(false);
},
asc_getEditorPermissions : function(){ asc_getEditorPermissions : function(){
if (this.DocInfo && if (this.DocInfo &&
this.DocInfo["Id"] && this.DocInfo["Id"] &&
......
...@@ -1407,14 +1407,6 @@ function Workbook(sUrlPath, eventsHandlers, oApi){ ...@@ -1407,14 +1407,6 @@ function Workbook(sUrlPath, eventsHandlers, oApi){
this.dependencyFormulas = new DependencyGraph(this); this.dependencyFormulas = new DependencyGraph(this);
this.nActive = 0; this.nActive = 0;
// Histoey & global counters
History = new CHistory(this);
g_oIdCounter = new CIdCounter();
g_oTableId = new CTableId();
if ( this.oApi.User )
g_oIdCounter.Set_UserId(this.oApi.User.asc_getId());
this.theme = null; this.theme = null;
this.clrSchemeMap = null; this.clrSchemeMap = null;
...@@ -1436,17 +1428,6 @@ function Workbook(sUrlPath, eventsHandlers, oApi){ ...@@ -1436,17 +1428,6 @@ function Workbook(sUrlPath, eventsHandlers, oApi){
this.bRedoChanges = false; this.bRedoChanges = false;
this.aCollaborativeChangeElements = new Array(); this.aCollaborativeChangeElements = new Array();
}; };
Workbook.prototype.initGlobalObjects=function(){
g_oUndoRedoCell = new UndoRedoCell(this);
g_oUndoRedoWorksheet = new UndoRedoWoorksheet(this);
g_oUndoRedoWorkbook = new UndoRedoWorkbook(this);
g_oUndoRedoCol = new UndoRedoRowCol(this, false);
g_oUndoRedoRow = new UndoRedoRowCol(this, true);
g_oUndoRedoComment = new UndoRedoComment(this);
g_oUndoRedoAutoFilters = new UndoRedoAutoFilters(this);
g_oUndoRedoGraphicObjects = new UndoRedoGraphicObjects(this);
g_oIdCounter.Set_Load(false);
}
Workbook.prototype.init=function(){ Workbook.prototype.init=function(){
if(this.nActive < 0) if(this.nActive < 0)
this.nActive = 0; this.nActive = 0;
......
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