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)
{
var oNew = new CBlockLevelSdt(this.LogicDocument, Parent ? Parent : this.Parent);
oNew.Content.Copy2(this.Content);
oNew.SetPr(this.Pr);
return oNew;
};
CBlockLevelSdt.prototype.GetType = function()
......@@ -843,10 +844,20 @@ CBlockLevelSdt.prototype.GetDocumentPositionFromObject = function(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)
{
if (sAlias !== this.Pr.Alias)
{
History.Add(new CChangesSdtPrAlias(this, this.Pr.Alias, sAlias));
this.Pr.Alias = sAlias;
}
};
CBlockLevelSdt.prototype.GetAlias = function()
{
......@@ -854,8 +865,11 @@ CBlockLevelSdt.prototype.GetAlias = function()
};
CBlockLevelSdt.prototype.SetContentControlId = function(Id)
{
if (this.Pr.Id !== Id)
{
History.Add(new CChangesSdtPrId(this, this.Pr.Id, Id));
this.Pr.Id = Id;
}
};
CBlockLevelSdt.prototype.GetContentControlId = function()
{
......@@ -863,8 +877,11 @@ CBlockLevelSdt.prototype.GetContentControlId = function()
};
CBlockLevelSdt.prototype.SetTag = function(sTag)
{
if (this.Pr.Tag !== sTag)
{
History.Add(new CChangesSdtPrTag(this, this.Pr.Tag, sTag));
this.Pr.Tag = sTag;
}
};
CBlockLevelSdt.prototype.GetTag = function()
{
......@@ -872,8 +889,11 @@ CBlockLevelSdt.prototype.GetTag = function()
};
CBlockLevelSdt.prototype.SetLabel = function(sLabel)
{
if (this.Pr.Label !== sLabel)
{
History.Add(new CChangesSdtPrLabel(this, this.Pr.Label, sLabel));
this.Pr.Label = sLabel;
}
};
CBlockLevelSdt.prototype.GetLabel = function()
{
......@@ -881,8 +901,11 @@ CBlockLevelSdt.prototype.GetLabel = function()
};
CBlockLevelSdt.prototype.SetContentControlLock = function(nLockType)
{
if (this.Pr.Lock !== nLockType)
{
History.Add(new CChangesSdtPrLock(this, this.Pr.Lock, nLockType));
this.Pr.Lock = nLockType;
}
};
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