Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1713)

Unified Diff: core/src/fpdfdoc/doc_action.cpp

Issue 1243953004: Re-land else-after-returns (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdfdoc/doc_ap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_action.cpp
diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp
index da2e05af2e639d97319c8f468f6acaec38155760..851b2d67098de8d57c9478f89de29bbaf6c1f8b5 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;
}
}
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdfdoc/doc_ap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698