diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-02-21 11:46:12 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-02-21 12:36:30 +0100 |
commit | 15269f36d8b7ca17f52b98d9e0f18c6eec102b7b (patch) | |
tree | 98e546df5d8fb4ef63f0d74d507db15e0e8c6e31 /libqpdf | |
parent | 901f1a788c6dcb5291539fe4edc271cf53d85a2a (diff) | |
download | qpdf-15269f36d8b7ca17f52b98d9e0f18c6eec102b7b.tar.zst |
addFormField: update cache rather than invalidating
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFAcroFormDocumentHelper.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libqpdf/QPDFAcroFormDocumentHelper.cc b/libqpdf/QPDFAcroFormDocumentHelper.cc index 9f800a8e..cf3cb161 100644 --- a/libqpdf/QPDFAcroFormDocumentHelper.cc +++ b/libqpdf/QPDFAcroFormDocumentHelper.cc @@ -35,7 +35,6 @@ QPDFAcroFormDocumentHelper::hasAcroForm() void QPDFAcroFormDocumentHelper::addFormField(QPDFFormFieldObjectHelper ff) { - invalidateCache(); auto acroform = this->qpdf.getRoot().getKey("/AcroForm"); if (! acroform.isDictionary()) { @@ -50,6 +49,9 @@ QPDFAcroFormDocumentHelper::addFormField(QPDFFormFieldObjectHelper ff) acroform.replaceKey("/Fields", fields); } fields.appendItem(ff.getObjectHandle()); + std::set<QPDFObjGen> visited; + traverseField( + ff.getObjectHandle(), QPDFObjectHandle::newNull(), 0, visited); } std::vector<QPDFFormFieldObjectHelper> |