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

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

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. 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 | « fpdfsdk/src/javascript/Icon.cpp ('k') | fpdfsdk/src/javascript/JS_EventHandler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Context.cpp
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index 72be34d751354409e5b0d4a3d4c407776e7eecae..0edbf0d0e5a2814debc34d646cd6db5086bdc783 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -16,8 +16,8 @@
CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
m_pRuntime(pRuntime),
- m_bBusy(FALSE),
- m_bMsgBoxEnable(TRUE)
+ m_bBusy(false),
+ m_bMsgBoxEnable(true)
{
m_pEventHandler = new CJS_EventHandler(this);
}
@@ -41,15 +41,15 @@ CPDFDoc_Environment* CJS_Context::GetReaderApp()
return m_pRuntime->GetReaderApp();
}
-FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
+bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
{
if (m_bBusy)
{
info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
- return FALSE;
+ return false;
}
- m_bBusy = TRUE;
+ m_bBusy = true;
ASSERT(m_pRuntime != NULL);
ASSERT(m_pEventHandler != NULL);
@@ -58,7 +58,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri
if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType()))
{
info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
- return FALSE;
+ return false;
}
FXJSErr error ={NULL,NULL, 0};
@@ -95,12 +95,12 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri
m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());
m_pEventHandler->Destroy();
- m_bBusy = FALSE;
+ m_bBusy = false;
return nRet >= 0;
}
-FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
+bool CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
{
v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
@@ -110,7 +110,7 @@ FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& inf
return DoJob(0, script, info);
}
-FX_BOOL CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
+bool CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
{
v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
@@ -186,58 +186,58 @@ void CJS_Context::OnPage_OutView(CPDFSDK_Document* pTarget)
m_pEventHandler->OnPage_OutView(pTarget);
}
-void CJS_Context::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseDown(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseEnter(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseExit(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseUp(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Focus(bModifier, bShift, pTarget, Value);
}
-void CJS_Context::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Blur(bModifier, bShift, pTarget, Value);
}
-void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
+void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Calculate(pSource, pTarget, Value, bRc);
}
-void CJS_Context::OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit)
+void CJS_Context::OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit)
{
m_pEventHandler->OnField_Format(pTarget, Value, bWillCommit);
}
void CJS_Context::OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart,
- FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
- FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL& bRc)
+ bool bKeyDown, bool bModifier, int &nSelEnd,int &nSelStart,
+ bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
+ bool bWillCommit, bool bFieldFull, bool& bRc)
{
m_pEventHandler->OnField_Keystroke(
strChange, strChangeEx, bKeyDown, bModifier, nSelEnd, nSelStart,
@@ -245,68 +245,68 @@ void CJS_Context::OnField_Keystroke(CFX_WideString& strChange, const CFX_WideStr
}
void CJS_Context::OnField_Validate(CFX_WideString& strChange,const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL& bRc)
+ bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, bool& bRc)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Validate(strChange, strChangeEx, bKeyDown, bModifier, bShift, pTarget, Value, bRc);
}
-void CJS_Context::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Focus(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Blur(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Open(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Close(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseDown(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseUp(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseEnter(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseExit(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_InView(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_OutView(bModifier, bShift, pScreen);
« no previous file with comments | « fpdfsdk/src/javascript/Icon.cpp ('k') | fpdfsdk/src/javascript/JS_EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698