aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_optimization.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-30 04:04:52 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-30 04:14:20 +0100
commitb776dcd2d3180becef8f58158873a91004e324ee (patch)
treee82a4490ab93bd6039eeb1388c82f2d96ee83705 /libqpdf/QPDF_optimization.cc
parent8d229e078f7e9f8af36ef983bb777c446aa5309b (diff)
downloadqpdf-b776dcd2d3180becef8f58158873a91004e324ee.tar.zst
Clean up some private functions
Diffstat (limited to 'libqpdf/QPDF_optimization.cc')
-rw-r--r--libqpdf/QPDF_optimization.cc19
1 files changed, 4 insertions, 15 deletions
diff --git a/libqpdf/QPDF_optimization.cc b/libqpdf/QPDF_optimization.cc
index ecece7db..5d959f10 100644
--- a/libqpdf/QPDF_optimization.cc
+++ b/libqpdf/QPDF_optimization.cc
@@ -163,9 +163,11 @@ QPDF::pushInheritedAttributesToPage(bool allow_changes, bool warn_skipped_keys)
// Pages nodes that contain values for them.
std::map<std::string, std::vector<QPDFObjectHandle> > key_ancestors;
this->m->all_pages.clear();
+ std::set<QPDFObjGen> visited;
pushInheritedAttributesToPageInternal(
this->m->trailer.getKey("/Root").getKey("/Pages"),
- key_ancestors, this->m->all_pages, allow_changes, warn_skipped_keys);
+ key_ancestors, this->m->all_pages, allow_changes, warn_skipped_keys,
+ visited);
if (! key_ancestors.empty())
{
throw std::logic_error(
@@ -180,19 +182,6 @@ QPDF::pushInheritedAttributesToPageInternal(
QPDFObjectHandle cur_pages,
std::map<std::string, std::vector<QPDFObjectHandle> >& key_ancestors,
std::vector<QPDFObjectHandle>& pages,
- bool allow_changes, bool warn_skipped_keys)
-{
- std::set<QPDFObjGen> visited;
- pushInheritedAttributesToPageInternal2(
- cur_pages, key_ancestors, pages, allow_changes,
- warn_skipped_keys, visited);
-}
-
-void
-QPDF::pushInheritedAttributesToPageInternal2(
- QPDFObjectHandle cur_pages,
- std::map<std::string, std::vector<QPDFObjectHandle> >& key_ancestors,
- std::vector<QPDFObjectHandle>& pages,
bool allow_changes, bool warn_skipped_keys,
std::set<QPDFObjGen>& visited)
{
@@ -291,7 +280,7 @@ QPDF::pushInheritedAttributesToPageInternal2(
int n = kids.getArrayNItems();
for (int i = 0; i < n; ++i)
{
- pushInheritedAttributesToPageInternal2(
+ pushInheritedAttributesToPageInternal(
kids.getArrayItem(i), key_ancestors, pages,
allow_changes, warn_skipped_keys, visited);
}