Commit a301cc5373f14fd03e51619b0bd5fad22b84e115
1 parent
3ab25d59
Minor code cleanup
Showing
2 changed files
with
9 additions
and
20 deletions
libqpdf/QPDFJob.cc
| ... | ... | @@ -2717,24 +2717,14 @@ QPDFJob::handlePageSpecs( |
| 2717 | 2717 | { |
| 2718 | 2718 | filenames.insert(page_spec.filename); |
| 2719 | 2719 | } |
| 2720 | - if (filenames.size() > o.keep_files_open_threshold) | |
| 2721 | - { | |
| 2722 | - QTC::TC("qpdf", "qpdf disable keep files open"); | |
| 2723 | - o.doIfVerbose([&](std::ostream& cout, std::string const& prefix) { | |
| 2724 | - cout << prefix << ": selecting --keep-open-files=n" | |
| 2725 | - << std::endl; | |
| 2726 | - }); | |
| 2727 | - o.keep_files_open = false; | |
| 2728 | - } | |
| 2729 | - else | |
| 2730 | - { | |
| 2731 | - o.doIfVerbose([&](std::ostream& cout, std::string const& prefix) { | |
| 2732 | - cout << prefix << ": selecting --keep-open-files=y" | |
| 2733 | - << std::endl; | |
| 2734 | - }); | |
| 2735 | - o.keep_files_open = true; | |
| 2736 | - QTC::TC("qpdf", "qpdf don't disable keep files open"); | |
| 2737 | - } | |
| 2720 | + o.keep_files_open = (filenames.size() <= o.keep_files_open_threshold); | |
| 2721 | + QTC::TC("qpdf", "qpdf automatically set keep files open", | |
| 2722 | + o.keep_files_open ? 0 : 1); | |
| 2723 | + o.doIfVerbose([&](std::ostream& cout, std::string const& prefix) { | |
| 2724 | + cout << prefix << ": selecting --keep-open-files=" | |
| 2725 | + << (o.keep_files_open ? "y" : "n") | |
| 2726 | + << std::endl; | |
| 2727 | + }); | |
| 2738 | 2728 | } |
| 2739 | 2729 | |
| 2740 | 2730 | // Create a QPDF object for each file that we may take pages from. | ... | ... |
qpdf/qpdf.testcov
| ... | ... | @@ -349,10 +349,9 @@ QPDFAcroFormDocumentHelper non-dictionary field 0 |
| 349 | 349 | QPDFAcroFormDocumentHelper loop 0 |
| 350 | 350 | QPDFAcroFormDocumentHelper field found 1 |
| 351 | 351 | QPDFAcroFormDocumentHelper annotation found 1 |
| 352 | -qpdf disable keep files open 0 | |
| 353 | 352 | qpdf keep files open n 0 |
| 354 | 353 | qpdf keep files open y 0 |
| 355 | -qpdf don't disable keep files open 0 | |
| 354 | +qpdf automatically set keep files open 1 | |
| 356 | 355 | QPDFPageLabelDocumentHelper skip first 0 |
| 357 | 356 | QPDFOutlineObjectHelper direct dest 0 |
| 358 | 357 | QPDFOutlineObjectHelper action dest 0 | ... | ... |