mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 07:12:28 +00:00
Modify QPDF::replaceReserved to allow replacing indirect nulls
This commit is contained in:
parent
6574dc5c03
commit
52539544c4
@ -391,8 +391,8 @@ class QPDF
|
||||
void swapObjects(int objid1, int generation1, int objid2, int generation2);
|
||||
|
||||
// Replace a reserved object. This is a wrapper around replaceObject but it guarantees that the
|
||||
// underlying object is a reserved object. After this call, reserved will be a reference to
|
||||
// replacement.
|
||||
// underlying object is a reserved object or a null object. After this call, reserved will
|
||||
// be a reference to replacement.
|
||||
QPDF_DLL
|
||||
void replaceReserved(QPDFObjectHandle reserved, QPDFObjectHandle replacement);
|
||||
|
||||
|
@ -1948,7 +1948,10 @@ void
|
||||
QPDF::replaceReserved(QPDFObjectHandle reserved, QPDFObjectHandle replacement)
|
||||
{
|
||||
QTC::TC("qpdf", "QPDF replaceReserved");
|
||||
reserved.assertReserved();
|
||||
auto tc = reserved.getTypeCode();
|
||||
if (!(tc == ::ot_reserved || tc == ::ot_null)) {
|
||||
throw std::logic_error("replaceReserved called with non-reserverd object");
|
||||
}
|
||||
replaceObject(reserved.getObjGen(), replacement);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user