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

fix bug 36162

delete asc_LoadEmptyDocument, now use asc_LoadDocument with url = offlineMode
delete set relative path to document in offlineMode
in offlineMode load empty document with flag chartEditor (previously loaded deprecated test document).
parent ead0ea78
......@@ -284,11 +284,6 @@ var editor;
return AscCommon.g_oDefaultCultureInfo.LCID;
};
spreadsheet_api.prototype.asc_LoadEmptyDocument = function() {
this.CoAuthoringApi.auth(this.getViewMode());
this.onEndLoadFile(true);
};
spreadsheet_api.prototype._openDocument = function(data) {
var wb = new AscCommonExcel.Workbook(this.handlers, this);
this.initGlobalObjects(wb);
......@@ -676,11 +671,8 @@ var editor;
};
spreadsheet_api.prototype._OfflineAppDocumentEndLoad = function() {
var data = getTestWorkbook();
var sData = data + "";
if (AscCommon.c_oSerFormat.Signature === sData.substring(0, AscCommon.c_oSerFormat.Signature.length)) {
this.openDocument(sData);
}
this.isChartEditor = true;
this.onEndLoadFile(AscCommonExcel.getEmptyWorkbook());
};
spreadsheet_api.prototype._asc_save2 = function () {
......@@ -942,15 +934,6 @@ var editor;
spreadsheet_api.prototype.openDocument = function(sData) {
var t = this;
if (true === sData) {
// Empty Document
sData = AscCommonExcel.getEmptyWorkbook() + "";
if (sData.length && (AscCommon.c_oSerFormat.Signature === sData.substring(0, AscCommon.c_oSerFormat.Signature.length))) {
this.isChartEditor = true;
} else {
return;
}
}
this.wbModel = this._openDocument(sData);
this.openDocumentFromZip(this.wbModel, AscCommon.g_oDocumentUrls.getUrl('Editor.xlsx')).then(function() {
t.FontLoader.LoadDocumentFonts(t.wbModel.generateFontMap2());
......@@ -3561,7 +3544,6 @@ var editor;
prot["asc_getLocale"] = prot.asc_getLocale;
prot["asc_getEditorPermissions"] = prot.asc_getEditorPermissions;
prot["asc_LoadDocument"] = prot.asc_LoadDocument;
prot["asc_LoadEmptyDocument"] = prot.asc_LoadEmptyDocument;
prot["asc_DownloadAs"] = prot.asc_DownloadAs;
prot["asc_Save"] = prot.asc_Save;
prot["forceSave"] = prot.forceSave;
......
......@@ -280,7 +280,6 @@
if (AscCommon.offlineMode === this.documentUrl)
{
this.documentUrl = '/sdkjs/' + this._editorNameById() + '/document/';
this.DocInfo.put_OfflineApp(true);
}
......@@ -469,16 +468,7 @@
};
baseEditorsApi.prototype._OfflineAppDocumentStartLoad = function()
{
var t = this;
var scriptElem = document.createElement('script');
scriptElem.onload = scriptElem.onerror = function()
{
t._OfflineAppDocumentEndLoad();
};
scriptElem.setAttribute('src', this.documentUrl + 'editor.js');
scriptElem.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(scriptElem);
this._OfflineAppDocumentEndLoad();
};
baseEditorsApi.prototype._onOpenCommand = function(data)
{
......
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