From b683e65ccaa15a3cecbbfa6137e097ac71814cb2 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 25 Jul 2023 12:43:19 +0100 Subject: Simplify QPDFObjectHandle::isPageObject --- libqpdf/QPDFObjectHandle.cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'libqpdf/QPDFObjectHandle.cc') 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 -- cgit v1.2.3-54-g00ecf