mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 15:17:29 +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 reserveStream(QPDFObjGen const& og);
|
||||||
QPDFObjectHandle
|
QPDFObjectHandle
|
||||||
newIndirect(QPDFObjGen const&, std::shared_ptr<QPDFObject> const&);
|
newIndirect(QPDFObjGen const&, std::shared_ptr<QPDFObject> const&);
|
||||||
|
QPDFObjectHandle makeIndirectObject(std::shared_ptr<QPDFObject> const& obj);
|
||||||
bool isCached(QPDFObjGen const& og);
|
bool isCached(QPDFObjGen const& og);
|
||||||
bool isUnresolved(QPDFObjGen const& og);
|
bool isUnresolved(QPDFObjGen const& og);
|
||||||
void updateCache(
|
void updateCache(
|
||||||
|
@ -1977,7 +1977,7 @@ QPDF::isUnresolved(QPDFObjGen const& og)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QPDFObjectHandle
|
QPDFObjectHandle
|
||||||
QPDF::makeIndirectObject(QPDFObjectHandle oh)
|
QPDF::makeIndirectObject(std::shared_ptr<QPDFObject> const& obj)
|
||||||
{
|
{
|
||||||
int max_objid = toI(getObjectCount());
|
int max_objid = toI(getObjectCount());
|
||||||
if (max_objid == std::numeric_limits<int>::max()) {
|
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");
|
"max object id is too high to create new objects");
|
||||||
}
|
}
|
||||||
QPDFObjGen next(max_objid + 1, 0);
|
QPDFObjGen next(max_objid + 1, 0);
|
||||||
m->obj_cache[next] =
|
m->obj_cache[next] = ObjCache(obj, -1, -1);
|
||||||
ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), -1, -1);
|
|
||||||
return newIndirect(next, m->obj_cache[next].object);
|
return newIndirect(next, m->obj_cache[next].object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPDFObjectHandle
|
||||||
|
QPDF::makeIndirectObject(QPDFObjectHandle oh)
|
||||||
|
{
|
||||||
|
return makeIndirectObject(QPDFObjectHandle::ObjAccessor::getObject(oh));
|
||||||
|
}
|
||||||
|
|
||||||
QPDFObjectHandle
|
QPDFObjectHandle
|
||||||
QPDF::reserveObjectIfNotExists(QPDFObjGen const& og)
|
QPDF::reserveObjectIfNotExists(QPDFObjGen const& og)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user