Commit b683e65ccaa15a3cecbbfa6137e097ac71814cb2

Authored by m-holger
1 parent c1afe9f8

Simplify QPDFObjectHandle::isPageObject

Showing 1 changed file with 1 additions and 16 deletions
libqpdf/QPDFObjectHandle.cc
@@ -2299,22 +2299,7 @@ QPDFObjectHandle::isPageObject() @@ -2299,22 +2299,7 @@ QPDFObjectHandle::isPageObject()
2299 } 2299 }
2300 // getAllPages repairs /Type when traversing the page tree. 2300 // getAllPages repairs /Type when traversing the page tree.
2301 getOwningQPDF()->getAllPages(); 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 bool 2305 bool