[oform] Write main part to xml

This commit is contained in:
KirillovIlya
2022-12-23 13:49:57 +03:00
parent 902e1f2373
commit d223836a85
2 changed files with 11 additions and 3 deletions

View File

@ -220,7 +220,11 @@
};
CDocument.prototype.toPkg = function(xmlPkg)
{
let xmlWriter = xmlPkg.getXmlWriter();
let main = xmlPkg.addPart(AscCommon.openXml.Types.oformMain);
xmlWriter.Seek(0);
main.part.setDataXml(this, xmlWriter);
};
CDocument.prototype.fromXml = function(reader)
{
@ -291,7 +295,7 @@
for (let fgIndex = 0, fgCount = this.FieldGroups.length; fgIndex < fgCount; ++fgIndex)
{
this.FieldsGroups[fgIndex].toXml(writer);
this.FieldGroups[fgIndex].toXml(writer);
}
writer.WriteXmlNodeEnd("document");

View File

@ -51,7 +51,7 @@
{
let zip = this.zip;
let pkg = this;
zip.files.forEach(function(path)
zip.getPaths().forEach(function(path)
{
if (!path.endsWith("/"))
{
@ -78,6 +78,10 @@
{
this.context = context;
};
XmlPackage.prototype.getXmlWriter = function()
{
return this.xmlWriter;
};
//--------------------------------------------------------export----------------------------------------------------
AscOForm.XmlPackage = XmlPackage;