mirror of
https://github.com/qpdf/qpdf.git
synced 2024-05-30 17:00:51 +00:00
Code tidy: QPDFJob::doJSONPageLabels
Remove redundant variables pages and next.
This commit is contained in:
parent
1eb2f208ec
commit
97f737a562
|
@ -1239,16 +1239,13 @@ QPDFJob::doJSONPageLabels(Pipeline* p, bool& first, QPDF& pdf)
|
||||||
{
|
{
|
||||||
JSON j_labels = JSON::makeArray();
|
JSON j_labels = JSON::makeArray();
|
||||||
QPDFPageLabelDocumentHelper pldh(pdf);
|
QPDFPageLabelDocumentHelper pldh(pdf);
|
||||||
QPDFPageDocumentHelper pdh(pdf);
|
long long npages = QIntC::to_longlong(
|
||||||
std::vector<QPDFPageObjectHelper> pages = pdh.getAllPages();
|
QPDFPageDocumentHelper(pdf).getAllPages().size());
|
||||||
if (pldh.hasPageLabels()) {
|
if (pldh.hasPageLabels()) {
|
||||||
std::vector<QPDFObjectHandle> labels;
|
std::vector<QPDFObjectHandle> labels;
|
||||||
pldh.getLabelsForPageRange(
|
pldh.getLabelsForPageRange(0, npages - 1, 0, labels);
|
||||||
0, QIntC::to_int(pages.size()) - 1, 0, labels);
|
|
||||||
for (auto iter = labels.begin(); iter != labels.end(); ++iter) {
|
for (auto iter = labels.begin(); iter != labels.end(); ++iter) {
|
||||||
auto next = iter;
|
if ((iter + 1) == labels.end()) {
|
||||||
++next;
|
|
||||||
if (next == labels.end()) {
|
|
||||||
// This can't happen, so ignore it. This could only
|
// This can't happen, so ignore it. This could only
|
||||||
// happen if getLabelsForPageRange somehow returned an
|
// happen if getLabelsForPageRange somehow returned an
|
||||||
// odd number of items.
|
// odd number of items.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user