Commit fe74f28dc4f269e4bf944ae61d77874f81f95daf

Authored by m-holger
1 parent f989de1b

Refactor QPDFValue::setDefaultDescription

libqpdf/QPDFValue.cc
... ... @@ -35,6 +35,8 @@ QPDFValue::getDescription()
35 35 return description;
36 36 }
37 37 }
  38 + } else if (og.isIndirect()) {
  39 + return "object " + og.unparse(' ');
38 40 }
39 41 return {};
40 42 }
... ...
libqpdf/qpdf/QPDFValue.hh
... ... @@ -40,11 +40,6 @@ class QPDFValue
40 40 void
41 41 setDefaultDescription(QPDF* a_qpdf, QPDFObjGen const& a_og)
42 42 {
43   - static auto default_description{
44   - std::make_shared<Description>("object $OG")};
45   - if (!object_description) {
46   - object_description = default_description;
47   - }
48 43 qpdf = a_qpdf;
49 44 og = a_og;
50 45 }
... ... @@ -52,7 +47,7 @@ class QPDFValue
52 47 bool
53 48 hasDescription()
54 49 {
55   - return object_description != nullptr;
  50 + return object_description || og.isIndirect();
56 51 }
57 52 void
58 53 setParsedOffset(qpdf_offset_t offset)
... ...