mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 19:08:59 +00:00
Add private overload of QPDF::makeIndirectObject taking a QPDFObject shared_ptr
This commit is contained in:
parent
486c273a4f
commit
b3d71e1f58
@ -1187,6 +1187,7 @@ class QPDF
|
||||
QPDFObjectHandle reserveStream(QPDFObjGen const& og);
|
||||
QPDFObjectHandle
|
||||
newIndirect(QPDFObjGen const&, std::shared_ptr<QPDFObject> const&);
|
||||
QPDFObjectHandle makeIndirectObject(std::shared_ptr<QPDFObject> const& obj);
|
||||
bool isCached(QPDFObjGen const& og);
|
||||
bool isUnresolved(QPDFObjGen const& og);
|
||||
void updateCache(
|
||||
|
@ -1977,7 +1977,7 @@ QPDF::isUnresolved(QPDFObjGen const& og)
|
||||
}
|
||||
|
||||
QPDFObjectHandle
|
||||
QPDF::makeIndirectObject(QPDFObjectHandle oh)
|
||||
QPDF::makeIndirectObject(std::shared_ptr<QPDFObject> const& obj)
|
||||
{
|
||||
int max_objid = toI(getObjectCount());
|
||||
if (max_objid == std::numeric_limits<int>::max()) {
|
||||
@ -1985,11 +1985,16 @@ QPDF::makeIndirectObject(QPDFObjectHandle oh)
|
||||
"max object id is too high to create new objects");
|
||||
}
|
||||
QPDFObjGen next(max_objid + 1, 0);
|
||||
m->obj_cache[next] =
|
||||
ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), -1, -1);
|
||||
m->obj_cache[next] = ObjCache(obj, -1, -1);
|
||||
return newIndirect(next, m->obj_cache[next].object);
|
||||
}
|
||||
|
||||
QPDFObjectHandle
|
||||
QPDF::makeIndirectObject(QPDFObjectHandle oh)
|
||||
{
|
||||
return makeIndirectObject(QPDFObjectHandle::ObjAccessor::getObject(oh));
|
||||
}
|
||||
|
||||
QPDFObjectHandle
|
||||
QPDF::reserveObjectIfNotExists(QPDFObjGen const& og)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user