Merge pull request #10995 from Snuffleupagus/app-rm-one-setFileSize

Remove an unnecessary `PDFDocumentProperties.setFileSize` call, relevant for the Firefox built-in viewer, and use the "normal" code-path in `PDFViewerApplication.open` instead
This commit is contained in:
Tim van der Meij 2019-07-21 12:42:26 +02:00 committed by GitHub
commit 71d9f5f860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -512,11 +512,7 @@ let PDFViewerApplication = {
}
this.externalServices.initPassiveLoading({
onOpenWithTransport(url, length, transport) {
PDFViewerApplication.open(url, { range: transport, });
if (length) {
PDFViewerApplication.pdfDocumentProperties.setFileSize(length);
}
PDFViewerApplication.open(url, { length, range: transport, });
},
onOpenWithData(data) {
PDFViewerApplication.open(data);
@ -659,11 +655,13 @@ let PDFViewerApplication = {
}
if (args) {
for (let prop in args) {
if (prop === 'length') {
this.pdfDocumentProperties.setFileSize(args[prop]);
for (let key in args) {
const value = args[key];
if (key === 'length') {
this.pdfDocumentProperties.setFileSize(value);
}
parameters[prop] = args[prop];
parameters[key] = value;
}
}