aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageObjectHelper.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-01-26 09:00:23 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-01-27 14:31:12 +0100
commit07db3200cb0ef058b8a66ece8d9757adfba49fd1 (patch)
tree084c94a5778581451bb42e5cd38fffeb36a12e2b /libqpdf/QPDFPageObjectHelper.cc
parent710d2e54f0762b7702640766d33b7e0977ba69de (diff)
downloadqpdf-07db3200cb0ef058b8a66ece8d9757adfba49fd1.tar.zst
Remove some if statements and simplify some boolean expressions
Use QPDFObjectHandle::isNameAndEquals, isDictionaryOfType and isStreamOfType.
Diffstat (limited to 'libqpdf/QPDFPageObjectHelper.cc')
-rw-r--r--libqpdf/QPDFPageObjectHelper.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc
index 7f7e6bea..ca543471 100644
--- a/libqpdf/QPDFPageObjectHelper.cc
+++ b/libqpdf/QPDFPageObjectHelper.cc
@@ -558,10 +558,7 @@ QPDFPageObjectHelper::getAnnotations(std::string const& only_subtype)
for (int i = 0; i < nannots; ++i)
{
QPDFObjectHandle annot = annots.getArrayItem(i);
- if (only_subtype.empty() ||
- (annot.isDictionary() &&
- annot.getKey("/Subtype").isName() &&
- (only_subtype == annot.getKey("/Subtype").getName())))
+ if (annot.isDictionaryOfType("", only_subtype))
{
result.push_back(QPDFAnnotationObjectHelper(annot));
}