mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
Added lock check before changing the macros data.
This commit is contained in:
@ -1028,6 +1028,9 @@
|
||||
case AscDFH.historydescription_Document_ChangeContentControlProperties:
|
||||
sString = "Document_ChangeContentControlProperties";
|
||||
break;
|
||||
case AscDFH.historydescription_DocumentMacros_Data:
|
||||
sString = "DocumentMacros_Data";
|
||||
break;
|
||||
}
|
||||
return sString;
|
||||
}
|
||||
@ -2940,6 +2943,7 @@
|
||||
window['AscDFH'].historydescription_Document_RemoveContentControlWrapper = 0x0144;
|
||||
window['AscDFH'].historydescription_Document_ChangeContentControlProperties = 0x0145;
|
||||
window['AscDFH'].historydescription_Presentation_HideSlides = 0x0146;
|
||||
window['AscDFH'].historydescription_DocumentMacros_Data = 0x0147;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -176,6 +176,8 @@
|
||||
|
||||
this.currentPassword = "";
|
||||
|
||||
this.marcos = null;
|
||||
|
||||
//config['watermark_on_draw'] = window.TEST_WATERMARK_STRING;
|
||||
this.watermarkDraw = ((config['watermark_on_draw'] !== undefined) && (config['watermark_on_draw'] != "")) ?
|
||||
new AscCommon.CWatermarkOnDraw(config['watermark_on_draw']) : null;
|
||||
@ -1198,6 +1200,8 @@
|
||||
if (!window['IS_NATIVE_EDITOR']) {
|
||||
setInterval(function() {t._autoSave();}, 40);
|
||||
}
|
||||
|
||||
this.marcos = new AscCommon.CDocumentMacros();
|
||||
};
|
||||
|
||||
baseEditorsApi.prototype.sendStandartTextures = function()
|
||||
@ -1759,6 +1763,25 @@
|
||||
this.asc_Save(false);
|
||||
};
|
||||
|
||||
baseEditorsApi.prototype.asc_setMacros = function(sData)
|
||||
{
|
||||
if (true === AscCommon.CollaborativeEditing.Get_GlobalLock())
|
||||
return true;
|
||||
|
||||
AscCommon.CollaborativeEditing.OnStart_CheckLock();
|
||||
this.marcos.CheckLock();
|
||||
|
||||
if (false === AscCommon.CollaborativeEditing.OnEnd_CheckLock(false))
|
||||
{
|
||||
AscCommon.History.Create_NewPoint(AscDFH.historydescription_DocumentMacros_Data);
|
||||
this.macros.SetData(sData);
|
||||
}
|
||||
};
|
||||
baseEditorsApi.prototype.asc_getMacros = function()
|
||||
{
|
||||
return this.macros.GetData();
|
||||
};
|
||||
|
||||
//----------------------------------------------------------export----------------------------------------------------
|
||||
window['AscCommon'] = window['AscCommon'] || {};
|
||||
window['AscCommon'].baseEditorsApi = baseEditorsApi;
|
||||
|
||||
@ -3217,6 +3217,4 @@
|
||||
prot["destroy"] = prot.destroy;
|
||||
|
||||
window["AscCommon"].translateManager = new CTranslateManager();
|
||||
|
||||
window["AscCommon"].CDocumentMacros = CDocumentMacros;
|
||||
})(window);
|
||||
|
||||
@ -43,6 +43,8 @@ function (window, undefined)
|
||||
{
|
||||
this.Id = AscCommon.g_oIdCounter.Get_NewId();
|
||||
|
||||
this.Lock = new AscCommon.CLock();
|
||||
|
||||
this.Data = "";
|
||||
|
||||
AscCommon.g_oTableId.Add(this, this.Id);
|
||||
@ -56,6 +58,10 @@ function (window, undefined)
|
||||
{
|
||||
return this.Data;
|
||||
};
|
||||
CDocumentMacros.prototype.CheckLock = function()
|
||||
{
|
||||
this.Lock.Check(this.Id);
|
||||
};
|
||||
CDocumentMacros.prototype.Write_ToBinary2 = function(Writer)
|
||||
{
|
||||
Writer.WriteLong(AscDFH.historyitem_type_DocumentMacros);
|
||||
|
||||
Reference in New Issue
Block a user