From 98ecc5c53f59a8c688a345fbd0cb716c50bf0a00 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Wed, 6 Apr 2016 01:08:53 +0100 Subject: [PATCH] put contents inside sectPr --- ts/docx/document/body/index.ts | 12 ++---------- ts/docx/document/body/section-properties.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ts/docx/document/body/index.ts b/ts/docx/document/body/index.ts index 7956fa2e5a..4f86bd0c84 100644 --- a/ts/docx/document/body/index.ts +++ b/ts/docx/document/body/index.ts @@ -1,9 +1,5 @@ import {XmlComponent, Attributes} from "../../xml-components"; import {SectionProperties} from "./section-properties"; -import {PageSize} from "./page-size"; -import {PageMargin} from "./page-margin"; -import {Columns} from "./columns"; -import {DocumentGrid} from "./doc-grid"; export class Body implements XmlComponent { private body: Array; @@ -14,14 +10,10 @@ export class Body implements XmlComponent { constructor() { this.body = new Array(); - this.body.push(new SectionProperties()); - this.body.push(new PageSize()); - this.body.push(new PageMargin()); - this.body.push(new Columns()); - this.body.push(new DocumentGrid()); + //this.body.push(new SectionProperties()); } push(component: XmlComponent) { - this.body.push(component); + this.body.splice(this.body.length - 1, 0, component); } } diff --git a/ts/docx/document/body/section-properties.ts b/ts/docx/document/body/section-properties.ts index 30803ea6fa..86f4e67fcd 100644 --- a/ts/docx/document/body/section-properties.ts +++ b/ts/docx/document/body/section-properties.ts @@ -1,12 +1,16 @@ import {XmlComponent, Attributes} from "../../xml-components"; +import {PageSize} from "./page-size"; +import {PageMargin} from "./page-margin"; +import {Columns} from "./columns"; +import {DocumentGrid} from "./doc-grid"; export class SectionProperties implements XmlComponent { private sectPr: Array; - + xmlKeys = { sectPr: 'w:sectPr' } - + constructor() { this.sectPr = new Array(); this.sectPr.push(new Attributes({ @@ -14,5 +18,9 @@ export class SectionProperties implements XmlComponent { rsidRPr: "00D842E4", rsidSect: "000A6AD0" })); + this.sectPr.push(new PageSize()); + this.sectPr.push(new PageMargin()); + this.sectPr.push(new Columns()); + this.sectPr.push(new DocumentGrid()); } } \ No newline at end of file