diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-04-14 15:24:01 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-04-14 15:24:01 +0100 |
commit | 9adc7cda128a8494b2657901707bbd94367a125b (patch) | |
tree | b7ca0835214fade3afa5e0fa7dc371fdcf2a3e15 /Resource | |
parent | 4fae247b37ae8c1115b6d13ff4e447c54aea9d8b (diff) | |
download | ghostpdl-9adc7cda128a8494b2657901707bbd94367a125b.tar.gz |
Slight tidy up of /newpdf_gather_parameters
This makes the procedure style a bit more like the rest of the PS init code,
and makes it both a little efficient and (I think) a little clearer.
Noticed in passing when working on oss-fuzz 46672.
Diffstat (limited to 'Resource')
-rw-r--r-- | Resource/Init/pdf_main.ps | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps index 3259c0fe3..a49924881 100644 --- a/Resource/Init/pdf_main.ps +++ b/Resource/Init/pdf_main.ps @@ -772,27 +772,27 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if % NB device parameters will already have been sent to the device and used to configure it % so here we should only handle parameters which control the behaviour of the interpreter. % +/PDFSwitches [ /QUIET /PDFPassword /PDFDEBUG /PDFSTOPONERROR /PDFSTOPONWARNING /NOTRANSPARENCY /FirstPage /LastPage + /PDFNOCIDFALLBACK /NO_PDFMARK_OUTLINES /NO_PDFMARK_DESTS /PDFFitPage /Printed /UsePDFX3Profile + /UseBleedBox /UseCropBox /UseArtBox /UseTrimBox /ShowAcroForm /ShowAnnots /PreserveAnnots + /NoUserUnit /RENDERTTNOTDEF /DOPDFMARKS /PDFINFO /SHOWANNOTTYPES /PRESERVEANNOTTYPES + /CIDSubstPath /CIDSubstFont /IgnoreToUnicode /NONATIVEFONTMAP ] def + /newpdf_gather_parameters { 10 dict begin - /PDFSwitches [ /QUIET /PDFPassword /PDFDEBUG /PDFSTOPONERROR /PDFSTOPONWARNING /NOTRANSPARENCY /FirstPage /LastPage - /PDFNOCIDFALLBACK /NO_PDFMARK_OUTLINES /NO_PDFMARK_DESTS /PDFFitPage /Printed /UsePDFX3Profile - /UseBleedBox /UseCropBox /UseArtBox /UseTrimBox /ShowAcroForm /ShowAnnots /PreserveAnnots - /NoUserUnit /RENDERTTNOTDEF /DOPDFMARKS /PDFINFO /SHOWANNOTTYPES /PRESERVEANNOTTYPES - /CIDSubstPath /CIDSubstFont /IgnoreToUnicode /NONATIVEFONTMAP ] def - - 0 1 PDFSwitches length 1 sub { - PDFSwitches exch get dup where { - exch dup 3 1 roll get def - } - { - pop - } ifelse - } for - currentdict /PDFSwitches undef + + //PDFSwitches { + dup where + { exch dup 3 1 roll get def } + { pop } ifelse + } forall + currentdict end } bind executeonly def +currentdict /PDFSwitches undef + /newpdf_pagecount { PDFFile //null eq not |