Skip to content

Commit

Permalink
Fix the incorrect limit location value of MathIntergral #2512 (#2513)
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoKaiLun authored Jan 4, 2024
1 parent e779f6e commit 75715fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/file/paragraph/math/n-ary/math-integral.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("MathIntegral", () => {
{
"m:limLoc": {
_attr: {
"m:val": "undOvr",
"m:val": "subSup",
},
},
},
Expand Down Expand Up @@ -78,7 +78,7 @@ describe("MathIntegral", () => {
{
"m:limLoc": {
_attr: {
"m:val": "undOvr",
"m:val": "subSup",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/file/paragraph/math/n-ary/math-integral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/file/paragraph/math/n-ary/math-limit-location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" }));
}
}
4 changes: 2 additions & 2 deletions src/file/paragraph/math/n-ary/math-n-ary-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 75715fd

Please sign in to comment.