mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 07:12:28 +00:00
Remove redundant parameters cross_indirect and stop_atstreams from QPDFObjectHandle::copyObject2
This commit is contained in:
parent
63d1dcb414
commit
0827b1096e
@ -1634,11 +1634,7 @@ class QPDFObjectHandle
|
|||||||
bool first_level_only,
|
bool first_level_only,
|
||||||
bool stop_at_streams);
|
bool stop_at_streams);
|
||||||
void shallowCopyInternal1(QPDFObjectHandle& oh, bool first_level_only);
|
void shallowCopyInternal1(QPDFObjectHandle& oh, bool first_level_only);
|
||||||
void copyObject2(
|
void copyObject2(std::set<QPDFObjGen>& visited, bool first_level_only);
|
||||||
std::set<QPDFObjGen>& visited,
|
|
||||||
bool cross_indirect,
|
|
||||||
bool first_level_only,
|
|
||||||
bool stop_at_streams);
|
|
||||||
void shallowCopyInternal2(QPDFObjectHandle& oh, bool first_level_only);
|
void shallowCopyInternal2(QPDFObjectHandle& oh, bool first_level_only);
|
||||||
void copyObject(
|
void copyObject(
|
||||||
std::set<QPDFObjGen>& visited,
|
std::set<QPDFObjGen>& visited,
|
||||||
|
@ -2315,22 +2315,16 @@ QPDFObjectHandle::shallowCopyInternal2(
|
|||||||
new_obj = QPDFObjectHandle(obj->copy(true));
|
new_obj = QPDFObjectHandle(obj->copy(true));
|
||||||
|
|
||||||
std::set<QPDFObjGen> visited;
|
std::set<QPDFObjGen> visited;
|
||||||
new_obj.copyObject2(visited, false, first_level_only, false);
|
new_obj.copyObject2(visited, first_level_only);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
QPDFObjectHandle::copyObject2(
|
QPDFObjectHandle::copyObject2(
|
||||||
std::set<QPDFObjGen>& visited,
|
std::set<QPDFObjGen>& visited, bool first_level_only)
|
||||||
bool cross_indirect,
|
|
||||||
bool first_level_only,
|
|
||||||
bool stop_at_streams)
|
|
||||||
{
|
{
|
||||||
assertInitialized();
|
assertInitialized();
|
||||||
|
|
||||||
if (isStream()) {
|
if (isStream()) {
|
||||||
if (stop_at_streams) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
"attempt to make a stream into a direct object");
|
"attempt to make a stream into a direct object");
|
||||||
}
|
}
|
||||||
@ -2361,11 +2355,10 @@ QPDFObjectHandle::copyObject2(
|
|||||||
int n = array->getNItems();
|
int n = array->getNItems();
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
items.push_back(array->getItem(i));
|
items.push_back(array->getItem(i));
|
||||||
if ((!first_level_only) &&
|
if ((!first_level_only) && !items.back().isIndirect())
|
||||||
(cross_indirect || (!items.back().isIndirect()))) {
|
{
|
||||||
items.back().copyObject2(
|
items.back().copyObject2(visited, first_level_only);
|
||||||
visited, cross_indirect, first_level_only, stop_at_streams);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
new_obj = QPDF_Array::create(items);
|
new_obj = QPDF_Array::create(items);
|
||||||
} else if (isDictionary()) {
|
} else if (isDictionary()) {
|
||||||
@ -2373,11 +2366,10 @@ QPDFObjectHandle::copyObject2(
|
|||||||
auto dict = asDictionary();
|
auto dict = asDictionary();
|
||||||
for (auto const& key: getKeys()) {
|
for (auto const& key: getKeys()) {
|
||||||
items[key] = dict->getKey(key);
|
items[key] = dict->getKey(key);
|
||||||
if ((!first_level_only) &&
|
if ((!first_level_only) && !items[key].isIndirect())
|
||||||
(cross_indirect || (!items[key].isIndirect()))) {
|
{
|
||||||
items[key].copyObject2(
|
items[key].copyObject2(visited, first_level_only);
|
||||||
visited, cross_indirect, first_level_only, stop_at_streams);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
new_obj = QPDF_Dictionary::create(items);
|
new_obj = QPDF_Dictionary::create(items);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user