aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-08-10 14:16:06 +0200
committerm-holger <m-holger@kubitscheck.org>2022-09-01 18:08:45 +0200
commitae6e484e23e4f11878689be32bfcc6a28259b708 (patch)
treedbd76f13c1445ddcc58d39d890ed8233eb113200
parent356b582cec5be67cbf60ad64a1b2a7cab689dd77 (diff)
downloadqpdf-ae6e484e23e4f11878689be32bfcc6a28259b708.tar.zst
Change return type of QPDF::resolve to void
-rw-r--r--include/qpdf/QPDF.hh6
-rw-r--r--libqpdf/QPDF.cc10
-rw-r--r--libqpdf/QPDFObjectHandle.cc2
3 files changed, 8 insertions, 10 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index c187d53f..42097425 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -846,10 +846,10 @@ class QPDF
friend class QPDFObjectHandle;
private:
- static std::shared_ptr<QPDFObject>
+ static void
resolve(QPDF* qpdf, QPDFObjGen const& og)
{
- return qpdf->resolve(og);
+ qpdf->resolve(og);
}
};
friend class Resolver;
@@ -1168,7 +1168,7 @@ class QPDF
std::string const& description,
QPDFObjGen const& exp_og,
QPDFObjGen& og);
- std::shared_ptr<QPDFObject> resolve(QPDFObjGen const& og);
+ void resolve(QPDFObjGen const& og);
void resolveObjectsInStream(int obj_stream_number);
void stopOnError(std::string const& message);
QPDFObjectHandle reserveObjectIfNotExists(QPDFObjGen const& og);
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 39043048..553c1a41 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -1926,12 +1926,12 @@ QPDF::readObjectAtOffset(
return oh;
}
-std::shared_ptr<QPDFObject>
+void
QPDF::resolve(QPDFObjGen const& og)
{
if (isCached(og) && !isUnresolved(og)) {
// We only need to resolve unresolved objects
- return m->obj_cache[og].object;
+ return;
}
// Check object cache before checking xref table. This allows us
@@ -1947,9 +1947,8 @@ QPDF::resolve(QPDFObjGen const& og)
"",
this->m->file->getLastOffset(),
("loop detected resolving object " + og.unparse(' ')));
-
updateCache(og, QPDF_Null::create(), -1, -1);
- return m->obj_cache[og].object;
+ return;
}
ResolveRecorder rr(this, og);
@@ -1998,11 +1997,10 @@ QPDF::resolve(QPDFObjGen const& og)
updateCache(og, QPDF_Null::create(), -1, -1);
}
- std::shared_ptr<QPDFObject> result(this->m->obj_cache[og].object);
+ auto result(this->m->obj_cache[og].object);
if (!result->hasDescription()) {
result->setDescription(this, ("object " + og.unparse(' ')));
}
- return result;
}
void
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index d4a75fae..8a38352f 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -2596,7 +2596,7 @@ QPDFObjectHandle::dereference()
return false;
}
if (this->obj->isUnresolved()) {
- this->obj = QPDF::Resolver::resolve(this->qpdf, getObjGen());
+ QPDF::Resolver::resolve(this->qpdf, getObjGen());
}
return true;
}