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 /examples/pdf-set-form-values.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 'examples/pdf-set-form-values.cc')
-rw-r--r-- | examples/pdf-set-form-values.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/examples/pdf-set-form-values.cc b/examples/pdf-set-form-values.cc index c28149ad..cc328cf3 100644 --- a/examples/pdf-set-form-values.cc +++ b/examples/pdf-set-form-values.cc @@ -50,15 +50,11 @@ main(int argc, char* argv[]) // illustrates how we can map from annotations to fields. QPDFAcroFormDocumentHelper afdh(qpdf); - QPDFPageDocumentHelper pdh(qpdf); - std::vector<QPDFPageObjectHelper> pages = pdh.getAllPages(); - for (auto const& page: pages) { + for (auto const& page: QPDFPageDocumentHelper(qpdf).getAllPages()) { // Get all widget annotations for each page. Widget // annotations are the ones that contain the details of // what's in a form field. - std::vector<QPDFAnnotationObjectHelper> annotations = - afdh.getWidgetAnnotationsForPage(page); - for (auto& annot: annotations) { + for (auto& annot: afdh.getWidgetAnnotationsForPage(page)) { // For each annotation, find its associated field. If // it's a text field, set its value. QPDFFormFieldObjectHelper ffh = |