fix: multiple def of header/footer attributes

This commit is contained in:
moritz-tr
2019-07-22 17:36:13 +02:00
parent 9e8d67c4a9
commit ec5a678f05
2 changed files with 55 additions and 52 deletions

View File

@ -10,6 +10,7 @@ export class Footer extends InitializableXmlComponent {
constructor(referenceNumber: number, initContent?: XmlComponent) { constructor(referenceNumber: number, initContent?: XmlComponent) {
super("w:ftr", initContent); super("w:ftr", initContent);
this.refId = referenceNumber; this.refId = referenceNumber;
if (!initContent) {
this.root.push( this.root.push(
new FooterAttributes({ new FooterAttributes({
wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
@ -31,6 +32,7 @@ export class Footer extends InitializableXmlComponent {
}), }),
); );
} }
}
public get ReferenceId(): number { public get ReferenceId(): number {
return this.refId; return this.refId;

View File

@ -11,7 +11,7 @@ export class Header extends InitializableXmlComponent {
super("w:hdr", initContent); super("w:hdr", initContent);
this.refId = referenceNumber; this.refId = referenceNumber;
if (!initContent) {
this.root.push( this.root.push(
new HeaderAttributes({ new HeaderAttributes({
wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
@ -44,6 +44,7 @@ export class Header extends InitializableXmlComponent {
}), }),
); );
} }
}
public get ReferenceId(): number { public get ReferenceId(): number {
return this.refId; return this.refId;