diff --git a/include/qpdf/ObjectHandle.hh b/include/qpdf/ObjectHandle.hh index eb424ab..3e8f84d 100644 --- a/include/qpdf/ObjectHandle.hh +++ b/include/qpdf/ObjectHandle.hh @@ -130,6 +130,8 @@ namespace qpdf inline void assign(qpdf_object_type_e required, BaseHandle const& other); inline void assign(qpdf_object_type_e required, BaseHandle&& other); + inline void nullify(); + std::string description() const; void no_ci_warn_if(bool condition, std::string const& warning) const; diff --git a/libqpdf/qpdf/QPDFObjectHandle_private.hh b/libqpdf/qpdf/QPDFObjectHandle_private.hh index 834b09c..3f32915 100644 --- a/libqpdf/qpdf/QPDFObjectHandle_private.hh +++ b/libqpdf/qpdf/QPDFObjectHandle_private.hh @@ -812,6 +812,14 @@ namespace qpdf return !obj || type_code() == ::ot_null; } + inline void + BaseHandle::nullify() + { + if (obj) { + obj = QPDFObject::create(); + } + } + inline qpdf_offset_t BaseHandle::offset() const {