mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-09 09:50:28 +00:00
addFormField: update cache rather than invalidating
This commit is contained in:
parent
901f1a788c
commit
15269f36d8
@ -35,7 +35,6 @@ QPDFAcroFormDocumentHelper::hasAcroForm()
|
|||||||
void
|
void
|
||||||
QPDFAcroFormDocumentHelper::addFormField(QPDFFormFieldObjectHelper ff)
|
QPDFAcroFormDocumentHelper::addFormField(QPDFFormFieldObjectHelper ff)
|
||||||
{
|
{
|
||||||
invalidateCache();
|
|
||||||
auto acroform = this->qpdf.getRoot().getKey("/AcroForm");
|
auto acroform = this->qpdf.getRoot().getKey("/AcroForm");
|
||||||
if (! acroform.isDictionary())
|
if (! acroform.isDictionary())
|
||||||
{
|
{
|
||||||
@ -50,6 +49,9 @@ QPDFAcroFormDocumentHelper::addFormField(QPDFFormFieldObjectHelper ff)
|
|||||||
acroform.replaceKey("/Fields", fields);
|
acroform.replaceKey("/Fields", fields);
|
||||||
}
|
}
|
||||||
fields.appendItem(ff.getObjectHandle());
|
fields.appendItem(ff.getObjectHandle());
|
||||||
|
std::set<QPDFObjGen> visited;
|
||||||
|
traverseField(
|
||||||
|
ff.getObjectHandle(), QPDFObjectHandle::newNull(), 0, visited);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<QPDFFormFieldObjectHelper>
|
std::vector<QPDFFormFieldObjectHelper>
|
||||||
|
Loading…
Reference in New Issue
Block a user