Merge pull request #14325 from Snuffleupagus/getPageDict-rm-skipCount
Remove the unused `skipCount` parameter from `Catalog.getPageDict` (PR 14311 follow-up)
This commit is contained in:
commit
f61b74e38e
@ -1085,7 +1085,7 @@ class Catalog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getPageDict(pageIndex, skipCount = false) {
|
getPageDict(pageIndex) {
|
||||||
const capability = createPromiseCapability();
|
const capability = createPromiseCapability();
|
||||||
const nodesToVisit = [this._catDict.getRaw("Pages")];
|
const nodesToVisit = [this._catDict.getRaw("Pages")];
|
||||||
const visitedNodes = new RefSet();
|
const visitedNodes = new RefSet();
|
||||||
@ -1153,7 +1153,7 @@ class Catalog {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Number.isInteger(count) && count >= 0 && !skipCount) {
|
if (Number.isInteger(count) && count >= 0) {
|
||||||
// Cache the Kids count, since it can reduce redundant lookups in
|
// Cache the Kids count, since it can reduce redundant lookups in
|
||||||
// documents where all nodes are found at *one* level of the tree.
|
// documents where all nodes are found at *one* level of the tree.
|
||||||
const objId = currentNode.objId;
|
const objId = currentNode.objId;
|
||||||
|
@ -1388,7 +1388,7 @@ class PDFDocument {
|
|||||||
let pageIndex = 1; // The first page was already loaded.
|
let pageIndex = 1; // The first page was already loaded.
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
await this.getPage(pageIndex, /* skipCount = */ true);
|
await this.getPage(pageIndex);
|
||||||
} catch (reasonLoop) {
|
} catch (reasonLoop) {
|
||||||
if (reasonLoop instanceof PageDictMissingException) {
|
if (reasonLoop instanceof PageDictMissingException) {
|
||||||
break;
|
break;
|
||||||
|
@ -457,6 +457,14 @@ describe("api", function () {
|
|||||||
const pdfDocument = await loadingTask.promise;
|
const pdfDocument = await loadingTask.promise;
|
||||||
expect(pdfDocument.numPages).toEqual(1);
|
expect(pdfDocument.numPages).toEqual(1);
|
||||||
|
|
||||||
|
const page = await pdfDocument.getPage(1);
|
||||||
|
expect(page instanceof PDFPageProxy).toEqual(true);
|
||||||
|
|
||||||
|
const opList = await page.getOperatorList();
|
||||||
|
expect(opList.fnArray.length).toEqual(0);
|
||||||
|
expect(opList.argsArray.length).toEqual(0);
|
||||||
|
expect(opList.lastChunk).toEqual(true);
|
||||||
|
|
||||||
await loadingTask.destroy();
|
await loadingTask.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user