2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 20:00:53 +00:00

Simplify QPDFObjectHandle::isPageObject

This commit is contained in:
m-holger 2023-07-25 12:43:19 +01:00
parent c1afe9f83b
commit b683e65cca

View File

@ -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