diff options
Diffstat (limited to 'libqpdf/qpdf-c.cc')
-rw-r--r-- | libqpdf/qpdf-c.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libqpdf/qpdf-c.cc b/libqpdf/qpdf-c.cc index 05568558..1f7b85cb 100644 --- a/libqpdf/qpdf-c.cc +++ b/libqpdf/qpdf-c.cc @@ -269,9 +269,8 @@ qpdf_read(qpdf_data qpdf, char const* filename, char const* password) qpdf->filename = filename; qpdf->password = password; status = trap_errors(qpdf, &call_read); - // We no longer have a good way to exercise a file with both - // warnings and errors because qpdf is getting much better at - // recovering. + // We no longer have a good way to exercise a file with both warnings and errors because qpdf is + // getting much better at recovering. QTC::TC( "qpdf", "qpdf-c called qpdf_read", @@ -806,23 +805,21 @@ template <class RET> static RET trap_oh_errors(qpdf_data qpdf, std::function<RET()> fallback, std::function<RET(qpdf_data)> fn) { - // Note: fallback is a function so we don't have to evaluate it - // unless needed. This is important because sometimes the fallback - // creates an object. + // Note: fallback is a function so we don't have to evaluate it unless needed. This is important + // because sometimes the fallback creates an object. RET ret; QPDF_ERROR_CODE status = trap_errors(qpdf, [&ret, fn](qpdf_data q) { ret = fn(q); }); if (status & QPDF_ERRORS) { if (!qpdf->silence_errors) { QTC::TC("qpdf", "qpdf-c warn about oh error", qpdf->oh_error_occurred ? 0 : 1); if (!qpdf->oh_error_occurred) { - qpdf->warnings.push_back(QPDFExc( + qpdf->warnings.emplace_back( qpdf_e_internal, qpdf->qpdf->getFilename(), "", 0, - "C API function caught an exception that it isn't" - " returning; please point the application developer" - " to ERROR HANDLING in qpdf-c.h")); + "C API function caught an exception that it isn't returning; please point the " + "application developer to ERROR HANDLING in qpdf-c.h"); qpdf->oh_error_occurred = true; } *QPDFLogger::defaultLogger()->getError() << qpdf->error->what() << "\n"; |