QPDF::pushInheritedAttributesToPage(bool allow_changes, bool warn_skipped_keys)
{
    // Traverse pages tree pushing all inherited resources down to the
    // page level.

    // The record of whether we've done this is cleared by
    // updateAllPagesCache().  If we're warning for skipped keys,
    // re-traverse unconditionally.
    if (this->m->pushed_inherited_attributes_to_pages && (! warn_skipped_keys))
    {
        return;
    }

    // Calling getAllPages() resolves any duplicated page objects.
    getAllPages();

    // key_ancestors is a mapping of page attribute keys to a stack of
    // 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,
        visited);
    if (! key_ancestors.empty())
    {
        throw std::logic_error(
            "key_ancestors not empty after"
            " pushing inherited attributes to pages");
    }
    this->m->pushed_inherited_attributes_to_pages = true;
}
QPDF::pushInheritedAttributesToPage(bool allow_changes, bool warn_skipped_keys)
{
     
     

     
     
     
    if (this->m->pushed_inherited_attributes_to_pages && (! warn_skipped_keys))
    {
        return;
    }

     
    getAllPages();

     
     
    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,
        visited);
    if (! key_ancestors.empty())
    {
        throw std::logic_error(
            "key_ancestors not empty after"
            " pushing inherited attributes to pages");
    }
    this->m->pushed_inherited_attributes_to_pages = true;
}