Commit b27be3ed27890ae8226560817f14c117927cee55
Committed by
Jay Berkenbilt
1 parent
284b8efb
Remove redundant parameter from QPDFJob::handlePageSpecs and doSplitPages
Showing
2 changed files
with
7 additions
and
16 deletions
include/qpdf/QPDFJob.hh
| ... | ... | @@ -517,10 +517,8 @@ class QPDFJob |
| 517 | 517 | |
| 518 | 518 | // Transformations |
| 519 | 519 | void setQPDFOptions(QPDF& pdf); |
| 520 | - void handlePageSpecs( | |
| 521 | - QPDF& pdf, | |
| 522 | - bool& warnings, | |
| 523 | - std::vector<std::shared_ptr<QPDF>>& page_heap); | |
| 520 | + void | |
| 521 | + handlePageSpecs(QPDF& pdf, std::vector<std::shared_ptr<QPDF>>& page_heap); | |
| 524 | 522 | bool shouldRemoveUnreferencedResources(QPDF& pdf); |
| 525 | 523 | void handleRotations(QPDF& pdf); |
| 526 | 524 | void |
| ... | ... | @@ -549,7 +547,7 @@ class QPDFJob |
| 549 | 547 | void doShowAttachment(QPDF& pdf); |
| 550 | 548 | |
| 551 | 549 | // Output generation |
| 552 | - void doSplitPages(QPDF& pdf, bool& warnings); | |
| 550 | + void doSplitPages(QPDF& pdf); | |
| 553 | 551 | void setWriterOptions(QPDF& pdf, QPDFWriter& w); |
| 554 | 552 | void setEncryptionOptions(QPDF&, QPDFWriter&); |
| 555 | 553 | void maybeFixWritePassword(int R, std::string& password); | ... | ... |
libqpdf/QPDFJob.cc
| ... | ... | @@ -486,10 +486,9 @@ QPDFJob::run() |
| 486 | 486 | pdf.updateFromJSON(this->m->update_from_json); |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | - bool other_warnings = false; | |
| 490 | 489 | std::vector<std::shared_ptr<QPDF>> page_heap; |
| 491 | 490 | if (!m->page_specs.empty()) { |
| 492 | - handlePageSpecs(pdf, other_warnings, page_heap); | |
| 491 | + handlePageSpecs(pdf, page_heap); | |
| 493 | 492 | } |
| 494 | 493 | if (!m->rotations.empty()) { |
| 495 | 494 | handleRotations(pdf); |
| ... | ... | @@ -500,7 +499,7 @@ QPDFJob::run() |
| 500 | 499 | if (!createsOutput()) { |
| 501 | 500 | doInspection(pdf); |
| 502 | 501 | } else if (m->split_pages) { |
| 503 | - doSplitPages(pdf, other_warnings); | |
| 502 | + doSplitPages(pdf); | |
| 504 | 503 | } else { |
| 505 | 504 | writeOutfile(pdf); |
| 506 | 505 | } |
| ... | ... | @@ -2541,7 +2540,7 @@ added_page(QPDF& pdf, QPDFPageObjectHelper page) |
| 2541 | 2540 | |
| 2542 | 2541 | void |
| 2543 | 2542 | QPDFJob::handlePageSpecs( |
| 2544 | - QPDF& pdf, bool& warnings, std::vector<std::shared_ptr<QPDF>>& page_heap) | |
| 2543 | + QPDF& pdf, std::vector<std::shared_ptr<QPDF>>& page_heap) | |
| 2545 | 2544 | { |
| 2546 | 2545 | // Parse all page specifications and translate them into lists of |
| 2547 | 2546 | // actual pages. |
| ... | ... | @@ -2787,9 +2786,6 @@ QPDFJob::handlePageSpecs( |
| 2787 | 2786 | } |
| 2788 | 2787 | } |
| 2789 | 2788 | } |
| 2790 | - if (page_data.qpdf->anyWarnings()) { | |
| 2791 | - warnings = true; | |
| 2792 | - } | |
| 2793 | 2789 | if (cis) { |
| 2794 | 2790 | cis->stayOpen(false); |
| 2795 | 2791 | } |
| ... | ... | @@ -3176,7 +3172,7 @@ QPDFJob::setWriterOptions(QPDF& pdf, QPDFWriter& w) |
| 3176 | 3172 | } |
| 3177 | 3173 | |
| 3178 | 3174 | void |
| 3179 | -QPDFJob::doSplitPages(QPDF& pdf, bool& warnings) | |
| 3175 | +QPDFJob::doSplitPages(QPDF& pdf) | |
| 3180 | 3176 | { |
| 3181 | 3177 | // Generate output file pattern |
| 3182 | 3178 | std::string before; |
| ... | ... | @@ -3272,9 +3268,6 @@ QPDFJob::doSplitPages(QPDF& pdf, bool& warnings) |
| 3272 | 3268 | doIfVerbose([&](Pipeline& v, std::string const& prefix) { |
| 3273 | 3269 | v << prefix << ": wrote file " << outfile << "\n"; |
| 3274 | 3270 | }); |
| 3275 | - if (outpdf.anyWarnings()) { | |
| 3276 | - warnings = true; | |
| 3277 | - } | |
| 3278 | 3271 | } |
| 3279 | 3272 | } |
| 3280 | 3273 | ... | ... |