mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-31 10:58:25 +00:00
Form field for non-widget just returns null
This commit is contained in:
parent
0a52e60ece
commit
0765872295
@ -134,8 +134,8 @@ class QPDFAcroFormDocumentHelper: public QPDFDocumentHelper
|
||||
// field dictionary, the underlying object will be the same, but
|
||||
// this is not always the case. Note that if you call this method
|
||||
// with an annotation that is not a widget annotation, there will
|
||||
// not be an associated field, and this method will raise an
|
||||
// exception.
|
||||
// not be an associated field, and this method will return a
|
||||
// helper associated with a null object (isNull() == true).
|
||||
QPDF_DLL
|
||||
QPDFFormFieldObjectHelper
|
||||
getFieldForAnnotation(QPDFAnnotationObjectHelper);
|
||||
|
@ -70,16 +70,14 @@ QPDFFormFieldObjectHelper
|
||||
QPDFAcroFormDocumentHelper::getFieldForAnnotation(QPDFAnnotationObjectHelper h)
|
||||
{
|
||||
QPDFObjectHandle oh = h.getObjectHandle();
|
||||
QPDFFormFieldObjectHelper result(QPDFObjectHandle::newNull());
|
||||
if (! (oh.isDictionary() &&
|
||||
oh.getKey("/Subtype").isName() &&
|
||||
(oh.getKey("/Subtype").getName() == "/Widget")))
|
||||
{
|
||||
throw std::logic_error(
|
||||
"QPDFAnnotationObjectHelper::getFieldForAnnotation called for"
|
||||
" non-/Widget annotation");
|
||||
return result;
|
||||
}
|
||||
analyze();
|
||||
QPDFFormFieldObjectHelper result(QPDFObjectHandle::newNull());
|
||||
QPDFObjGen og(oh.getObjGen());
|
||||
if (this->m->annotation_to_field.count(og))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user