Commit 585ecf17c87d86c6fb07ebbbef703a8a859680f2
Committed by
Jay Berkenbilt
1 parent
ebc15f4d
Remove redundant parameter cross_indirect from QPDFObjectHandle::copyObject
Showing
2 changed files
with
5 additions
and
13 deletions
include/qpdf/QPDFObjectHandle.hh
| @@ -1628,10 +1628,7 @@ class QPDFObjectHandle | @@ -1628,10 +1628,7 @@ class QPDFObjectHandle | ||
| 1628 | void objectWarning(std::string const& warning); | 1628 | void objectWarning(std::string const& warning); |
| 1629 | void assertType(char const* type_name, bool istype); | 1629 | void assertType(char const* type_name, bool istype); |
| 1630 | bool dereference(); | 1630 | bool dereference(); |
| 1631 | - void copyObject( | ||
| 1632 | - std::set<QPDFObjGen>& visited, | ||
| 1633 | - bool cross_indirect, | ||
| 1634 | - bool stop_at_streams); | 1631 | + void copyObject(std::set<QPDFObjGen>& visited, bool stop_at_streams); |
| 1635 | void disconnect(); | 1632 | void disconnect(); |
| 1636 | void setParsedOffset(qpdf_offset_t offset); | 1633 | void setParsedOffset(qpdf_offset_t offset); |
| 1637 | void parseContentStream_internal( | 1634 | void parseContentStream_internal( |
libqpdf/QPDFObjectHandle.cc
| @@ -2219,7 +2219,7 @@ QPDFObjectHandle::unsafeShallowCopy() | @@ -2219,7 +2219,7 @@ QPDFObjectHandle::unsafeShallowCopy() | ||
| 2219 | 2219 | ||
| 2220 | void | 2220 | void |
| 2221 | QPDFObjectHandle::copyObject( | 2221 | QPDFObjectHandle::copyObject( |
| 2222 | - std::set<QPDFObjGen>& visited, bool cross_indirect, bool stop_at_streams) | 2222 | + std::set<QPDFObjGen>& visited, bool stop_at_streams) |
| 2223 | { | 2223 | { |
| 2224 | assertInitialized(); | 2224 | assertInitialized(); |
| 2225 | if (isStream()) { | 2225 | if (isStream()) { |
| @@ -2259,10 +2259,7 @@ QPDFObjectHandle::copyObject( | @@ -2259,10 +2259,7 @@ QPDFObjectHandle::copyObject( | ||
| 2259 | int n = array->getNItems(); | 2259 | int n = array->getNItems(); |
| 2260 | for (int i = 0; i < n; ++i) { | 2260 | for (int i = 0; i < n; ++i) { |
| 2261 | items.push_back(array->getItem(i)); | 2261 | items.push_back(array->getItem(i)); |
| 2262 | - if ((cross_indirect || (!items.back().isIndirect()))) { | ||
| 2263 | - items.back().copyObject( | ||
| 2264 | - visited, cross_indirect, stop_at_streams); | ||
| 2265 | - } | 2262 | + items.back().copyObject(visited, stop_at_streams); |
| 2266 | } | 2263 | } |
| 2267 | new_obj = QPDF_Array::create(items); | 2264 | new_obj = QPDF_Array::create(items); |
| 2268 | } else if (isDictionary()) { | 2265 | } else if (isDictionary()) { |
| @@ -2270,9 +2267,7 @@ QPDFObjectHandle::copyObject( | @@ -2270,9 +2267,7 @@ QPDFObjectHandle::copyObject( | ||
| 2270 | auto dict = asDictionary(); | 2267 | auto dict = asDictionary(); |
| 2271 | for (auto const& key: getKeys()) { | 2268 | for (auto const& key: getKeys()) { |
| 2272 | items[key] = dict->getKey(key); | 2269 | items[key] = dict->getKey(key); |
| 2273 | - if ((cross_indirect || (!items[key].isIndirect()))) { | ||
| 2274 | - items[key].copyObject(visited, cross_indirect, stop_at_streams); | ||
| 2275 | - } | 2270 | + items[key].copyObject(visited, stop_at_streams); |
| 2276 | } | 2271 | } |
| 2277 | new_obj = QPDF_Dictionary::create(items); | 2272 | new_obj = QPDF_Dictionary::create(items); |
| 2278 | } else { | 2273 | } else { |
| @@ -2309,7 +2304,7 @@ void | @@ -2309,7 +2304,7 @@ void | ||
| 2309 | QPDFObjectHandle::makeDirect(bool allow_streams) | 2304 | QPDFObjectHandle::makeDirect(bool allow_streams) |
| 2310 | { | 2305 | { |
| 2311 | std::set<QPDFObjGen> visited; | 2306 | std::set<QPDFObjGen> visited; |
| 2312 | - copyObject(visited, true, allow_streams); | 2307 | + copyObject(visited, allow_streams); |
| 2313 | } | 2308 | } |
| 2314 | 2309 | ||
| 2315 | void | 2310 | void |