diff --git a/src/file/numbering/abstract-numbering.spec.ts b/src/file/numbering/abstract-numbering.spec.ts index df5416f453..8a9827aec2 100644 --- a/src/file/numbering/abstract-numbering.spec.ts +++ b/src/file/numbering/abstract-numbering.spec.ts @@ -625,7 +625,6 @@ describe("AbstractNumbering", () => { }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -636,7 +635,6 @@ describe("AbstractNumbering", () => { }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -645,10 +643,8 @@ describe("AbstractNumbering", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: true, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -657,7 +653,6 @@ describe("AbstractNumbering", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: false, expected: [{ "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }], }, { @@ -666,18 +661,12 @@ describe("AbstractNumbering", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: { - type: ShadingType.PERCENT_10, - fill: "00FFFF", - color: "00FF00", - }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "00FF00" } } }, ], }, ]; - shadingTests.forEach(({ shadow, shading, shadingComplexScript, expected }) => { + shadingTests.forEach(({ shadow, shading, expected }) => { it("#shadow correctly", () => { const abstractNumbering = new AbstractNumbering(1, [ { @@ -685,7 +674,7 @@ describe("AbstractNumbering", () => { format: LevelFormat.LOWER_ROMAN, text: "%0.", style: { - run: { shadow, shading, shadingComplexScript }, + run: { shadow, shading }, }, }, ]); diff --git a/src/file/paragraph/run/formatting.ts b/src/file/paragraph/run/formatting.ts index 36c202b8d5..e10bda376a 100644 --- a/src/file/paragraph/run/formatting.ts +++ b/src/file/paragraph/run/formatting.ts @@ -200,15 +200,3 @@ export class Shading extends XmlComponent { } } -export class ShadowComplexScript extends XmlComponent { - constructor(value: string, fill: string, color: string) { - super("w:shdCs"); - this.root.push( - new Attributes({ - val: value, - fill: fill, - color: color, - }), - ); - } -} diff --git a/src/file/paragraph/run/properties.ts b/src/file/paragraph/run/properties.ts index 7fb054d545..fa61e4d9d7 100644 --- a/src/file/paragraph/run/properties.ts +++ b/src/file/paragraph/run/properties.ts @@ -16,7 +16,6 @@ import { ItalicsComplexScript, RightToLeft, Shading, - ShadowComplexScript, Size, SizeComplexScript, SmallCaps, @@ -63,7 +62,6 @@ export interface IRunStylePropertiesOptions { readonly fill: string; readonly color: string; }; - readonly shadingComplexScript?: boolean | IRunStylePropertiesOptions["shading"]; readonly shadow?: IRunStylePropertiesOptions["shading"]; readonly emboss?: boolean; readonly imprint?: boolean; @@ -185,11 +183,6 @@ export class RunProperties extends IgnoreIfEmptyXmlComponent { if (shading) { this.push(new Shading(shading.type, shading.fill, shading.color)); } - const shdCs = - options.shadingComplexScript === undefined || options.shadingComplexScript === true ? shading : options.shadingComplexScript; - if (shdCs) { - this.push(new ShadowComplexScript(shdCs.type, shdCs.fill, shdCs.color)); - } } public push(item: XmlComponent): void { diff --git a/src/file/paragraph/run/run.spec.ts b/src/file/paragraph/run/run.spec.ts index 5dc7c270d0..fb4284308c 100644 --- a/src/file/paragraph/run/run.spec.ts +++ b/src/file/paragraph/run/run.spec.ts @@ -245,15 +245,6 @@ describe("Run", () => { { "w:rPr": [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { - "w:shdCs": { - _attr: { - "w:val": "pct10", - "w:fill": "00FFFF", - "w:color": "FF0000", - }, - }, - }, ], }, ], diff --git a/src/file/styles/style/character-style.spec.ts b/src/file/styles/style/character-style.spec.ts index c7adf4ff97..434376ebf8 100644 --- a/src/file/styles/style/character-style.spec.ts +++ b/src/file/styles/style/character-style.spec.ts @@ -784,7 +784,6 @@ describe("CharacterStyle", () => { }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -795,7 +794,6 @@ describe("CharacterStyle", () => { }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -804,10 +802,8 @@ describe("CharacterStyle", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: true, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -816,7 +812,6 @@ describe("CharacterStyle", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: false, expected: [{ "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }], }, { @@ -825,22 +820,16 @@ describe("CharacterStyle", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: { - type: ShadingType.PERCENT_10, - fill: "00FFFF", - color: "00FF00", - }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "00FF00" } } }, ], }, ]; - shadingTests.forEach(({ shadow, shading, shadingComplexScript, expected }) => { + shadingTests.forEach(({ shadow, shading, expected }) => { it("#shadow correctly", () => { const style = new StyleForCharacter({ id: "myStyleId", - run: { shadow, shading, shadingComplexScript }, + run: { shadow, shading }, }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ diff --git a/src/file/styles/style/paragraph-style.spec.ts b/src/file/styles/style/paragraph-style.spec.ts index 8683234793..7fabb2024d 100644 --- a/src/file/styles/style/paragraph-style.spec.ts +++ b/src/file/styles/style/paragraph-style.spec.ts @@ -660,7 +660,6 @@ describe("ParagraphStyle", () => { }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -671,7 +670,6 @@ describe("ParagraphStyle", () => { }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -680,10 +678,8 @@ describe("ParagraphStyle", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: true, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, ], }, { @@ -692,7 +688,6 @@ describe("ParagraphStyle", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: false, expected: [{ "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }], }, { @@ -701,22 +696,16 @@ describe("ParagraphStyle", () => { fill: "00FFFF", color: "FF0000", }, - shadingComplexScript: { - type: ShadingType.PERCENT_10, - fill: "00FFFF", - color: "00FF00", - }, expected: [ { "w:shd": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } }, - { "w:shdCs": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "00FF00" } } }, ], }, ]; - shadingTests.forEach(({ shadow, shading, shadingComplexScript, expected }) => { + shadingTests.forEach(({ shadow, shading, expected }) => { it("#shadow correctly", () => { const style = new StyleForParagraph({ id: "myStyleId", - run: { shadow, shading, shadingComplexScript }, + run: { shadow, shading }, }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({