aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFAcroFormDocumentHelper.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-05-21 16:18:15 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-05-21 22:06:29 +0200
commit6c69a747b9f7a801be2ad58985f35886bd38239e (patch)
treea35f002d4564ad1811044335c34f1b510a6774b8 /libqpdf/QPDFAcroFormDocumentHelper.cc
parent70ccd807c45f477d6caf73b9390ba3acda53d1db (diff)
downloadqpdf-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.cc16
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