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:
parent
c1afe9f83b
commit
b683e65cca
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user