Make Paragraph declaritive

This commit is contained in:
Dolan
2019-06-12 01:03:36 +01:00
parent 5c1a731314
commit cb42c74a8d
33 changed files with 451 additions and 497 deletions

View File

@ -1,7 +1,7 @@
import { Attributes, XmlAttributeComponent, XmlComponent } from "file/xml-components";
import {
Alignment,
AlignmentOptions,
AlignmentType,
Indent,
ISpacingProperties,
KeepLines,
@ -114,7 +114,7 @@ export class LevelBase extends XmlComponent {
this.root.push(new LevelJc(lvlJc));
}
this.paragraphProperties = new ParagraphProperties();
this.paragraphProperties = new ParagraphProperties({});
this.runProperties = new RunProperties();
this.root.push(this.paragraphProperties);
@ -201,22 +201,22 @@ export class LevelBase extends XmlComponent {
// --------------------- Paragraph formatting ------------------------ //
public center(): Level {
this.addParagraphProperty(new Alignment(AlignmentOptions.CENTER));
this.addParagraphProperty(new Alignment(AlignmentType.CENTER));
return this;
}
public left(): Level {
this.addParagraphProperty(new Alignment(AlignmentOptions.LEFT));
this.addParagraphProperty(new Alignment(AlignmentType.LEFT));
return this;
}
public right(): Level {
this.addParagraphProperty(new Alignment(AlignmentOptions.RIGHT));
this.addParagraphProperty(new Alignment(AlignmentType.RIGHT));
return this;
}
public justified(): Level {
this.addParagraphProperty(new Alignment(AlignmentOptions.BOTH));
this.addParagraphProperty(new Alignment(AlignmentType.BOTH));
return this;
}