Commit ebc15f4dd06a00860de7cc19237deaee6ac54a1c
Committed by
Jay Berkenbilt
1 parent
64059014
Remove redundant parameter first_level_only from QPDFObjectHandle::copyObject
Showing
2 changed files
with
6 additions
and
14 deletions
include/qpdf/QPDFObjectHandle.hh
| ... | ... | @@ -1631,7 +1631,6 @@ class QPDFObjectHandle |
| 1631 | 1631 | void copyObject( |
| 1632 | 1632 | std::set<QPDFObjGen>& visited, |
| 1633 | 1633 | bool cross_indirect, |
| 1634 | - bool first_level_only, | |
| 1635 | 1634 | bool stop_at_streams); |
| 1636 | 1635 | void disconnect(); |
| 1637 | 1636 | void setParsedOffset(qpdf_offset_t offset); | ... | ... |
libqpdf/QPDFObjectHandle.cc
| ... | ... | @@ -2219,13 +2219,9 @@ QPDFObjectHandle::unsafeShallowCopy() |
| 2219 | 2219 | |
| 2220 | 2220 | void |
| 2221 | 2221 | QPDFObjectHandle::copyObject( |
| 2222 | - std::set<QPDFObjGen>& visited, | |
| 2223 | - bool cross_indirect, | |
| 2224 | - bool first_level_only, | |
| 2225 | - bool stop_at_streams) | |
| 2222 | + std::set<QPDFObjGen>& visited, bool cross_indirect, bool stop_at_streams) | |
| 2226 | 2223 | { |
| 2227 | 2224 | assertInitialized(); |
| 2228 | - | |
| 2229 | 2225 | if (isStream()) { |
| 2230 | 2226 | QTC::TC( |
| 2231 | 2227 | "qpdf", "QPDFObjectHandle copy stream", stop_at_streams ? 0 : 1); |
| ... | ... | @@ -2263,10 +2259,9 @@ QPDFObjectHandle::copyObject( |
| 2263 | 2259 | int n = array->getNItems(); |
| 2264 | 2260 | for (int i = 0; i < n; ++i) { |
| 2265 | 2261 | items.push_back(array->getItem(i)); |
| 2266 | - if ((!first_level_only) && | |
| 2267 | - (cross_indirect || (!items.back().isIndirect()))) { | |
| 2262 | + if ((cross_indirect || (!items.back().isIndirect()))) { | |
| 2268 | 2263 | items.back().copyObject( |
| 2269 | - visited, cross_indirect, first_level_only, stop_at_streams); | |
| 2264 | + visited, cross_indirect, stop_at_streams); | |
| 2270 | 2265 | } |
| 2271 | 2266 | } |
| 2272 | 2267 | new_obj = QPDF_Array::create(items); |
| ... | ... | @@ -2275,10 +2270,8 @@ QPDFObjectHandle::copyObject( |
| 2275 | 2270 | auto dict = asDictionary(); |
| 2276 | 2271 | for (auto const& key: getKeys()) { |
| 2277 | 2272 | items[key] = dict->getKey(key); |
| 2278 | - if ((!first_level_only) && | |
| 2279 | - (cross_indirect || (!items[key].isIndirect()))) { | |
| 2280 | - items[key].copyObject( | |
| 2281 | - visited, cross_indirect, first_level_only, stop_at_streams); | |
| 2273 | + if ((cross_indirect || (!items[key].isIndirect()))) { | |
| 2274 | + items[key].copyObject(visited, cross_indirect, stop_at_streams); | |
| 2282 | 2275 | } |
| 2283 | 2276 | } |
| 2284 | 2277 | new_obj = QPDF_Dictionary::create(items); |
| ... | ... | @@ -2316,7 +2309,7 @@ void |
| 2316 | 2309 | QPDFObjectHandle::makeDirect(bool allow_streams) |
| 2317 | 2310 | { |
| 2318 | 2311 | std::set<QPDFObjGen> visited; |
| 2319 | - copyObject(visited, true, false, allow_streams); | |
| 2312 | + copyObject(visited, true, allow_streams); | |
| 2320 | 2313 | } |
| 2321 | 2314 | |
| 2322 | 2315 | void | ... | ... |