From fc828c2a5093e6f4eda81c817b4db4a0c8bb0984 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 7 Mar 2023 19:02:49 +0000 Subject: Tidy QdfFixer::checkObjId --- qpdf/fix-qdf.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qpdf/fix-qdf.cc b/qpdf/fix-qdf.cc index 9992d26c..83632f4d 100644 --- a/qpdf/fix-qdf.cc +++ b/qpdf/fix-qdf.cc @@ -297,14 +297,12 @@ QdfFixer::processLines(std::list& lines) void QdfFixer::checkObjId(std::string const& cur_obj_str) { - int cur_obj = QUtil::string_to_int(cur_obj_str.c_str()); - if (cur_obj != last_obj + 1) { + if (std::stoi(cur_obj_str) != ++last_obj) { fatal( filename + ":" + std::to_string(lineno) + ": expected object " + - std::to_string(last_obj + 1)); + std::to_string(last_obj)); } - last_obj = cur_obj; - xref.push_back(QPDFXRefEntry(1, QIntC::to_offset(last_offset), 0)); + xref.push_back(QPDFXRefEntry(1, last_offset, 0)); } void -- cgit v1.2.3-54-g00ecf