Commit d395a90904f6f30fdf76dae0eb5219c1c832813c
1 parent
5b3b135f
Use QPDFObjGen::set in QPDFAcroFormDocumentHelper::getFormFieldsForPage
Showing
1 changed file
with
5 additions
and
11 deletions
libqpdf/QPDFAcroFormDocumentHelper.cc
| ... | ... | @@ -217,18 +217,12 @@ std::vector<QPDFFormFieldObjectHelper> |
| 217 | 217 | QPDFAcroFormDocumentHelper::getFormFieldsForPage(QPDFPageObjectHelper ph) |
| 218 | 218 | { |
| 219 | 219 | analyze(); |
| 220 | - std::set<QPDFObjGen> added; | |
| 220 | + QPDFObjGen::set todo; | |
| 221 | 221 | std::vector<QPDFFormFieldObjectHelper> result; |
| 222 | - auto widget_annotations = getWidgetAnnotationsForPage(ph); | |
| 223 | - for (auto annot: widget_annotations) { | |
| 224 | - auto field = getFieldForAnnotation(annot); | |
| 225 | - field = field.getTopLevelField(); | |
| 226 | - auto og = field.getObjectHandle().getObjGen(); | |
| 227 | - if (!added.count(og)) { | |
| 228 | - added.insert(og); | |
| 229 | - if (field.getObjectHandle().isDictionary()) { | |
| 230 | - result.push_back(field); | |
| 231 | - } | |
| 222 | + for (auto& annot: getWidgetAnnotationsForPage(ph)) { | |
| 223 | + auto field = getFieldForAnnotation(annot).getTopLevelField(); | |
| 224 | + if (todo.add(field) && field.getObjectHandle().isDictionary()) { | |
| 225 | + result.push_back(field); | |
| 232 | 226 | } |
| 233 | 227 | } |
| 234 | 228 | return result; | ... | ... |