diff options
author | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2023-09-02 21:37:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 21:37:06 +0200 |
commit | fb704143cd7ebe8dc13885f41cc3ad168c45eb4c (patch) | |
tree | a396b0863ac70d7ecdc0900c67f5179fb74c2021 /libqpdf | |
parent | e640dd30be0fbc7ea29adc137f27b3dc2bfc7466 (diff) | |
parent | b683e65ccaa15a3cecbbfa6137e097ac71814cb2 (diff) | |
download | qpdf-fb704143cd7ebe8dc13885f41cc3ad168c45eb4c.tar.zst |
Merge pull request #1013 from m-holger/po
Simplify QPDFObjectHandle::isPageObject
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 17894560..d5ac137a 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -2299,22 +2299,7 @@ QPDFObjectHandle::isPageObject() } // getAllPages repairs /Type when traversing the page tree. getOwningQPDF()->getAllPages(); - if (!this->isDictionary()) { - return false; - } - if (this->hasKey("/Type")) { - QPDFObjectHandle type = this->getKey("/Type"); - if (type.isNameAndEquals("/Page")) { - return true; - } - // Files have been seen in the wild that have /Type (Page) - else if (type.isString() && (type.getStringValue() == "Page")) { - return true; - } else { - return false; - } - } - return false; + return isDictionaryOfType("/Page"); } bool |