aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-02-15 12:30:33 +0100
committerm-holger <m-holger@kubitscheck.org>2023-02-18 09:33:08 +0100
commitfe74f28dc4f269e4bf944ae61d77874f81f95daf (patch)
tree99afe7154748af7ea1c347be767e00736da4f354
parentf989de1bd7b21f4782dd46decd2c63ac4b024705 (diff)
downloadqpdf-fe74f28dc4f269e4bf944ae61d77874f81f95daf.tar.zst
Refactor QPDFValue::setDefaultDescription
-rw-r--r--libqpdf/QPDFValue.cc2
-rw-r--r--libqpdf/qpdf/QPDFValue.hh7
2 files changed, 3 insertions, 6 deletions
diff --git a/libqpdf/QPDFValue.cc b/libqpdf/QPDFValue.cc
index 7c5b30a6..41a00fa8 100644
--- a/libqpdf/QPDFValue.cc
+++ b/libqpdf/QPDFValue.cc
@@ -35,6 +35,8 @@ QPDFValue::getDescription()
return description;
}
}
+ } else if (og.isIndirect()) {
+ return "object " + og.unparse(' ');
}
return {};
}
diff --git a/libqpdf/qpdf/QPDFValue.hh b/libqpdf/qpdf/QPDFValue.hh
index e7904253..8e9d4ea5 100644
--- a/libqpdf/qpdf/QPDFValue.hh
+++ b/libqpdf/qpdf/QPDFValue.hh
@@ -40,11 +40,6 @@ class QPDFValue
void
setDefaultDescription(QPDF* a_qpdf, QPDFObjGen const& a_og)
{
- static auto default_description{
- std::make_shared<Description>("object $OG")};
- if (!object_description) {
- object_description = default_description;
- }
qpdf = a_qpdf;
og = a_og;
}
@@ -52,7 +47,7 @@ class QPDFValue
bool
hasDescription()
{
- return object_description != nullptr;
+ return object_description || og.isIndirect();
}
void
setParsedOffset(qpdf_offset_t offset)