summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_action.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-23 14:42:09 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-23 14:42:09 -0700
commit2f2ffece124e4ed4b96d2846263015d4b5ad6c00 (patch)
tree6966e44279e8d9e1516b7c71219cf66f77a89ca2 /core/src/fpdfdoc/doc_action.cpp
parentd07958fd2d1c4134d865f4ccb056eb925aaa7d2a (diff)
downloadpdfium-2f2ffece124e4ed4b96d2846263015d4b5ad6c00.tar.xz
Merge to XFA - else after returns.
(cherry picked from commit 3c012fef2bb72c8ec1faa73e11ee35539b2559d6) Original Review URL: https://codereview.chromium.org/1243953004 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1239313005 .
Diffstat (limited to 'core/src/fpdfdoc/doc_action.cpp')
-rw-r--r--core/src/fpdfdoc/doc_action.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp
index da2e05af2e..851b2d6709 100644
--- a/core/src/fpdfdoc/doc_action.cpp
+++ b/core/src/fpdfdoc/doc_action.cpp
@@ -112,9 +112,11 @@ FX_DWORD CPDF_ActionFields::GetFieldsCount() const
int iType = pFields->GetType();
if (iType == PDFOBJ_DICTIONARY) {
return 1;
- } else if (iType == PDFOBJ_STRING) {
+ }
+ if (iType == PDFOBJ_STRING) {
return 1;
- } else if (iType == PDFOBJ_ARRAY) {
+ }
+ if (iType == PDFOBJ_ARRAY) {
return ((CPDF_Array*)pFields)->GetCount();
}
return 0;
@@ -207,16 +209,17 @@ CFX_WideString CPDF_Action::GetJavaScript() const
}
CPDF_Dictionary* CPDF_Action::GetAnnot() const
{
- if (m_pDict == NULL) {
- return NULL;
+ if (!m_pDict) {
+ return nullptr;
}
CFX_ByteString csType = m_pDict->GetString("S");
if (csType == FX_BSTRC("Rendition")) {
return m_pDict->GetDict("AN");
- } else if (csType == FX_BSTRC("Movie")) {
+ }
+ if (csType == FX_BSTRC("Movie")) {
return m_pDict->GetDict("Annotation");
}
- return NULL;
+ return nullptr;
}
int32_t CPDF_Action::GetOperationType() const
{
@@ -226,15 +229,19 @@ int32_t CPDF_Action::GetOperationType() const
CFX_ByteString csType = m_pDict->GetString("S");
if (csType == FX_BSTRC("Rendition")) {
return m_pDict->GetInteger("OP");
- } else if (csType == FX_BSTRC("Movie")) {
+ }
+ if (csType == FX_BSTRC("Movie")) {
CFX_ByteString csOP = m_pDict->GetString("Operation");
if (csOP == FX_BSTRC("Play")) {
return 0;
- } else if (csOP == FX_BSTRC("Stop")) {
+ }
+ if (csOP == FX_BSTRC("Stop")) {
return 1;
- } else if (csOP == FX_BSTRC("Pause")) {
+ }
+ if (csOP == FX_BSTRC("Pause")) {
return 2;
- } else if (csOP == FX_BSTRC("Resume")) {
+ }
+ if (csOP == FX_BSTRC("Resume")) {
return 3;
}
}