Commit 846504129f58a638ba481c4329187be8ebb20419
Committed by
Jay Berkenbilt
1 parent
b19e06fd
Remove redundant parameter qpdf from QPDFParser::warn
Showing
2 changed files
with
6 additions
and
12 deletions
libqpdf/QPDFParser.cc
| ... | ... | @@ -441,14 +441,14 @@ QPDFParser::setDescription( |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | void |
| 444 | -QPDFParser::warn(QPDF* qpdf, QPDFExc const& e) | |
| 444 | +QPDFParser::warn(QPDFExc const& e) const | |
| 445 | 445 | { |
| 446 | 446 | // If parsing on behalf of a QPDF object and want to give a |
| 447 | 447 | // warning, we can warn through the object. If parsing for some |
| 448 | 448 | // other reason, such as an explicit creation of an object from a |
| 449 | 449 | // string, then just throw the exception. |
| 450 | - if (qpdf) { | |
| 451 | - qpdf->warn(e); | |
| 450 | + if (context) { | |
| 451 | + context->warn(e); | |
| 452 | 452 | } else { |
| 453 | 453 | throw e; |
| 454 | 454 | } |
| ... | ... | @@ -457,14 +457,8 @@ QPDFParser::warn(QPDF* qpdf, QPDFExc const& e) |
| 457 | 457 | void |
| 458 | 458 | QPDFParser::warn(qpdf_offset_t offset, std::string const& msg) const |
| 459 | 459 | { |
| 460 | - warn( | |
| 461 | - context, | |
| 462 | - QPDFExc( | |
| 463 | - qpdf_e_damaged_pdf, | |
| 464 | - input->getName(), | |
| 465 | - object_description, | |
| 466 | - offset, | |
| 467 | - msg)); | |
| 460 | + warn(QPDFExc( | |
| 461 | + qpdf_e_damaged_pdf, input->getName(), object_description, offset, msg)); | |
| 468 | 462 | } |
| 469 | 463 | |
| 470 | 464 | void | ... | ... |
libqpdf/qpdf/QPDFParser.hh
| ... | ... | @@ -41,7 +41,7 @@ class QPDFParser |
| 41 | 41 | |
| 42 | 42 | void warn(qpdf_offset_t offset, std::string const& msg) const; |
| 43 | 43 | void warn(std::string const& msg) const; |
| 44 | - static void warn(QPDF*, QPDFExc const&); | |
| 44 | + void warn(QPDFExc const&) const; | |
| 45 | 45 | void setDescription( |
| 46 | 46 | std::shared_ptr<QPDFObject>& obj, qpdf_offset_t parsed_offset); |
| 47 | 47 | std::shared_ptr<InputSource> input; | ... | ... |