From 75715fde3751ee91da946618880b748061d2c62a Mon Sep 17 00:00:00 2001 From: yaokailun Date: Thu, 4 Jan 2024 10:42:05 +0800 Subject: [PATCH] Fix the incorrect limit location value of MathIntergral #2512 (#2513) --- 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 bc7be34283..243be8150d 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 3189d31c08..55d0cbbcea 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 82133ddd00..2ee905cd83 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 b8a491df39..7ad1f5dcdb 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());