mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 15:17:29 +00:00
Add method QPDFObject::getObjGen and remove QPDFObjectHandle::og
This commit is contained in:
parent
5033e3b215
commit
1bb40238e0
@ -103,6 +103,12 @@ class QPDFObject
|
|||||||
{
|
{
|
||||||
return value->qpdf;
|
return value->qpdf;
|
||||||
}
|
}
|
||||||
|
QPDFObjGen
|
||||||
|
getObjGen() const
|
||||||
|
{
|
||||||
|
return value->og;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
setDescription(QPDF* qpdf, std::string const& description)
|
setDescription(QPDF* qpdf, std::string const& description)
|
||||||
{
|
{
|
||||||
|
@ -1584,7 +1584,6 @@ class QPDFObjectHandle
|
|||||||
QPDF* qpdf,
|
QPDF* qpdf,
|
||||||
QPDFObjGen const& og,
|
QPDFObjGen const& og,
|
||||||
std::shared_ptr<QPDFObject> const& obj) :
|
std::shared_ptr<QPDFObject> const& obj) :
|
||||||
og(og),
|
|
||||||
obj(obj)
|
obj(obj)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -1640,7 +1639,6 @@ class QPDFObjectHandle
|
|||||||
// Moving members of QPDFObjectHandle into a smart pointer incurs
|
// Moving members of QPDFObjectHandle into a smart pointer incurs
|
||||||
// a substantial performance penalty since QPDFObjectHandle
|
// a substantial performance penalty since QPDFObjectHandle
|
||||||
// objects are copied around so frequently.
|
// objects are copied around so frequently.
|
||||||
QPDFObjGen og;
|
|
||||||
std::shared_ptr<QPDFObject> obj;
|
std::shared_ptr<QPDFObject> obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1864,19 +1862,19 @@ class QPDFObjectHandle::QPDFArrayItems
|
|||||||
inline QPDFObjGen
|
inline QPDFObjGen
|
||||||
QPDFObjectHandle::getObjGen() const
|
QPDFObjectHandle::getObjGen() const
|
||||||
{
|
{
|
||||||
return og;
|
return isInitialized() ? obj->getObjGen() : QPDFObjGen();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
QPDFObjectHandle::getObjectID() const
|
QPDFObjectHandle::getObjectID() const
|
||||||
{
|
{
|
||||||
return og.getObj();
|
return getObjGen().getObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
QPDFObjectHandle::getGeneration() const
|
QPDFObjectHandle::getGeneration() const
|
||||||
{
|
{
|
||||||
return og.getGen();
|
return getObjGen().getGen();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
|
@ -2282,8 +2282,6 @@ QPDFObjectHandle::copyObject(
|
|||||||
" reserved object handle direct");
|
" reserved object handle direct");
|
||||||
}
|
}
|
||||||
|
|
||||||
og = QPDFObjGen();
|
|
||||||
|
|
||||||
std::shared_ptr<QPDFObject> new_obj;
|
std::shared_ptr<QPDFObject> new_obj;
|
||||||
|
|
||||||
if (isBool() || isInteger() || isName() || isNull() || isReal() ||
|
if (isBool() || isInteger() || isName() || isNull() || isReal() ||
|
||||||
|
Loading…
Reference in New Issue
Block a user