Commit b19e06fd8bc1d4fe032c4ad344bb60edb16867ae
Committed by
Jay Berkenbilt
1 parent
83910224
Change QPDFParser::setDescription to take a shared_ptr<QPDFObject> parameter
Showing
2 changed files
with
6 additions
and
4 deletions
libqpdf/QPDFParser.cc
| ... | ... | @@ -381,7 +381,7 @@ QPDFParser::parse(bool& empty, bool content_stream) |
| 381 | 381 | "dictionary ended prematurely; " |
| 382 | 382 | "using null as value for last key"); |
| 383 | 383 | val = QPDFObjectHandle::newNull(); |
| 384 | - setDescription(val, offset); | |
| 384 | + setDescription(val.obj, offset); | |
| 385 | 385 | } else { |
| 386 | 386 | val = olist.at(++i); |
| 387 | 387 | } |
| ... | ... | @@ -432,9 +432,10 @@ QPDFParser::parse(bool& empty, bool content_stream) |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | void |
| 435 | -QPDFParser::setDescription(QPDFObjectHandle oh, qpdf_offset_t parsed_offset) | |
| 435 | +QPDFParser::setDescription( | |
| 436 | + std::shared_ptr<QPDFObject>& obj, qpdf_offset_t parsed_offset) | |
| 436 | 437 | { |
| 437 | - if (auto& obj = oh.obj) { | |
| 438 | + if (obj) { | |
| 438 | 439 | obj->setDescription(context, description, parsed_offset); |
| 439 | 440 | } |
| 440 | 441 | } | ... | ... |
libqpdf/qpdf/QPDFParser.hh
| ... | ... | @@ -42,7 +42,8 @@ class QPDFParser |
| 42 | 42 | void warn(qpdf_offset_t offset, std::string const& msg) const; |
| 43 | 43 | void warn(std::string const& msg) const; |
| 44 | 44 | static void warn(QPDF*, QPDFExc const&); |
| 45 | - void setDescription(QPDFObjectHandle oh, qpdf_offset_t parsed_offset); | |
| 45 | + void setDescription( | |
| 46 | + std::shared_ptr<QPDFObject>& obj, qpdf_offset_t parsed_offset); | |
| 46 | 47 | std::shared_ptr<InputSource> input; |
| 47 | 48 | std::string const& object_description; |
| 48 | 49 | QPDFTokenizer& tokenizer; | ... | ... |