Commit fb7b9641 authored by Alexey.Musinov's avatar Alexey.Musinov

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into develop

* 'develop' of https://github.com/ONLYOFFICE/sdkjs:
  Added SetPr function for filling up all properties of a CBlockLevelSdt class at once.
parents 6458dadc 06979ad8
...@@ -64,6 +64,7 @@ CBlockLevelSdt.prototype.Copy = function(Parent) ...@@ -64,6 +64,7 @@ CBlockLevelSdt.prototype.Copy = function(Parent)
{ {
var oNew = new CBlockLevelSdt(this.LogicDocument, Parent ? Parent : this.Parent); var oNew = new CBlockLevelSdt(this.LogicDocument, Parent ? Parent : this.Parent);
oNew.Content.Copy2(this.Content); oNew.Content.Copy2(this.Content);
oNew.SetPr(this.Pr);
return oNew; return oNew;
}; };
CBlockLevelSdt.prototype.GetType = function() CBlockLevelSdt.prototype.GetType = function()
...@@ -843,10 +844,20 @@ CBlockLevelSdt.prototype.GetDocumentPositionFromObject = function(PosArray) ...@@ -843,10 +844,20 @@ CBlockLevelSdt.prototype.GetDocumentPositionFromObject = function(PosArray)
return PosArray; return PosArray;
}; };
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt.prototype.SetPr = function(oPr)
{
this.SetAlias(oPr.Alias);
this.SetTag(oPr.Tag);
this.SetLabel(oPr.Label);
this.SetContentControlLock(oPr.Lock);
};
CBlockLevelSdt.prototype.SetAlias = function(sAlias) CBlockLevelSdt.prototype.SetAlias = function(sAlias)
{ {
History.Add(new CChangesSdtPrAlias(this, this.Pr.Alias, sAlias)); if (sAlias !== this.Pr.Alias)
this.Pr.Alias = sAlias; {
History.Add(new CChangesSdtPrAlias(this, this.Pr.Alias, sAlias));
this.Pr.Alias = sAlias;
}
}; };
CBlockLevelSdt.prototype.GetAlias = function() CBlockLevelSdt.prototype.GetAlias = function()
{ {
...@@ -854,8 +865,11 @@ CBlockLevelSdt.prototype.GetAlias = function() ...@@ -854,8 +865,11 @@ CBlockLevelSdt.prototype.GetAlias = function()
}; };
CBlockLevelSdt.prototype.SetContentControlId = function(Id) CBlockLevelSdt.prototype.SetContentControlId = function(Id)
{ {
History.Add(new CChangesSdtPrId(this, this.Pr.Id, Id)); if (this.Pr.Id !== Id)
this.Pr.Id = Id; {
History.Add(new CChangesSdtPrId(this, this.Pr.Id, Id));
this.Pr.Id = Id;
}
}; };
CBlockLevelSdt.prototype.GetContentControlId = function() CBlockLevelSdt.prototype.GetContentControlId = function()
{ {
...@@ -863,8 +877,11 @@ CBlockLevelSdt.prototype.GetContentControlId = function() ...@@ -863,8 +877,11 @@ CBlockLevelSdt.prototype.GetContentControlId = function()
}; };
CBlockLevelSdt.prototype.SetTag = function(sTag) CBlockLevelSdt.prototype.SetTag = function(sTag)
{ {
History.Add(new CChangesSdtPrTag(this, this.Pr.Tag, sTag)); if (this.Pr.Tag !== sTag)
this.Pr.Tag = sTag; {
History.Add(new CChangesSdtPrTag(this, this.Pr.Tag, sTag));
this.Pr.Tag = sTag;
}
}; };
CBlockLevelSdt.prototype.GetTag = function() CBlockLevelSdt.prototype.GetTag = function()
{ {
...@@ -872,8 +889,11 @@ CBlockLevelSdt.prototype.GetTag = function() ...@@ -872,8 +889,11 @@ CBlockLevelSdt.prototype.GetTag = function()
}; };
CBlockLevelSdt.prototype.SetLabel = function(sLabel) CBlockLevelSdt.prototype.SetLabel = function(sLabel)
{ {
History.Add(new CChangesSdtPrLabel(this, this.Pr.Label, sLabel)); if (this.Pr.Label !== sLabel)
this.Pr.Label = sLabel; {
History.Add(new CChangesSdtPrLabel(this, this.Pr.Label, sLabel));
this.Pr.Label = sLabel;
}
}; };
CBlockLevelSdt.prototype.GetLabel = function() CBlockLevelSdt.prototype.GetLabel = function()
{ {
...@@ -881,8 +901,11 @@ CBlockLevelSdt.prototype.GetLabel = function() ...@@ -881,8 +901,11 @@ CBlockLevelSdt.prototype.GetLabel = function()
}; };
CBlockLevelSdt.prototype.SetContentControlLock = function(nLockType) CBlockLevelSdt.prototype.SetContentControlLock = function(nLockType)
{ {
History.Add(new CChangesSdtPrLock(this, this.Pr.Lock, nLockType)); if (this.Pr.Lock !== nLockType)
this.Pr.Lock = nLockType; {
History.Add(new CChangesSdtPrLock(this, this.Pr.Lock, nLockType));
this.Pr.Lock = nLockType;
}
}; };
CBlockLevelSdt.prototype.GetContentControlLock = function() CBlockLevelSdt.prototype.GetContentControlLock = function()
{ {
......
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