Refactor to separate classes in their specific files an tests improuvements for styles

This commit is contained in:
Sergio Mendonça
2018-11-13 11:04:03 -02:00
parent ff443aa7c4
commit 7639b60b15
13 changed files with 1689 additions and 874 deletions

View File

@ -1,6 +1,6 @@
import { BaseXmlComponent, XmlComponent } from "file/xml-components";
import { DocumentDefaults } from "./defaults";
import { ParagraphStyle } from "./style";
import { CharacterStyle, ParagraphStyle } from "./style";
export * from "./border";
export class Styles extends XmlComponent {
@ -23,8 +23,14 @@ export class Styles extends XmlComponent {
}
public createParagraphStyle(styleId: string, name?: string): ParagraphStyle {
const para = new ParagraphStyle(styleId, name);
this.push(para);
return para;
const paragraphStyle = new ParagraphStyle(styleId, name);
this.push(paragraphStyle);
return paragraphStyle;
}
public createCharacterStyle(styleId: string, name?: string): CharacterStyle {
const characterStyle = new CharacterStyle(styleId, name);
this.push(characterStyle);
return characterStyle;
}
}