Commit 4d31bd19 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

правки для локальной версии

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66583 954022d7-b5bf-4e40-9824-e11837661b57
parent 8b5d1430
...@@ -13,10 +13,12 @@ ...@@ -13,10 +13,12 @@
var asc = window["Asc"]; var asc = window["Asc"];
var prot; var prot;
var _fOpenCallBack = undefined;
asc['spreadsheet_api'].prototype._OfflineAppDocumentStartLoad = function(fCallback) asc['spreadsheet_api'].prototype._OfflineAppDocumentStartLoad = function(fCallback)
{ {
window.OfflineOpenCallback = fCallback; _fOpenCallBack = fCallback;
window["AscDesktopEditor"]["LocalStartOpen"](); window["AscDesktopEditor"]["LocalStartOpen"]();
}; };
...@@ -25,8 +27,8 @@ ...@@ -25,8 +27,8 @@
if (true) if (true)
{ {
var wb = this._openDocument(_data); var wb = this._openDocument(_data);
window.OfflineOpenCallback({returnCode: 0, val: wb}); _fOpenCallBack({returnCode: 0, val: wb});
window.OfflineOpenCallback = undefined; _fOpenCallBack = undefined;
History.UserSaveMode = true; History.UserSaveMode = true;
} }
...@@ -89,34 +91,22 @@ CHistory.prototype.Reset_SavedIndex = function(IsUserSave) ...@@ -89,34 +91,22 @@ CHistory.prototype.Reset_SavedIndex = function(IsUserSave)
this.ForceSave = false; this.ForceSave = false;
} }
}; };
CHistory.prototype.Have_Changes = function(IsUserSave)
CHistory.prototype.Is_Modified = function(IsUserSave)
{ {
if (true === this.Is_UserSaveMode() && false !== IsUserSave) var checkIndex = (this.Is_UserSaveMode() && IsUserSave) ? this.UserSavedIndex : this.SavedIndex;
if (-1 === this.Index && null === checkIndex && false === this.ForceSave)
{ {
if (-1 === this.Index && null === this.UserSavedIndex && false === this.ForceSave) if (window["AscDesktopEditor"])
{ {
if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]()) if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]())
return true; return true;
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]()) if (!window["AscDesktopEditor"]["LocalFileGetSaved"]())
return true; return true;
return false;
} }
if (this.Index != this.UserSavedIndex || true === this.ForceSave)
return true;
return false;
}
else
{
if (-1 === this.Index && null === this.SavedIndex && false === this.ForceSave)
return false;
if (this.Index != this.SavedIndex || true === this.ForceSave)
return true;
return false; return false;
} }
return (this.Index != checkIndex || true === this.ForceSave);
}; };
window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes) window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
......
...@@ -56,10 +56,13 @@ CHistory.prototype.Have_Changes = function(IsUserSave) ...@@ -56,10 +56,13 @@ CHistory.prototype.Have_Changes = function(IsUserSave)
{ {
if (-1 === this.Index && null === this.UserSavedIndex && false === this.ForceSave) if (-1 === this.Index && null === this.UserSavedIndex && false === this.ForceSave)
{ {
if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]()) if (window["AscDesktopEditor"])
return true; {
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]()) if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]())
return true; return true;
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]())
return true;
}
return false; return false;
} }
......
...@@ -62,10 +62,13 @@ CHistory.prototype.Have_Changes = function(IsUserSave) ...@@ -62,10 +62,13 @@ CHistory.prototype.Have_Changes = function(IsUserSave)
{ {
if (-1 === this.Index && null === this.UserSavedIndex && false === this.ForceSave) if (-1 === this.Index && null === this.UserSavedIndex && false === this.ForceSave)
{ {
if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]()) if (window["AscDesktopEditor"])
return true; {
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]()) if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]())
return true; return true;
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]())
return true;
}
return false; return false;
} }
......
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