Commit fc828c2a5093e6f4eda81c817b4db4a0c8bb0984
1 parent
71bba5d4
Tidy QdfFixer::checkObjId
Showing
1 changed file
with
3 additions
and
5 deletions
qpdf/fix-qdf.cc
| @@ -297,14 +297,12 @@ QdfFixer::processLines(std::list<std::string>& lines) | @@ -297,14 +297,12 @@ QdfFixer::processLines(std::list<std::string>& lines) | ||
| 297 | void | 297 | void |
| 298 | QdfFixer::checkObjId(std::string const& cur_obj_str) | 298 | QdfFixer::checkObjId(std::string const& cur_obj_str) |
| 299 | { | 299 | { |
| 300 | - int cur_obj = QUtil::string_to_int(cur_obj_str.c_str()); | ||
| 301 | - if (cur_obj != last_obj + 1) { | 300 | + if (std::stoi(cur_obj_str) != ++last_obj) { |
| 302 | fatal( | 301 | fatal( |
| 303 | filename + ":" + std::to_string(lineno) + ": expected object " + | 302 | filename + ":" + std::to_string(lineno) + ": expected object " + |
| 304 | - std::to_string(last_obj + 1)); | 303 | + std::to_string(last_obj)); |
| 305 | } | 304 | } |
| 306 | - last_obj = cur_obj; | ||
| 307 | - xref.push_back(QPDFXRefEntry(1, QIntC::to_offset(last_offset), 0)); | 305 | + xref.push_back(QPDFXRefEntry(1, last_offset, 0)); |
| 308 | } | 306 | } |
| 309 | 307 | ||
| 310 | void | 308 | void |