check format on saving

This commit is contained in:
Sergey Luzyanin
2022-11-03 17:27:55 +03:00
parent 67703b04b3
commit fccc792757
2 changed files with 13 additions and 16 deletions

View File

@ -167,13 +167,15 @@
this.SignRequest.toXml(writer, oUsersIdMap);
}
writer.WriteXmlNodeEnd("FieldMaster");
if(this.Field) {
let oPart = writer.context.docPart.part.addPartWithoutRels(AscCommon.openXml.Types.field);
let oMemory = new AscCommon.CMemory();
oMemory.context = writer.context;
oPart.setDataXml(this.Field, oMemory);
oMemory.Seek(0);
oPart.addRelationship(AscCommon.openXml.Types.fieldMaster.relationType, oContext.part.uri)
if(writer.context.fileType === Asc.c_oAscFileType.OFORM) {
if(this.Field) {
let oPart = writer.context.docPart.part.addPartWithoutRels(AscCommon.openXml.Types.field);
let oMemory = new AscCommon.CMemory();
oMemory.context = writer.context;
oPart.setDataXml(this.Field, oMemory);
oMemory.Seek(0);
oPart.addRelationship(AscCommon.openXml.Types.fieldMaster.relationType, oContext.part.uri)
}
}
};

View File

@ -300,16 +300,11 @@
for(let nFldMaster = 0; nFldMaster < this.Fields.length; ++nFldMaster) {
let oFieldMaster = this.Fields[nFldMaster];
let oPart = oFldMasterPartMap[oFieldMaster.Id];
if(!oPart) {
oPart = writer.context.part.addPart(AscCommon.openXml.Types.fieldMaster);
let oFldMemory = new AscCommon.CMemory();
oFldMemory.context = writer.context;
oPart.part.setDataXml(oFieldMaster, oFldMemory);
oFldMasterPartMap[oFieldMaster.Id] = oPart;
if(oPart) {
let oNode = new CT_XmlNode();
oNode.attributes["r:id"] = oContext.part.addRelationship(AscCommon.openXml.Types.fieldMaster.relationType, oPart.part.uri);
oNode.toXml(writer, "Field");
}
let oNode = new CT_XmlNode();
oNode.attributes["r:id"] = oContext.part.addRelationship(AscCommon.openXml.Types.fieldMaster.relationType, oPart.part.uri);
oNode.toXml(writer, "Field");
}
writer.WriteXmlNodeEnd("FieldsGroup");