mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 07:12:28 +00:00
Use QPDFObjGen::set in QPDFAcroFormDocumentHelper::getFormFieldsForPage
This commit is contained in:
parent
5b3b135fda
commit
d395a90904
@ -217,20 +217,14 @@ std::vector<QPDFFormFieldObjectHelper>
|
||||
QPDFAcroFormDocumentHelper::getFormFieldsForPage(QPDFPageObjectHelper ph)
|
||||
{
|
||||
analyze();
|
||||
std::set<QPDFObjGen> added;
|
||||
QPDFObjGen::set todo;
|
||||
std::vector<QPDFFormFieldObjectHelper> result;
|
||||
auto widget_annotations = getWidgetAnnotationsForPage(ph);
|
||||
for (auto annot: widget_annotations) {
|
||||
auto field = getFieldForAnnotation(annot);
|
||||
field = field.getTopLevelField();
|
||||
auto og = field.getObjectHandle().getObjGen();
|
||||
if (!added.count(og)) {
|
||||
added.insert(og);
|
||||
if (field.getObjectHandle().isDictionary()) {
|
||||
for (auto& annot: getWidgetAnnotationsForPage(ph)) {
|
||||
auto field = getFieldForAnnotation(annot).getTopLevelField();
|
||||
if (todo.add(field) && field.getObjectHandle().isDictionary()) {
|
||||
result.push_back(field);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user