Commit 5af32b53a36a66698e8762d026f92f0ed8cde710
1 parent
b27be3ed
Remove redundant parameter depth from QPDF::updateObjectMaps
Showing
2 changed files
with
6 additions
and
15 deletions
include/qpdf/QPDF.hh
| @@ -1633,8 +1633,7 @@ class QPDF | @@ -1633,8 +1633,7 @@ class QPDF | ||
| 1633 | QPDFObjectHandle oh, | 1633 | QPDFObjectHandle oh, |
| 1634 | std::function<int(QPDFObjectHandle&)> skip_stream_parameters, | 1634 | std::function<int(QPDFObjectHandle&)> skip_stream_parameters, |
| 1635 | std::set<QPDFObjGen>& visited, | 1635 | std::set<QPDFObjGen>& visited, |
| 1636 | - bool top, | ||
| 1637 | - int depth); | 1636 | + bool top); |
| 1638 | void filterCompressedObjects(std::map<int, int> const& object_stream_data); | 1637 | void filterCompressedObjects(std::map<int, int> const& object_stream_data); |
| 1639 | 1638 | ||
| 1640 | // JSON import | 1639 | // JSON import |
libqpdf/QPDF_optimization.cc
| @@ -285,7 +285,7 @@ QPDF::updateObjectMaps( | @@ -285,7 +285,7 @@ QPDF::updateObjectMaps( | ||
| 285 | std::function<int(QPDFObjectHandle&)> skip_stream_parameters) | 285 | std::function<int(QPDFObjectHandle&)> skip_stream_parameters) |
| 286 | { | 286 | { |
| 287 | std::set<QPDFObjGen> visited; | 287 | std::set<QPDFObjGen> visited; |
| 288 | - updateObjectMapsInternal(ou, oh, skip_stream_parameters, visited, true, 0); | 288 | + updateObjectMapsInternal(ou, oh, skip_stream_parameters, visited, true); |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | void | 291 | void |
| @@ -294,8 +294,7 @@ QPDF::updateObjectMapsInternal( | @@ -294,8 +294,7 @@ QPDF::updateObjectMapsInternal( | ||
| 294 | QPDFObjectHandle oh, | 294 | QPDFObjectHandle oh, |
| 295 | std::function<int(QPDFObjectHandle&)> skip_stream_parameters, | 295 | std::function<int(QPDFObjectHandle&)> skip_stream_parameters, |
| 296 | std::set<QPDFObjGen>& visited, | 296 | std::set<QPDFObjGen>& visited, |
| 297 | - bool top, | ||
| 298 | - int depth) | 297 | + bool top) |
| 299 | { | 298 | { |
| 300 | // Traverse the object tree from this point taking care to avoid | 299 | // Traverse the object tree from this point taking care to avoid |
| 301 | // crossing page boundaries. | 300 | // crossing page boundaries. |
| @@ -324,12 +323,7 @@ QPDF::updateObjectMapsInternal( | @@ -324,12 +323,7 @@ QPDF::updateObjectMapsInternal( | ||
| 324 | int n = oh.getArrayNItems(); | 323 | int n = oh.getArrayNItems(); |
| 325 | for (int i = 0; i < n; ++i) { | 324 | for (int i = 0; i < n; ++i) { |
| 326 | updateObjectMapsInternal( | 325 | updateObjectMapsInternal( |
| 327 | - ou, | ||
| 328 | - oh.getArrayItem(i), | ||
| 329 | - skip_stream_parameters, | ||
| 330 | - visited, | ||
| 331 | - false, | ||
| 332 | - 1 + depth); | 326 | + ou, oh.getArrayItem(i), skip_stream_parameters, visited, false); |
| 333 | } | 327 | } |
| 334 | } else if (oh.isDictionary() || oh.isStream()) { | 328 | } else if (oh.isDictionary() || oh.isStream()) { |
| 335 | QPDFObjectHandle dict = oh; | 329 | QPDFObjectHandle dict = oh; |
| @@ -351,8 +345,7 @@ QPDF::updateObjectMapsInternal( | @@ -351,8 +345,7 @@ QPDF::updateObjectMapsInternal( | ||
| 351 | dict.getKey(key), | 345 | dict.getKey(key), |
| 352 | skip_stream_parameters, | 346 | skip_stream_parameters, |
| 353 | visited, | 347 | visited, |
| 354 | - false, | ||
| 355 | - 1 + depth); | 348 | + false); |
| 356 | } else if (is_page_node && (key == "/Parent")) { | 349 | } else if (is_page_node && (key == "/Parent")) { |
| 357 | // Don't traverse back up the page tree | 350 | // Don't traverse back up the page tree |
| 358 | } else if ( | 351 | } else if ( |
| @@ -367,8 +360,7 @@ QPDF::updateObjectMapsInternal( | @@ -367,8 +360,7 @@ QPDF::updateObjectMapsInternal( | ||
| 367 | dict.getKey(key), | 360 | dict.getKey(key), |
| 368 | skip_stream_parameters, | 361 | skip_stream_parameters, |
| 369 | visited, | 362 | visited, |
| 370 | - false, | ||
| 371 | - 1 + depth); | 363 | + false); |
| 372 | } | 364 | } |
| 373 | } | 365 | } |
| 374 | } | 366 | } |