diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-05-21 16:18:15 +0200 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-05-21 22:06:29 +0200 |
commit | 6c69a747b9f7a801be2ad58985f35886bd38239e (patch) | |
tree | a35f002d4564ad1811044335c34f1b510a6774b8 /libqpdf/QPDFAcroFormDocumentHelper.cc | |
parent | 70ccd807c45f477d6caf73b9390ba3acda53d1db (diff) | |
download | qpdf-6c69a747b9f7a801be2ad58985f35886bd38239e.tar.zst |
Code clean up: use range-style for loops wherever possible
Remove variables obsoleted by commit 4f24617.
Diffstat (limited to 'libqpdf/QPDFAcroFormDocumentHelper.cc')
-rw-r--r-- | libqpdf/QPDFAcroFormDocumentHelper.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libqpdf/QPDFAcroFormDocumentHelper.cc b/libqpdf/QPDFAcroFormDocumentHelper.cc index 70d01b30..ddf10e6d 100644 --- a/libqpdf/QPDFAcroFormDocumentHelper.cc +++ b/libqpdf/QPDFAcroFormDocumentHelper.cc @@ -294,12 +294,8 @@ QPDFAcroFormDocumentHelper::analyze() // a file that contains this kind of error will probably not // actually work with most viewers. - QPDFPageDocumentHelper dh(this->qpdf); - std::vector<QPDFPageObjectHelper> pages = dh.getAllPages(); - for (auto const& ph: pages) { - std::vector<QPDFAnnotationObjectHelper> annots = - getWidgetAnnotationsForPage(ph); - for (auto const& iter: annots) { + for (auto const& ph: QPDFPageDocumentHelper(this->qpdf).getAllPages()) { + for (auto const& iter: getWidgetAnnotationsForPage(ph)) { QPDFObjectHandle annot(iter.getObjectHandle()); QPDFObjGen og(annot.getObjGen()); if (this->m->annotation_to_field.count(og) == 0) { @@ -451,12 +447,8 @@ QPDFAcroFormDocumentHelper::generateAppearancesIfNeeded() return; } - QPDFPageDocumentHelper pdh(this->qpdf); - std::vector<QPDFPageObjectHelper> pages = pdh.getAllPages(); - for (auto const& page: pages) { - std::vector<QPDFAnnotationObjectHelper> annotations = - getWidgetAnnotationsForPage(page); - for (auto& aoh: annotations) { + for (auto const& page: QPDFPageDocumentHelper(this->qpdf).getAllPages()) { + for (auto& aoh: getWidgetAnnotationsForPage(page)) { QPDFFormFieldObjectHelper ffh = getFieldForAnnotation(aoh); if (ffh.getFieldType() == "/Btn") { // Rather than generating appearances for button |