mirror of
https://github.com/qpdf/qpdf.git
synced 2025-02-09 15:18:29 +00:00
In QPDFJob push the page_heap from QPDFJob down to handlePageSpecs
This commit is contained in:
parent
e1ca10ccc4
commit
3683938caa
@ -511,7 +511,7 @@ class QPDFJob
|
|||||||
|
|
||||||
// Transformations
|
// Transformations
|
||||||
void setQPDFOptions(QPDF& pdf);
|
void setQPDFOptions(QPDF& pdf);
|
||||||
void handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_heap);
|
bool handlePageSpecs(QPDF& pdf);
|
||||||
bool shouldRemoveUnreferencedResources(QPDF& pdf);
|
bool shouldRemoveUnreferencedResources(QPDF& pdf);
|
||||||
void handleRotations(QPDF& pdf);
|
void handleRotations(QPDF& pdf);
|
||||||
std::map<std::pair<int, size_t>, std::vector<int>>
|
std::map<std::pair<int, size_t>, std::vector<int>>
|
||||||
|
@ -486,9 +486,10 @@ QPDFJob::createQPDF()
|
|||||||
pdf.updateFromJSON(m->update_from_json);
|
pdf.updateFromJSON(m->update_from_json);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::unique_ptr<QPDF>> page_heap;
|
|
||||||
if (!m->page_specs.empty()) {
|
if (!m->page_specs.empty()) {
|
||||||
handlePageSpecs(pdf, page_heap);
|
if (!handlePageSpecs(pdf)) {
|
||||||
|
m->warnings = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!m->rotations.empty()) {
|
if (!m->rotations.empty()) {
|
||||||
handleRotations(pdf);
|
handleRotations(pdf);
|
||||||
@ -496,11 +497,6 @@ QPDFJob::createQPDF()
|
|||||||
handleUnderOverlay(pdf);
|
handleUnderOverlay(pdf);
|
||||||
handleTransformations(pdf);
|
handleTransformations(pdf);
|
||||||
|
|
||||||
for (auto& foreign: page_heap) {
|
|
||||||
if (foreign->anyWarnings()) {
|
|
||||||
m->warnings = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return pdf_sp;
|
return pdf_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2381,9 +2377,12 @@ added_page(QPDF& pdf, QPDFPageObjectHelper page)
|
|||||||
return added_page(pdf, page.getObjectHandle());
|
return added_page(pdf, page.getObjectHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
// Handle all page specifications. Return true if it succeeded without warnings.
|
||||||
QPDFJob::handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_heap)
|
bool
|
||||||
|
QPDFJob::handlePageSpecs(QPDF& pdf)
|
||||||
{
|
{
|
||||||
|
std::vector<std::unique_ptr<QPDF>> page_heap;
|
||||||
|
|
||||||
// Parse all page specifications and translate them into lists of actual pages.
|
// Parse all page specifications and translate them into lists of actual pages.
|
||||||
|
|
||||||
// Handle "." as a shortcut for the input file
|
// Handle "." as a shortcut for the input file
|
||||||
@ -2655,6 +2654,12 @@ QPDFJob::handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_hea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto& foreign: page_heap) {
|
||||||
|
if (foreign->anyWarnings()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user