From 3c012fef2bb72c8ec1faa73e11ee35539b2559d6 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 22 Jul 2015 15:14:14 -0700 Subject: Re-land else-after-returns Revert "Revert "Fix else-after-returns throughout pdfium."" This reverts commit 4eb4d7f6c707cc2c23c806aa540d055c8832b55d. Fix one naming conflict. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1243953004 . --- core/src/fpdfdoc/doc_action.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'core/src/fpdfdoc/doc_action.cpp') 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; } } -- cgit v1.2.3