aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/QPDFValue.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-09-07 20:11:24 +0200
committerJay Berkenbilt <ejb@ql.org>2022-09-08 16:19:38 +0200
commit4422588d7d51e226e6aeecfa9e53382aeb54d7c4 (patch)
tree2fc7a2bfa89a82ae30abe0f08e4a06ef564b021a /libqpdf/qpdf/QPDFValue.hh
parent0132261ee06e9b94bdc011eb4dc3fcd3a403e5f3 (diff)
downloadqpdf-4422588d7d51e226e6aeecfa9e53382aeb54d7c4.tar.zst
Remove unneeded owning_qpdf from QPDFValue
The qpdf member was already sufficient. Removing this actually fixed a few pre-existing issues around detecting foreign ownership and allowing certain conditions to be warnings rather than exceptions.
Diffstat (limited to 'libqpdf/qpdf/QPDFValue.hh')
-rw-r--r--libqpdf/qpdf/QPDFValue.hh13
1 files changed, 6 insertions, 7 deletions
diff --git a/libqpdf/qpdf/QPDFValue.hh b/libqpdf/qpdf/QPDFValue.hh
index bac573d6..69f7eeda 100644
--- a/libqpdf/qpdf/QPDFValue.hh
+++ b/libqpdf/qpdf/QPDFValue.hh
@@ -24,22 +24,22 @@ class QPDFValue
virtual std::string unparse() = 0;
virtual JSON getJSON(int json_version) = 0;
virtual void
- setDescription(QPDF* qpdf, std::string const& description)
+ setDescription(QPDF* qpdf_p, std::string const& description)
{
- owning_qpdf = qpdf;
+ qpdf = qpdf_p;
object_description = description;
}
bool
- getDescription(QPDF*& qpdf, std::string& description)
+ getDescription(QPDF*& qpdf_p, std::string& description)
{
- qpdf = owning_qpdf;
+ qpdf_p = qpdf;
description = object_description;
- return owning_qpdf != nullptr;
+ return qpdf != nullptr;
}
bool
hasDescription()
{
- return owning_qpdf != nullptr;
+ return qpdf != nullptr && !object_description.empty();
}
void
setParsedOffset(qpdf_offset_t offset)
@@ -92,7 +92,6 @@ class QPDFValue
private:
QPDFValue(QPDFValue const&) = delete;
QPDFValue& operator=(QPDFValue const&) = delete;
- QPDF* owning_qpdf{nullptr};
std::string object_description;
qpdf_offset_t parsed_offset{-1};
const qpdf_object_type_e type_code;