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

Unified Diff: fpdfsdk/src/javascript/JS_EventHandler.cpp

Issue 1243883003: Fix else-after-returns throughout pdfium. (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
Index: fpdfsdk/src/javascript/JS_EventHandler.cpp
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index 7d27c66f6b7744b761980a3267907726bd917b51..93201163a7850a271ecd36cf5a536fde2de59a13 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -7,7 +7,6 @@
#include "../../include/javascript/JavaScript.h"
#include "../../include/javascript/IJavaScript.h"
#include "../../include/javascript/JS_EventHandler.h"
-//#include "../../include/javascript/JS_ResMgr.h"
#include "../../include/javascript/JS_Context.h"
#include "../../include/javascript/JS_Runtime.h"
#include "../../include/javascript/JS_Define.h"
@@ -429,12 +428,10 @@ FX_BOOL CJS_EventHandler::IsValid()
CFX_WideString & CJS_EventHandler::Change()
{
- if (m_pWideStrChange != NULL)
+ if (m_pWideStrChange) {
return *m_pWideStrChange;
- else
- {
- return m_WideStrChangeDu;
- }
+ }
+ return m_WideStrChangeDu;
}
CFX_WideString CJS_EventHandler::ChangeEx()
@@ -560,34 +557,26 @@ const FX_WCHAR* CJS_EventHandler::Type()
FX_BOOL& CJS_EventHandler::Rc()
{
- if (m_pbRc != NULL)
+ if (m_pbRc) {
return *m_pbRc;
- else
- {
- return m_bRcDu;
- }
+ }
+ return m_bRcDu;
}
int & CJS_EventHandler::SelEnd()
{
- if (m_pISelEnd != NULL)
- {
+ if (m_pISelEnd) {
return *m_pISelEnd;
}
- else
- {
- return m_nSelEndDu;
- }
+ return m_nSelEndDu;
}
int & CJS_EventHandler::SelStart()
{
- if (m_pISelStart != NULL)
- return * m_pISelStart;
- else
- {
- return m_nSelStartDu;
- }
+ if (m_pISelStart) {
+ return *m_pISelStart;
+ }
+ return m_nSelStartDu;
}
FX_BOOL CJS_EventHandler::Shift()

Powered by Google App Engine
This is Rietveld 408576698