[de] Fix DataBinding

This commit is contained in:
Ilya Kirillov
2025-05-21 16:19:45 +03:00
parent 2b725d9829
commit 4ebe628008
2 changed files with 8 additions and 16 deletions

View File

@ -58,7 +58,6 @@ function CSdtPr()
this.Date = undefined;
this.Equation = false;
this.TextForm = undefined;
this.DataBinding = false;
this.TextPr = new CTextPr();
@ -293,13 +292,7 @@ CSdtPr.prototype.Write_ToBinary = function(Writer)
this.ShdColor.toBinary(Writer);
Flags |= (1 << 25);
}
if (this.DataBinding)
{
this.DataBinding.toBinary(Writer);
Flags |= (1 << 26);
}
var EndPos = Writer.GetCurPosition();
Writer.Seek(StartPos);
Writer.WriteLong(Flags);
@ -413,9 +406,6 @@ CSdtPr.prototype.Read_FromBinary = function(Reader)
if (Flags & (1 << 25))
this.ShdColor = AscWord.CDocumentColorA.fromBinary(Reader);
if (Flags & (1 << 26))
this.DataBinding = AscWord.DataBinding.fromBinary(Reader);
};
CSdtPr.prototype.IsBuiltInDocPart = function()
{
@ -515,11 +505,7 @@ CContentControlPr.prototype.FillFromObject = function(oPr)
this.BorderColor = AscWord.CDocumentColorA.fromObjectRgba(oPr.BorderColor);
if (undefined !== oPr.DataBinding)
{
let oDataBinding = new AscWord.DataBinding();
oDataBinding.fillFromObject(oPr.DataBinding);
this.DataBinding = oDataBinding;
}
this.DataBinding = AscWord.DataBinding.fromObject(oPr.DataBinding);
};
CContentControlPr.prototype.FillFromContentControl = function(oContentControl)
{

View File

@ -88,6 +88,12 @@
data.Read_FromBinary(reader);
return data;
};
DataBinding.fromObject = function(obj)
{
let data = new DataBinding();
data.fillFromObject(obj);
return data;
};
DataBinding.prototype.Write_ToBinary = function(writer)
{
let startPos = writer.GetCurPosition();