clean up latentstyles to use modern attribute implementation

This commit is contained in:
felipe
2017-03-10 14:30:32 +01:00
parent a89718ea83
commit 8c91c04afa
4 changed files with 27 additions and 44 deletions

View File

@ -3,7 +3,6 @@ import { XmlComponent } from "../docx/xml-components";
import { DocumentDefaults } from "./defaults";
import { LatentStyles } from "./latent-styles";
import { LatentStyleException } from "./latent-styles/exceptions";
import { LatentStyleExceptionAttributes } from "./latent-styles/exceptions/attributes";
import { ParagraphStyle } from "./style";
export class Styles extends XmlComponent {

View File

@ -0,0 +1,27 @@
import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components";
interface ILatentStyleExceptionAttributesProperties {
name?: string;
uiPriority?: string;
qFormat?: string;
semiHidden?: string;
unhideWhenUsed?: string;
}
class LatentStyleExceptionAttributes extends XmlAttributeComponent<ILatentStyleExceptionAttributesProperties> {
protected xmlKeys = {
name: "w:name",
uiPriority: "w:uiPriority",
qFormat: "w:qFormat",
semiHidden: "w:semiHidden",
unhideWhenUsed: "w:unhideWhenUsed",
};
}
export class LatentStyleException extends XmlComponent {
constructor(attributes: ILatentStyleExceptionAttributesProperties) {
super("w:lsdException");
this.root.push(new LatentStyleExceptionAttributes(attributes));
}
}

View File

@ -1,33 +0,0 @@
import {XmlComponent} from "../../../docx/xml-components";
interface ILatentStyleExceptionAttributesProperties {
name?: string;
uiPriority?: string;
qFormat?: string;
semiHidden?: string;
unhideWhenUsed?: string;
}
export class LatentStyleExceptionAttributes extends XmlComponent {
/* tslint:disable */
private _attr: ILatentStyleExceptionAttributesProperties;
/* tslint:enable */
private xmlKeys = {
name: "w:name",
uiPriority: "w:uiPriority",
qFormat: "w:qFormat",
semiHidden: "w:semiHidden",
unhideWhenUsed: "w:unhideWhenUsed",
};
constructor(properties?: ILatentStyleExceptionAttributesProperties) {
super("_attr");
this._attr = properties;
if (!properties) {
this._attr = {};
}
// this._attr.xmlKeys = this.xmlKeys;
}
}

View File

@ -1,10 +0,0 @@
import { XmlComponent } from "../../../docx/xml-components";
import { LatentStyleExceptionAttributes } from "./attributes";
export class LatentStyleException extends XmlComponent {
constructor(attributes: LatentStyleExceptionAttributes) {
super("w:lsdException");
this.root.push(attributes);
}
}