aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFAnnotationObjectHelper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFAnnotationObjectHelper.cc')
-rw-r--r--libqpdf/QPDFAnnotationObjectHelper.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/libqpdf/QPDFAnnotationObjectHelper.cc b/libqpdf/QPDFAnnotationObjectHelper.cc
index 3295fd3a..5e4be795 100644
--- a/libqpdf/QPDFAnnotationObjectHelper.cc
+++ b/libqpdf/QPDFAnnotationObjectHelper.cc
@@ -49,6 +49,13 @@ QPDFAnnotationObjectHelper::getAppearanceState()
return "";
}
+int
+QPDFAnnotationObjectHelper::getFlags()
+{
+ QPDFObjectHandle flags_obj = this->oh.getKey("/F");
+ return flags_obj.isInteger() ? flags_obj.getIntValue() : 0;
+}
+
QPDFObjectHandle
QPDFAnnotationObjectHelper::getAppearanceStream(
std::string const& which,
@@ -169,13 +176,11 @@ QPDFAnnotationObjectHelper::getPageContentForAppearance(
// appearance matrix.
QPDFObjectHandle rect_obj = this->oh.getKey("/Rect");
- QPDFObjectHandle flags_obj = this->oh.getKey("/F");
QPDFObjectHandle as = getAppearanceStream("/N").getDict();
QPDFObjectHandle bbox_obj = as.getKey("/BBox");
QPDFObjectHandle matrix_obj = as.getKey("/Matrix");
- int flags = flags_obj.isInteger() ? flags_obj.getIntValue() : 0;
-
+ int flags = getFlags();
if (flags & forbidden_flags)
{
QTC::TC("qpdf", "QPDFAnnotationObjectHelper forbidden flags");