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..c2082737dd8d5694582addd325849d891b99b741 100644 |
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp |
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp |
@@ -21,21 +21,21 @@ |
CJS_EventHandler::CJS_EventHandler(CJS_Context * pContext) : |
m_pJSContext(pContext), |
m_eEventType(JET_UNKNOWN), |
- m_bValid(FALSE), |
+ m_bValid(false), |
m_pWideStrChange(NULL), |
m_nCommitKey(-1), |
- m_bKeyDown(FALSE), |
- m_bModifier(FALSE), |
- m_bShift(FALSE), |
+ m_bKeyDown(false), |
+ m_bModifier(false), |
+ m_bShift(false), |
m_pISelEnd(NULL), |
m_nSelEndDu(0), |
m_pISelStart(NULL), |
m_nSelStartDu(0), |
- m_bWillCommit(FALSE), |
+ m_bWillCommit(false), |
m_pValue(NULL), |
- m_bFieldFull(FALSE), |
+ m_bFieldFull(false), |
m_pbRc(NULL), |
- m_bRcDu(FALSE), |
+ m_bRcDu(false), |
m_pSourceDoc(NULL), |
m_pTargetBookMark(NULL), |
m_pTargetDoc(NULL), |
@@ -122,7 +122,7 @@ void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc) |
m_pTargetDoc = pDoc; |
} |
-void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) |
+void CJS_EventHandler::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField* pTarget) |
{ |
Initial(JET_FIELD_MOUSEENTER); |
@@ -133,7 +133,7 @@ void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPD |
m_strTargetName = pTarget->GetFullName(); |
} |
-void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) |
+void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget) |
{ |
Initial(JET_FIELD_MOUSEEXIT); |
@@ -143,7 +143,7 @@ void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF |
m_strTargetName = pTarget->GetFullName(); |
} |
-void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) |
+void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget) |
{ |
Initial(JET_FIELD_MOUSEDOWN); |
m_eEventType = JET_FIELD_MOUSEDOWN; |
@@ -154,7 +154,7 @@ void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF |
m_strTargetName = pTarget->GetFullName(); |
} |
-void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) |
+void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField* pTarget) |
{ |
Initial(JET_FIELD_MOUSEUP); |
@@ -164,7 +164,7 @@ void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_F |
m_strTargetName = pTarget->GetFullName(); |
} |
-void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, |
+void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, |
const CFX_WideString& Value) |
{ |
Initial(JET_FIELD_FOCUS); |
@@ -176,7 +176,7 @@ void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_For |
m_pValue = (CFX_WideString*)&Value; |
} |
-void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, |
+void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, |
const CFX_WideString& Value) |
{ |
Initial(JET_FIELD_BLUR); |
@@ -189,11 +189,11 @@ void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_Form |
} |
void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange, |
- const CFX_WideString& strChangeEx, FX_BOOL KeyDown, |
- 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) |
+ const CFX_WideString& strChangeEx, bool KeyDown, |
+ bool bModifier, int& nSelEnd, int& nSelStart, |
+ bool bShift, CPDF_FormField* pTarget, |
+ CFX_WideString& Value, bool bWillCommit, |
+ bool bFieldFull, bool& bRc) |
{ |
Initial(JET_FIELD_KEYSTROKE); |
@@ -214,8 +214,8 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange, |
} |
void CJS_EventHandler::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) |
{ |
Initial(JET_FIELD_VALIDATE); |
@@ -231,7 +231,7 @@ void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_Wid |
} |
void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, |
- CFX_WideString& Value, FX_BOOL& bRc) |
+ CFX_WideString& Value, bool& bRc) |
{ |
Initial(JET_FIELD_CALCULATE); |
@@ -245,7 +245,7 @@ void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField |
void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget, |
CFX_WideString& Value, |
- FX_BOOL bWillCommit) |
+ bool bWillCommit) |
{ |
Initial(JET_FIELD_FORMAT); |
@@ -256,7 +256,7 @@ void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget, |
m_bWillCommit = bWillCommit; |
} |
-void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_FOCUS); |
@@ -265,7 +265,7 @@ void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_BLUR); |
@@ -274,7 +274,7 @@ void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_ |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_OPEN); |
@@ -283,7 +283,7 @@ void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_ |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_CLOSE); |
@@ -292,7 +292,7 @@ void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_MOUSEDOWN); |
@@ -301,7 +301,7 @@ void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPD |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_MOUSEUP); |
@@ -310,7 +310,7 @@ void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFS |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_MOUSEENTER); |
@@ -319,7 +319,7 @@ void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CP |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_MOUSEEXIT); |
@@ -328,7 +328,7 @@ void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPD |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_INVIEW); |
@@ -337,7 +337,7 @@ void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSD |
m_pTargetAnnot = pScreen; |
} |
-void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) |
+void CJS_EventHandler::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) |
{ |
Initial(JET_SCREEN_OUTVIEW); |
@@ -396,33 +396,33 @@ void CJS_EventHandler::Initial(JS_EVENT_T type) |
m_WideStrChangeDu = L""; |
m_WideStrChangeEx = L""; |
m_nCommitKey = -1; |
- m_bKeyDown = FALSE; |
- m_bModifier = FALSE; |
- m_bShift = FALSE; |
+ m_bKeyDown = false; |
+ m_bModifier = false; |
+ m_bShift = false; |
m_pISelEnd = NULL; |
m_nSelEndDu = 0; |
m_pISelStart = NULL; |
m_nSelStartDu = 0; |
- m_bWillCommit = FALSE; |
+ m_bWillCommit = false; |
m_pValue = NULL; |
- m_bFieldFull = FALSE; |
+ m_bFieldFull = false; |
m_pbRc = NULL; |
- m_bRcDu = FALSE; |
+ m_bRcDu = false; |
m_pSourceDoc = NULL; |
m_pTargetBookMark = NULL; |
m_pTargetDoc = NULL; |
m_pTargetAnnot = NULL; |
- m_bValid = TRUE; |
+ m_bValid = true; |
} |
void CJS_EventHandler::Destroy() |
{ |
- m_bValid = FALSE; |
+ m_bValid = false; |
} |
-FX_BOOL CJS_EventHandler::IsValid() |
+bool CJS_EventHandler::IsValid() |
{ |
return m_bValid; |
} |
@@ -447,17 +447,17 @@ int CJS_EventHandler::CommitKey() |
return m_nCommitKey; |
} |
-FX_BOOL CJS_EventHandler::FieldFull() |
+bool CJS_EventHandler::FieldFull() |
{ |
return m_bFieldFull; |
} |
-FX_BOOL CJS_EventHandler::KeyDown() |
+bool CJS_EventHandler::KeyDown() |
{ |
return m_bKeyDown; |
} |
-FX_BOOL CJS_EventHandler::Modifier() |
+bool CJS_EventHandler::Modifier() |
{ |
return m_bModifier; |
} |
@@ -558,7 +558,7 @@ const FX_WCHAR* CJS_EventHandler::Type() |
return L""; |
} |
-FX_BOOL& CJS_EventHandler::Rc() |
+bool& CJS_EventHandler::Rc() |
{ |
if (m_pbRc != NULL) |
return *m_pbRc; |
@@ -590,7 +590,7 @@ int & CJS_EventHandler::SelStart() |
} |
} |
-FX_BOOL CJS_EventHandler::Shift() |
+bool CJS_EventHandler::Shift() |
{ |
return m_bShift; |
} |
@@ -602,9 +602,9 @@ Field* CJS_EventHandler::Source() |
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime(); |
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document")); |
- ASSERT(pDocObj.IsEmpty() == FALSE); |
+ ASSERT(pDocObj.IsEmpty() == false); |
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field")); |
- ASSERT(pFieldObj.IsEmpty() == FALSE); |
+ ASSERT(pFieldObj.IsEmpty() == false); |
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj); |
ASSERT(pJSDocument != NULL); |
@@ -636,9 +636,9 @@ Field* CJS_EventHandler::Target_Field() |
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime(); |
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document")); |
- ASSERT(pDocObj.IsEmpty() == FALSE); |
+ ASSERT(pDocObj.IsEmpty() == false); |
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field")); |
- ASSERT(pFieldObj.IsEmpty() == FALSE); |
+ ASSERT(pFieldObj.IsEmpty() == false); |
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj); |
ASSERT(pJSDocument != NULL); |
@@ -664,7 +664,7 @@ CFX_WideString& CJS_EventHandler::Value() |
return *m_pValue; |
} |
-FX_BOOL CJS_EventHandler::WillCommit() |
+bool CJS_EventHandler::WillCommit() |
{ |
return m_bWillCommit; |
} |