mirror of
https://github.com/qpdf/qpdf.git
synced 2024-10-31 19:02:30 +00:00
Add method QPDFObject::resolve
This commit is contained in:
parent
56e9bcabe9
commit
4a8515912c
@ -843,7 +843,7 @@ class QPDF
|
||||
// it can resolve indirect references.
|
||||
class Resolver
|
||||
{
|
||||
friend class QPDFObjectHandle;
|
||||
friend class QPDFObject;
|
||||
|
||||
private:
|
||||
static void
|
||||
|
@ -153,10 +153,19 @@ class QPDFObject
|
||||
}
|
||||
|
||||
bool
|
||||
isUnresolved()
|
||||
isUnresolved() const
|
||||
{
|
||||
return value->type_code == ::ot_unresolved;
|
||||
}
|
||||
void
|
||||
resolve()
|
||||
{
|
||||
if (isUnresolved()) {
|
||||
doResolve();
|
||||
}
|
||||
}
|
||||
void doResolve();
|
||||
|
||||
template <typename T>
|
||||
T*
|
||||
as()
|
||||
|
@ -1 +1,10 @@
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
|
||||
#include <qpdf/QPDF.hh>
|
||||
|
||||
void
|
||||
QPDFObject::doResolve()
|
||||
{
|
||||
auto og = value->og;
|
||||
QPDF::Resolver::resolve(value->qpdf, og);
|
||||
}
|
||||
|
@ -2595,9 +2595,7 @@ QPDFObjectHandle::dereference()
|
||||
if (!isInitialized()) {
|
||||
return false;
|
||||
}
|
||||
if (this->obj->isUnresolved()) {
|
||||
QPDF::Resolver::resolve(this->qpdf, getObjGen());
|
||||
}
|
||||
this->obj->resolve();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user