Compare commits

..

No commits in common. "813d1949ba1431f1e1a4a77d42bc05de60754688" and "d71fe9025de50aaa80ea4a6d825c583352f93416" have entirely different histories.

2 changed files with 12 additions and 1 deletions

View File

@ -1860,6 +1860,7 @@ class Font {
}
// removing duplicate entries
mappings.sort((a, b) => a.charCode - b.charCode);
const finalMappings = [],
seenCharCodes = new Set();
for (const map of mappings) {
@ -1875,7 +1876,7 @@ class Font {
return {
platformId: potentialTable.platformId,
encodingId: potentialTable.encodingId,
mappings: finalMappings.sort((a, b) => a.charCode - b.charCode),
mappings: finalMappings,
hasShortCmap,
};
}

View File

@ -134,6 +134,9 @@ class IdManager {
constructor() {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
Object.defineProperty(this, "reset", {
value: () => (this.#id = 0),
});
Object.defineProperty(this, "getNextId", {
value: () => this.#id,
});
@ -1064,6 +1067,13 @@ class AnnotationEditorUIManager {
commentManager?.setSidebarUiManager(this);
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
Object.defineProperty(this, "reset", {
value: () => {
this.selectAll();
this.delete();
this.#idManager.reset();
},
});
Object.defineProperty(this, "getNextEditorId", {
value: () => this.#idManager.getNextId(),
});