Commit fb704143cd7ebe8dc13885f41cc3ad168c45eb4c
Committed by
GitHub
Merge pull request #1013 from m-holger/po
Simplify QPDFObjectHandle::isPageObject
Showing
1 changed file
with
1 additions
and
16 deletions
libqpdf/QPDFObjectHandle.cc
| ... | ... | @@ -2299,22 +2299,7 @@ QPDFObjectHandle::isPageObject() |
| 2299 | 2299 | } |
| 2300 | 2300 | // getAllPages repairs /Type when traversing the page tree. |
| 2301 | 2301 | getOwningQPDF()->getAllPages(); |
| 2302 | - if (!this->isDictionary()) { | |
| 2303 | - return false; | |
| 2304 | - } | |
| 2305 | - if (this->hasKey("/Type")) { | |
| 2306 | - QPDFObjectHandle type = this->getKey("/Type"); | |
| 2307 | - if (type.isNameAndEquals("/Page")) { | |
| 2308 | - return true; | |
| 2309 | - } | |
| 2310 | - // Files have been seen in the wild that have /Type (Page) | |
| 2311 | - else if (type.isString() && (type.getStringValue() == "Page")) { | |
| 2312 | - return true; | |
| 2313 | - } else { | |
| 2314 | - return false; | |
| 2315 | - } | |
| 2316 | - } | |
| 2317 | - return false; | |
| 2302 | + return isDictionaryOfType("/Page"); | |
| 2318 | 2303 | } |
| 2319 | 2304 | |
| 2320 | 2305 | bool | ... | ... |