aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageDocumentHelper.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-25 12:55:31 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-26 04:30:05 +0100
commit009767d97a0dfebbb9bb71efb4b894b25fb59dd8 (patch)
tree6c10e6a67ecee41f511d06e88626f10bb737106a /libqpdf/QPDFPageDocumentHelper.cc
parent2d32f4db8fd125f2481ecf767d9f6506e80481f6 (diff)
downloadqpdf-009767d97a0dfebbb9bb71efb4b894b25fb59dd8.tar.zst
Handle inheritable page attributes
Add getAttribute for handling inheritable page attributes, and fix getPageImages and annotation flattening code to use it.
Diffstat (limited to 'libqpdf/QPDFPageDocumentHelper.cc')
-rw-r--r--libqpdf/QPDFPageDocumentHelper.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/libqpdf/QPDFPageDocumentHelper.cc b/libqpdf/QPDFPageDocumentHelper.cc
index fa50c471..3eec789b 100644
--- a/libqpdf/QPDFPageDocumentHelper.cc
+++ b/libqpdf/QPDFPageDocumentHelper.cc
@@ -79,20 +79,12 @@ QPDFPageDocumentHelper::flattenAnnotations(
"document does not have updated appearance streams,"
" so form fields will not be flattened");
}
- pushInheritedAttributesToPage();
std::vector<QPDFPageObjectHelper> pages = getAllPages();
for (std::vector<QPDFPageObjectHelper>::iterator iter = pages.begin();
iter != pages.end(); ++iter)
{
QPDFPageObjectHelper ph(*iter);
- QPDFObjectHandle page_oh = ph.getObjectHandle();
- if (page_oh.getKey("/Resources").isIndirect())
- {
- QTC::TC("qpdf", "QPDFPageDocumentHelper indirect resources");
- page_oh.replaceKey("/Resources",
- page_oh.getKey("/Resources").shallowCopy());
- }
- QPDFObjectHandle resources = ph.getObjectHandle().getKey("/Resources");
+ QPDFObjectHandle resources = ph.getAttribute("/Resources", true);
if (! resources.isDictionary())
{
// This should never happen and is not exercised in the