summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_aaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_aaction.cpp')
-rw-r--r--core/fpdfdoc/cpdf_aaction.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/fpdfdoc/cpdf_aaction.cpp b/core/fpdfdoc/cpdf_aaction.cpp
index 9a95340114..8d954697b4 100644
--- a/core/fpdfdoc/cpdf_aaction.cpp
+++ b/core/fpdfdoc/cpdf_aaction.cpp
@@ -32,8 +32,9 @@ constexpr const char* g_sAATypes[] = {
"DP", // DocumentPrinted
};
-// |g_sAATypes| should have as many elements as enum AActionType.
-static_assert(FX_ArraySize(g_sAATypes) == CPDF_AAction::NumberOfActions,
+// |g_sAATypes| should have one less element than enum AActionType due to
+// DocumentOpen, which is an artificial type.
+static_assert(FX_ArraySize(g_sAATypes) == CPDF_AAction::NumberOfActions - 1,
"g_sAATypes count mismatch");
} // namespace
@@ -52,3 +53,14 @@ CPDF_Action CPDF_AAction::GetAction(AActionType eType) const {
return CPDF_Action(m_pDict ? m_pDict->GetDictFor(g_sAATypes[eType])
: nullptr);
}
+
+// static
+bool CPDF_AAction::IsUserClick(AActionType eType) {
+ switch (eType) {
+ case ButtonUp:
+ case ButtonDown:
+ return true;
+ default:
+ return false;
+ }
+}