Commit 84e29026f5ac9bb63180da92944fd8aa1cd0e8d4

Authored by Jay Berkenbilt
Committed by GitHub
2 parents b480f718 5af32b53

Merge pull request #926 from m-holger/omap

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