diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-12-31 13:13:32 +0100 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-12-31 16:23:59 +0100 |
commit | ec35156ab0fef078600e6d3551178adf73b87b3b (patch) | |
tree | f3930f65bec2aee82d8082724dd1b6b6bf68bb27 /libqpdf/qpdf | |
parent | 0ef2def8ad1f280adc34825b1588d9811d9ac031 (diff) | |
download | qpdf-ec35156ab0fef078600e6d3551178adf73b87b3b.tar.zst |
Refactor QPDFValue::getDescription
Remove parameters and return the description.
Diffstat (limited to 'libqpdf/qpdf')
-rw-r--r-- | libqpdf/qpdf/QPDFObject_private.hh | 4 | ||||
-rw-r--r-- | libqpdf/qpdf/QPDFValue.hh | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/libqpdf/qpdf/QPDFObject_private.hh b/libqpdf/qpdf/QPDFObject_private.hh index 416483c2..4d388503 100644 --- a/libqpdf/qpdf/QPDFObject_private.hh +++ b/libqpdf/qpdf/QPDFObject_private.hh @@ -79,7 +79,9 @@ class QPDFObject bool getDescription(QPDF*& qpdf, std::string& description) { - return value->getDescription(qpdf, description); + qpdf = value->qpdf; + description = value->getDescription(); + return qpdf != nullptr; } bool hasDescription() diff --git a/libqpdf/qpdf/QPDFValue.hh b/libqpdf/qpdf/QPDFValue.hh index 2d3b9de3..c64f0d6e 100644 --- a/libqpdf/qpdf/QPDFValue.hh +++ b/libqpdf/qpdf/QPDFValue.hh @@ -44,11 +44,10 @@ class QPDFValue qpdf = a_qpdf; og = a_og; } - bool - getDescription(QPDF*& qpdf_p, std::string& description) + std::string + getDescription() { - qpdf_p = qpdf; - description = object_description ? *object_description : ""; + auto description = object_description ? *object_description : ""; if (auto pos = description.find("$OG"); pos != std::string::npos) { description.replace(pos, 3, og.unparse(' ')); } @@ -59,7 +58,7 @@ class QPDFValue description.replace(pos, 3, std::to_string(parsed_offset + shift)); } - return qpdf != nullptr; + return description; } bool hasDescription() |