extract styles from dotx

This commit is contained in:
amitm02
2018-09-26 14:33:05 +03:00
parent fafa54e4c9
commit 048ae6a58c
2 changed files with 16 additions and 2 deletions

View File

@ -57,7 +57,13 @@ export class File {
this.currentRelationshipId = fileProperties.template.currentRelationshipId + 1;
}
if (options.externalStyles) {
// set up styles
if (fileProperties.template && options.externalStyles) {
throw Error("can not use both template and external styles");
}
if (fileProperties.template) {
this.styles = fileProperties.template.styles;
} else if (options.externalStyles) {
const stylesFactory = new ExternalStylesFactory();
this.styles = stylesFactory.newInstance(options.externalStyles);
} else {