mirror of
https://github.com/qpdf/qpdf.git
synced 2024-11-01 03:12:29 +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.
|
// it can resolve indirect references.
|
||||||
class Resolver
|
class Resolver
|
||||||
{
|
{
|
||||||
friend class QPDFObjectHandle;
|
friend class QPDFObject;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void
|
static void
|
||||||
|
@ -153,10 +153,19 @@ class QPDFObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
isUnresolved()
|
isUnresolved() const
|
||||||
{
|
{
|
||||||
return value->type_code == ::ot_unresolved;
|
return value->type_code == ::ot_unresolved;
|
||||||
}
|
}
|
||||||
|
void
|
||||||
|
resolve()
|
||||||
|
{
|
||||||
|
if (isUnresolved()) {
|
||||||
|
doResolve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void doResolve();
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T*
|
T*
|
||||||
as()
|
as()
|
||||||
|
@ -1 +1,10 @@
|
|||||||
#include <qpdf/QPDFObject.hh>
|
#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()) {
|
if (!isInitialized()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this->obj->isUnresolved()) {
|
this->obj->resolve();
|
||||||
QPDF::Resolver::resolve(this->qpdf, getObjGen());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user