fix: do not use static numeric counters

This commit is contained in:
Maxim Fedorenko
2023-04-28 13:17:02 +03:00
parent bb686bbcbe
commit a0437381e7
9 changed files with 20 additions and 42 deletions

View File

@ -2,7 +2,7 @@
import { IContext, IXmlableObject, NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { ConcreteHyperlink } from "@file/paragraph";
import { docPropertiesUniqueNumericId } from "@util/convenience-functions";
import { docPropertiesUniqueNumericIdGen } from "@util/convenience-functions";
import { createHyperlinkClick } from "./doc-properties-children";
@ -25,6 +25,8 @@ export interface DocPropertiesOptions {
}
export class DocProperties extends XmlComponent {
private readonly docPropertiesUniqueNumericId = docPropertiesUniqueNumericIdGen();
public constructor({ name, description, title }: DocPropertiesOptions = { name: "", description: "", title: "" }) {
super("wp:docPr");
@ -32,7 +34,7 @@ export class DocProperties extends XmlComponent {
new NextAttributeComponent({
id: {
key: "id",
value: docPropertiesUniqueNumericId(),
value: this.docPropertiesUniqueNumericId(),
},
name: {
key: "name",