From dd8d8e43b3040998429a431c09c7744c39c1a712 Mon Sep 17 00:00:00 2001 From: kailunyao Date: Wed, 3 Jan 2024 16:29:22 +0800 Subject: [PATCH] Fix the incorrect limit location value of MathIntergral #2512 --- src/file/paragraph/math/n-ary/math-integral.spec.ts | 4 ++-- src/file/paragraph/math/n-ary/math-integral.ts | 2 +- src/file/paragraph/math/n-ary/math-limit-location.ts | 4 ++-- src/file/paragraph/math/n-ary/math-n-ary-properties.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/file/paragraph/math/n-ary/math-integral.spec.ts b/src/file/paragraph/math/n-ary/math-integral.spec.ts index bc7be342838..243be8150d4 100644 --- a/src/file/paragraph/math/n-ary/math-integral.spec.ts +++ b/src/file/paragraph/math/n-ary/math-integral.spec.ts @@ -22,7 +22,7 @@ describe("MathIntegral", () => { { "m:limLoc": { _attr: { - "m:val": "undOvr", + "m:val": "subSup", }, }, }, @@ -78,7 +78,7 @@ describe("MathIntegral", () => { { "m:limLoc": { _attr: { - "m:val": "undOvr", + "m:val": "subSup", }, }, }, diff --git a/src/file/paragraph/math/n-ary/math-integral.ts b/src/file/paragraph/math/n-ary/math-integral.ts index 3189d31c087..55d0cbbcea9 100644 --- a/src/file/paragraph/math/n-ary/math-integral.ts +++ b/src/file/paragraph/math/n-ary/math-integral.ts @@ -16,7 +16,7 @@ export class MathIntegral extends XmlComponent { public constructor(options: IMathIntegralOptions) { super("m:nary"); - this.root.push(new MathNAryProperties("", !!options.superScript, !!options.subScript)); + this.root.push(new MathNAryProperties("", !!options.superScript, !!options.subScript, "subSup")); if (!!options.subScript) { this.root.push(new MathSubScriptElement(options.subScript)); diff --git a/src/file/paragraph/math/n-ary/math-limit-location.ts b/src/file/paragraph/math/n-ary/math-limit-location.ts index 82133ddd000..2ee905cd83b 100644 --- a/src/file/paragraph/math/n-ary/math-limit-location.ts +++ b/src/file/paragraph/math/n-ary/math-limit-location.ts @@ -6,9 +6,9 @@ class MathLimitLocationAttributes extends XmlAttributeComponent<{ readonly value } export class MathLimitLocation extends XmlComponent { - public constructor() { + public constructor(value?: string) { super("m:limLoc"); - this.root.push(new MathLimitLocationAttributes({ value: "undOvr" })); + this.root.push(new MathLimitLocationAttributes({ value: value || "undOvr" })); } } diff --git a/src/file/paragraph/math/n-ary/math-n-ary-properties.ts b/src/file/paragraph/math/n-ary/math-n-ary-properties.ts index b8a491df396..7ad1f5dcdb9 100644 --- a/src/file/paragraph/math/n-ary/math-n-ary-properties.ts +++ b/src/file/paragraph/math/n-ary/math-n-ary-properties.ts @@ -7,13 +7,13 @@ import { MathSubScriptHide } from "./math-sub-script-hide"; import { MathSuperScriptHide } from "./math-super-script-hide"; export class MathNAryProperties extends XmlComponent { - public constructor(accent: string, hasSuperScript: boolean, hasSubScript: boolean) { + public constructor(accent: string, hasSuperScript: boolean, hasSubScript: boolean, limitLocationVal?: string) { super("m:naryPr"); if (!!accent) { this.root.push(new MathAccentCharacter(accent)); } - this.root.push(new MathLimitLocation()); + this.root.push(new MathLimitLocation(limitLocationVal)); if (!hasSuperScript) { this.root.push(new MathSuperScriptHide());