diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
commit | 320b2313d19869333ed453af546e61a9fc2b81c9 (patch) | |
tree | 25f2eb8a0991ac485ca6354f0d3caf7fd775e732 /fpdfsdk/src/javascript | |
parent | 065e9321b84fc0490f3da9099e8840c65e06868d (diff) | |
download | pdfium-320b2313d19869333ed453af546e61a9fc2b81c9.tar.xz |
FX_BOOL considered harmful, part 2.
Fully automatic change, execpt for cleanup in fx_system.h
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1254703002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 476 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/Field.cpp | 880 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/Icon.cpp | 6 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_Context.cpp | 64 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_EventHandler.cpp | 102 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_GlobalData.cpp | 24 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_Runtime.cpp | 68 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_Value.cpp | 34 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/PublicMethods.cpp | 376 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/app.cpp | 178 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/color.cpp | 24 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/console.cpp | 18 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/event.cpp | 140 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/global.cpp | 68 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/report.cpp | 8 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/util.cpp | 46 |
16 files changed, 1256 insertions, 1256 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index fc453b0fc8..916af6ef9d 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -45,14 +45,14 @@ IMPLEMENT_JS_CLASS(CJS_PrintParamsObj, PrintParamsObj) PrintParamsObj::PrintParamsObj(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) { - bUI = TRUE; + bUI = true; nStart = 0; nEnd = 0; - bSilent = FALSE; - bShrinkToFit = FALSE; - bPrintAsImage = FALSE; - bReverse = FALSE; - bAnnotations = TRUE; + bSilent = false; + bShrinkToFit = false; + bPrintAsImage = false; + bReverse = false; + bAnnotations = true; } /* ---------------------- Document ---------------------- */ @@ -142,7 +142,7 @@ END_JS_STATIC_METHOD() IMPLEMENT_JS_CLASS(CJS_Document, Document) -FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc) +bool CJS_Document::InitInstance(IFXJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -152,7 +152,7 @@ FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc) pDoc->AttachDoc(pContext->GetReaderDocument()); pDoc->SetIsolate(pContext->GetJSRuntime()->GetIsolate()); - return TRUE; + return true; }; /* --------------------------------- Document --------------------------------- */ @@ -162,7 +162,7 @@ Document::Document(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject), m_pIconTree(NULL), m_pDocument(NULL), m_cwBaseURL(L""), - m_bDelay(FALSE) + m_bDelay(false) { } @@ -190,20 +190,20 @@ Document::~Document() } //the total number of fileds in document. -FX_BOOL Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CJS_Context* pContext = static_cast<CJS_Context*>(cc); sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); - return FALSE; + return false; } CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm(); CPDF_InterForm *pPDFForm = pInterForm->GetInterForm(); vp << (int)pPDFForm->CountFields(); - return TRUE; + return true; } -FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -226,10 +226,10 @@ FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE m_pDocument->ClearChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -241,10 +241,10 @@ FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr { } - return TRUE; + return true; } -FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -276,55 +276,55 @@ FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& } } - return TRUE; + return true; } -FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj) +bool Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj) { // Not supported. - return TRUE; + return true; } -FX_BOOL Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. - return TRUE; + return true; } -FX_BOOL Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. - return TRUE; + return true; } -FX_BOOL Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } //Maps a field object in PDF document to a JavaScript variable //comment: //note: the paremter cName, this is clue how to treat if the cName is not a valiable filed name in this document -FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() < 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_WideString wideName = params[0].ToCFXWideString(); @@ -334,7 +334,7 @@ FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_ if (pPDFForm->CountFields(wideName) <= 0) { vRet.SetNull(); - return TRUE; + return true; } CJS_Runtime* pRuntime = pContext->GetJSRuntime(); @@ -346,66 +346,66 @@ FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_ pField->AttachField(this, wideName); vRet = pJSField; - return TRUE; + return true; } //Gets the name of the nth field in the document -FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } int nIndex = params[0].ToInt(); if (nIndex < 0) { sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR); - return FALSE; + return false; } CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); CPDF_InterForm* pPDFForm = pInterForm->GetInterForm(); CPDF_FormField* pField = pPDFForm->GetField(nIndex); if (!pField) - return FALSE; + return false; vRet = pField->GetFullName().c_str(); - return TRUE; + return true; } -FX_BOOL Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } //exports the form data and mails the resulting fdf file as an attachment to all recipients. //comment: need reader supports //note: -//int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,string cSubject,string cms); +//int CPDFSDK_Document::mailForm(bool bUI,String cto,string ccc,string cbcc,string cSubject,string cms); -FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; + if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false; int iLength = params.size(); - FX_BOOL bUI = iLength > 0 ? params[0].ToBool() : TRUE; + bool bUI = iLength > 0 ? params[0].ToBool() : true; CFX_WideString cTo = iLength > 1 ? params[1].ToCFXWideString() : L""; CFX_WideString cCc = iLength > 2 ? params[2].ToCFXWideString() : L""; CFX_WideString cBcc = iLength > 3 ? params[3].ToCFXWideString() : L""; @@ -417,7 +417,7 @@ FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_ CFX_ByteTextBuf textBuf; if (!pInterForm->ExportFormToFDFTextBuf(textBuf)) - return FALSE; + return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -429,24 +429,24 @@ FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_ pRuntime->BeginBlock(); pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str()); pRuntime->EndBlock(); - return TRUE; + return true; } -FX_BOOL Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_Runtime* pRuntime = pContext->GetJSRuntime(); ASSERT(pRuntime != NULL); - FX_BOOL bUI = TRUE; + bool bUI = true; int nStart = 0; int nEnd = 0; - FX_BOOL bSilent = FALSE; - FX_BOOL bShrinkToFit = FALSE; - FX_BOOL bPrintAsImage = FALSE; - FX_BOOL bReverse = FALSE; - FX_BOOL bAnnotations = FALSE; + bool bSilent = false; + bool bShrinkToFit = false; + bool bPrintAsImage = false; + bool bReverse = false; + bool bAnnotations = false; int nlength = params.size(); if(nlength ==9) @@ -500,26 +500,26 @@ FX_BOOL Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val if (CPDFDoc_Environment* pEnv = m_pDocument->GetEnv()) { pEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations); - return TRUE; + return true; } - return FALSE; + return false; } //removes the specified field from the document. //comment: //note: if the filed name is not retional, adobe is dumb for it. -FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || - m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE; + m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return false; CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_WideString sFieldName = params[0].ToCFXWideString(); @@ -558,20 +558,20 @@ FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, C m_pDocument->SetChangeMark(); } - return TRUE; + return true; } //reset filed values within a document. //comment: //note: if the fields names r not rational, aodbe is dumb for it. -FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || - m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE; + m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return false; CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); ASSERT(pInterForm != NULL); @@ -610,42 +610,42 @@ FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS if (aFields.GetSize() > 0) { - pPDFForm->ResetForm(aFields, TRUE, TRUE); + pPDFForm->ResetForm(aFields, true, true); m_pDocument->SetChangeMark(); } } else { - pPDFForm->ResetForm(TRUE); + pPDFForm->ResetForm(true); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CJS_Context* pContext = (CJS_Context*)cc; int nSize = params.size(); if (nSize < 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_WideString strURL; - FX_BOOL bFDF = TRUE; - FX_BOOL bEmpty = FALSE; + bool bFDF = true; + bool bEmpty = false; v8::Isolate* isolate = GetIsolate(cc); CJS_Array aFields(isolate); @@ -677,16 +677,16 @@ FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJ CJS_Runtime* pRuntime = pContext->GetJSRuntime(); CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); - FX_BOOL bAll = (aFields.GetLength() == 0); + bool bAll = (aFields.GetLength() == 0); if (bAll && bEmpty) { if (pPDFInterForm->CheckRequiredFields()) { pRuntime->BeginBlock(); - pInterForm->SubmitForm(strURL, FALSE); + pInterForm->SubmitForm(strURL, false); pRuntime->EndBlock(); } - return TRUE; + return true; } CFX_PtrArray fieldObjects; @@ -707,13 +707,13 @@ FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJ } } - if (pPDFInterForm->CheckRequiredFields(&fieldObjects, TRUE)) + if (pPDFInterForm->CheckRequiredFields(&fieldObjects, true)) { pRuntime->BeginBlock(); - pInterForm->SubmitFields(strURL, fieldObjects, TRUE, !bFDF); + pInterForm->SubmitFields(strURL, fieldObjects, true, !bFDF); pRuntime->EndBlock(); } - return TRUE; + return true; } ////////////////////////////////////////////////////////////////////////////////////////////// @@ -728,26 +728,26 @@ CPDFSDK_Document * Document::GetReaderDoc() return m_pDocument; } -FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName) +bool Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName) { - return FALSE; + return false; } -FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName) +bool Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName) { - return FALSE; + return false; } -FX_BOOL Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - FX_BOOL bUI = TRUE; + bool bUI = true; CFX_WideString cTo = L""; CFX_WideString cCc = L""; CFX_WideString cBcc = L""; @@ -803,40 +803,40 @@ FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V pEnv->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str()); pRuntime->EndBlock(); - return TRUE; + return true; } -FX_BOOL Document::author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); - if (!pDictionary)return FALSE; + if (!pDictionary)return false; if (vp.IsGetting()) { vp << pDictionary->GetUnicodeText("Author"); - return TRUE; + return true; } else { - if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; + if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return false; CFX_WideString csAuthor; vp >> csAuthor; pDictionary->SetAtString("Author", PDF_EncodeText(csAuthor)); m_pDocument->SetChangeMark(); - return TRUE; + return true; } } -FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; CFX_WideString cwAuthor = pDictionary->GetUnicodeText("Author"); CFX_WideString cwTitle = pDictionary->GetUnicodeText("Title"); @@ -880,14 +880,14 @@ FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr } vp << pObj; } - return TRUE; + return true; } -FX_BOOL Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; if (vp.IsGetting()) { @@ -896,21 +896,21 @@ FX_BOOL Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; CFX_WideString csCreationDate; vp >> csCreationDate; pDictionary->SetAtString("CreationDate", PDF_EncodeText(csCreationDate)); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; if (vp.IsGetting()) { @@ -919,17 +919,17 @@ FX_BOOL Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; CFX_WideString csCreator; vp >> csCreator; pDictionary->SetAtString("Creator", PDF_EncodeText(csCreator)); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -938,7 +938,7 @@ FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; bool b; vp >> b; @@ -971,14 +971,14 @@ FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE } } } - return TRUE; + return true; } -FX_BOOL Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; if (vp.IsGetting()) { @@ -987,21 +987,21 @@ FX_BOOL Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; CFX_WideString csKeywords; vp >> csKeywords; pDictionary->SetAtString("Keywords", PDF_EncodeText(csKeywords)); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; if (vp.IsGetting()) { @@ -1010,21 +1010,21 @@ FX_BOOL Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; CFX_WideString csmodDate; vp >> csmodDate; pDictionary->SetAtString("ModDate", PDF_EncodeText(csmodDate)); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; if (vp.IsGetting()) { @@ -1033,21 +1033,21 @@ FX_BOOL Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; CFX_WideString csproducer; vp >> csproducer; pDictionary->SetAtString("Producer", PDF_EncodeText(csproducer)); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; if (vp.IsGetting()) { @@ -1056,24 +1056,24 @@ FX_BOOL Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; CFX_WideString cssubject; vp >> cssubject; pDictionary->SetAtString("Subject", PDF_EncodeText(cssubject)); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL) - return FALSE; + return false; CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); if (!pDictionary) - return FALSE; + return false; if (vp.IsGetting()) { @@ -1082,58 +1082,58 @@ FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) - return FALSE; + return false; CFX_WideString cstitle; vp >> cstitle; pDictionary->SetAtString("Title", PDF_EncodeText(cstitle)); m_pDocument->SetChangeMark(); } - return TRUE; + return true; } -FX_BOOL Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CJS_Context* pContext = static_cast<CJS_Context*>(cc); sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); - return FALSE; + return false; } vp << m_pDocument->GetPageCount(); - return TRUE; + return true; } -FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { //In Chrome case,should always return true. if (vp.IsGetting()) { - vp << TRUE; + vp << true; } - return TRUE; + return true; } -FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CJS_Context* pContext = static_cast<CJS_Context*>(cc); sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); - return FALSE; + return false; } vp << 0; - return TRUE; + return true; } -FX_BOOL Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -1143,10 +1143,10 @@ FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& { vp >> m_cwBaseURL; } - return TRUE; + return true; } -FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1168,15 +1168,15 @@ FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString pInterForm->EnableCalculate(bCalculate); } - return TRUE; + return true; } -FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CJS_Context* pContext = static_cast<CJS_Context*>(cc); sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); - return FALSE; + return false; } CFX_WideString wsFilePath = m_pDocument->GetPath(); int32_t i = wsFilePath.GetLength() - 1; @@ -1191,7 +1191,7 @@ FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid }else{ vp << L""; } - return TRUE; + return true; } CFX_WideString Document::ReversalStr(CFX_WideString cbFrom) @@ -1241,74 +1241,74 @@ CFX_WideString Document::CutString(CFX_WideString cbFrom) return cbRet; } -FX_BOOL Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CJS_Context* pContext = static_cast<CJS_Context*>(cc); sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); - return FALSE; + return false; } vp << app::SysPathToPDFPath(m_pDocument->GetPath()); - return TRUE; + return true; } -FX_BOOL Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - return TRUE; + return true; } -FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { vRet.SetNull(); - return TRUE; + return true; } -FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { vRet.SetNull(); - return TRUE; + return true; } -FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { vRet = VT_undefined; - return TRUE; + return true; } -FX_BOOL Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect) @@ -1372,12 +1372,12 @@ IconElement* IconTree::operator [](int iIndex) return NULL; } -FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 2) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_WideString swIconName = params[0].ToCFXWideString(); @@ -1386,13 +1386,13 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V CJS_Runtime* pRuntime = pContext->GetJSRuntime(); if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) { sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR); - return FALSE; + return false; } CJS_EmbedObj* pEmbedObj = params[1].ToCJSObject()->GetEmbedObject(); if (!pEmbedObj) { sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR); - return FALSE; + return false; } Icon* pIcon = (Icon*)pEmbedObj; @@ -1404,21 +1404,21 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V pNewIcon->NextIcon = NULL; pNewIcon->IconStream = pIcon; m_pIconTree->InsertIconElement(pNewIcon); - return TRUE; + return true; } -FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CJS_Context* pContext = static_cast<CJS_Context*>(cc); sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); - return FALSE; + return false; } if (!m_pIconTree) { vp.SetNull(); - return TRUE; + return true; } CJS_Array Icons(m_isolate); @@ -1433,13 +1433,13 @@ FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE pIconElement = (*m_pIconTree)[i]; JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon")); - if (pObj.IsEmpty()) return FALSE; + if (pObj.IsEmpty()) return false; CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj); - if (!pJS_Icon) return FALSE; + if (!pJS_Icon) return false; Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); - if (!pIcon)return FALSE; + if (!pIcon)return false; pIcon->SetStream(pIconElement->IconStream->GetStream()); pIcon->SetIconName(pIconElement->IconName); @@ -1447,19 +1447,19 @@ FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE } vp << Icons; - return TRUE; + return true; } -FX_BOOL Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if(!m_pIconTree) - return FALSE; + return false; CFX_WideString swIconName = params[0].ToCFXWideString(); int iIconCounts = m_pIconTree->GetLength(); @@ -1472,82 +1472,82 @@ FX_BOOL Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V Icon* pRetIcon = (*m_pIconTree)[i]->IconStream; JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon")); - if (pObj.IsEmpty()) return FALSE; + if (pObj.IsEmpty()) return false; CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj); - if (!pJS_Icon) return FALSE; + if (!pJS_Icon) return false; Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); - if (!pIcon)return FALSE; + if (!pIcon)return false; pIcon->SetIconName(swIconName); pIcon->SetStream(pRetIcon->GetStream()); vRet = pJS_Icon; - return TRUE; + return true; } } - return FALSE; + return false; } -FX_BOOL Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, no supported. - return TRUE; + return true; } -FX_BOOL Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not implemented. - return TRUE; + return true; } -FX_BOOL Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || - m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE; + m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return false; CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); ASSERT(pInterForm != NULL); pInterForm->OnCalculate(); - return TRUE; + return true; } -FX_BOOL Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; + if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false; int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0; int nWordNo = params.GetSize() > 1 ? params[1].ToInt() : 0; bool bStrip = params.GetSize() > 2 ? params[2].ToBool() : true; CPDF_Document* pDocument = m_pDocument->GetDocument(); - if (!pDocument) return FALSE; + if (!pDocument) return false; CJS_Context* pContext = static_cast<CJS_Context*>(cc); if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount()) { sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR); - return FALSE; + return false; } CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo); - if (!pPageDict) return FALSE; + if (!pPageDict) return false; CPDF_Page page; page.Load(pDocument, pPageDict); @@ -1586,23 +1586,23 @@ FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params } vRet = swRet.c_str(); - return TRUE; + return true; } -FX_BOOL Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; + if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false; - return FALSE; + return false; } -FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; + if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false; int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0; @@ -1613,11 +1613,11 @@ FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& param if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount()) { sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR); - return FALSE; + return false; } CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo); - if (!pPageDict) return FALSE; + if (!pPageDict) return false; CPDF_Page page; page.Load(pDocument, pPageDict); @@ -1642,10 +1642,10 @@ FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& param vRet = nWords; - return TRUE; + return true; } -FX_BOOL Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; CJS_Runtime* pRuntime = pContext->GetJSRuntime(); @@ -1654,7 +1654,7 @@ FX_BOOL Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params // Not implemented yet. vRet = pRetObj; - return TRUE; + return true; } #define ISLATINWORD(u) (u != 0x20 && u <= 0x28FF) @@ -1668,7 +1668,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj) CPDF_Font* pFont = pTextObj->GetFont(); if (!pFont) return 0; - FX_BOOL bIsLatin = FALSE; + bool bIsLatin = false; for (int i=0, sz=pTextObj->CountChars(); i<sz; i++) { @@ -1703,7 +1703,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex if (!pFont) return L""; int nWords = 0; - FX_BOOL bIsLatin = FALSE; + bool bIsLatin = false; for (int i=0, sz=pTextObj->CountChars(); i<sz; i++) { @@ -1734,10 +1734,10 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex return swRet; } -FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } /** @@ -1750,39 +1750,39 @@ FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr (refW, ReflowWidth) */ -FX_BOOL Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, no supported. - return TRUE; + return true; } -FX_BOOL Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } void Document::AddDelayData(CJS_DelayData* pData) diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 614843426e..ca16c90c01 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -110,7 +110,7 @@ END_JS_STATIC_METHOD() IMPLEMENT_JS_CLASS(CJS_Field, Field) -FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc) +bool CJS_Field::InitInstance(IFXJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -120,15 +120,15 @@ FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc) pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate()); - return TRUE; + return true; }; Field::Field(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject), m_pJSDoc(NULL), m_pDocument(NULL), m_nFormControlIndex(-1), - m_bCanSet(FALSE), - m_bDelay(FALSE), + m_bCanSet(false), + m_bDelay(false), m_isolate(NULL) { } @@ -168,7 +168,7 @@ void Field::ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring & strFieldName = strFieldNameParsed.substr(0,iStart); } -FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName) +bool Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName) { ASSERT(pDocument != NULL); m_pJSDoc = pDocument; @@ -194,17 +194,17 @@ FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldNam std::wstring strFieldName; int iControlNo = -1; ParseFieldName(swFieldNameTemp.c_str(), strFieldName, iControlNo); - if (iControlNo == -1) return FALSE; + if (iControlNo == -1) return false; m_FieldName = strFieldName.c_str(); m_nFormControlIndex = iControlNo; - return TRUE; + return true; } m_FieldName = swFieldNameTemp; m_nFormControlIndex = -1; - return TRUE; + return true; } void Field::GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldArray) @@ -234,7 +234,7 @@ void Field::GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& Field } void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, - FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh) + bool bChangeMark, bool bResetAP, bool bRefresh) { ASSERT(pDocument != NULL); ASSERT(pFormField != NULL); @@ -255,12 +255,12 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i); ASSERT(pWidget != NULL); - FX_BOOL bFormated = FALSE; + bool bFormated = false; CFX_WideString sValue = pWidget->OnFormat(bFormated); if (bFormated) - pWidget->ResetAppearance(sValue.c_str(), FALSE); + pWidget->ResetAppearance(sValue.c_str(), false); else - pWidget->ResetAppearance(NULL, FALSE); + pWidget->ResetAppearance(NULL, false); } } else @@ -270,7 +270,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i); ASSERT(pWidget != NULL); - pWidget->ResetAppearance(NULL, FALSE); + pWidget->ResetAppearance(NULL, false); } } } @@ -295,7 +295,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi } void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl, - FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh) + bool bChangeMark, bool bResetAP, bool bRefresh) { ASSERT(pDocument != NULL); ASSERT(pFormControl != NULL); @@ -312,16 +312,16 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFo int nFieldType = pWidget->GetFieldType(); if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD) { - FX_BOOL bFormated = FALSE; + bool bFormated = false; CFX_WideString sValue = pWidget->OnFormat(bFormated); if (bFormated) - pWidget->ResetAppearance(sValue.c_str(), FALSE); + pWidget->ResetAppearance(sValue.c_str(), false); else - pWidget->ResetAppearance(NULL, FALSE); + pWidget->ResetAppearance(NULL, false); } else { - pWidget->ResetAppearance(NULL, FALSE); + pWidget->ResetAppearance(NULL, false); } } @@ -350,17 +350,17 @@ CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* return pInterForm->GetWidget(pFormControl); } -FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel) +bool Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel) { ASSERT(pFormField != NULL); for (int i=0,sz = pFormField->CountOptions(); i < sz; i++) { if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0) - return TRUE; + return true; } - return FALSE; + return false; } CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField) @@ -376,13 +376,13 @@ CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField) /* ---------------------------------------- property ---------------------------------------- */ -FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_ByteString alignStr; vp >> alignStr; @@ -400,16 +400,16 @@ FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; switch (pFormControl->GetControlAlignment()) { @@ -427,7 +427,7 @@ FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s } } - return TRUE; + return true; } void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, @@ -436,13 +436,13 @@ void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_ByteString strType = ""; vp >> strType; @@ -460,13 +460,13 @@ FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); - if (!pFormField) return FALSE; + if (!pFormField) return false; CPDFSDK_Widget* pWidget = GetWidget(m_pDocument, GetSmartFieldControl(pFormField)); - if (!pWidget) return FALSE; + if (!pWidget) return false; int nBorderstyle = pWidget->GetBorderStyle(); @@ -493,7 +493,7 @@ FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& } } - return TRUE; + return true; } void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, @@ -525,7 +525,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw if (nControlIndex < 0) { - FX_BOOL bSet = FALSE; + bool bSet = false; for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++) { if (CPDFSDK_Widget* pWidget = GetWidget(pDocument, pFormField->GetControl(j))) @@ -533,11 +533,11 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw if (pWidget->GetBorderStyle() != nBorderStyle) { pWidget->SetBorderStyle(nBorderStyle); - bSet = TRUE; + bSet = true; } } } - if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE); + if (bSet) UpdateFormField(pDocument, pFormField, true, true, true); } else { @@ -549,7 +549,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw if (pWidget->GetBorderStyle() != nBorderStyle) { pWidget->SetBorderStyle(nBorderStyle); - UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE); + UpdateFormControl(pDocument, pFormControl, true, true, true); } } } @@ -557,13 +557,13 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw } } -FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -581,16 +581,16 @@ FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; CPDF_IconFit IconFit = pFormControl->GetIconFit(); @@ -600,7 +600,7 @@ FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString vp << (int32_t)fLeft; } - return TRUE; + return true; } void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -608,13 +608,13 @@ void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -632,16 +632,16 @@ FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; CPDF_IconFit IconFit = pFormControl->GetIconFit(); @@ -651,7 +651,7 @@ FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString vp << (int32_t)fBottom; } - return TRUE; + return true; } void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -659,13 +659,13 @@ void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -683,22 +683,22 @@ FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; CPDF_IconFit IconFit = pFormControl->GetIconFit(); vp << IconFit.GetFittingBounds(); } - return TRUE; + return true; } void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -706,13 +706,13 @@ void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString //Not supported. } -FX_BOOL Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -730,20 +730,20 @@ FX_BOOL Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; vp << pFormControl->GetTextPosition(); } - return TRUE; + return true; } void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -751,13 +751,13 @@ void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& //Not supported. } -FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -775,16 +775,16 @@ FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; CPDF_IconFit IconFit = pFormControl->GetIconFit(); if (IconFit.IsProportionalScale()) @@ -793,7 +793,7 @@ FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri vp << (int32_t)1; } - return TRUE; + return true; } void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -801,13 +801,13 @@ void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& //Not supported. } -FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -825,16 +825,16 @@ FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*) FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl) return FALSE; + if (!pFormControl) return false; CPDF_IconFit IconFit = pFormControl->GetIconFit(); int ScaleM = IconFit.GetScaleMethod(); @@ -855,7 +855,7 @@ FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr } } - return TRUE; + return true; } void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -863,13 +863,13 @@ void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString //Not supported. } -FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -887,13 +887,13 @@ FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm(); ASSERT(pRDInterForm != NULL); @@ -904,7 +904,7 @@ FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri vp << (int32_t)pInterForm->FindFieldInCalculationOrder(pFormField); } - return TRUE; + return true; } void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -912,13 +912,13 @@ void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& //Not supported. } -FX_BOOL Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -936,17 +936,17 @@ FX_BOOL Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; vp << (int32_t)pFormField->GetMaxLen(); } - return TRUE; + return true; } void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -954,13 +954,13 @@ void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -978,13 +978,13 @@ FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_COMB) vp << true; @@ -992,7 +992,7 @@ FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError vp << false; } - return TRUE; + return true; } void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -1000,13 +1000,13 @@ void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa //Not supported. } -FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -1024,13 +1024,13 @@ FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_COMMITONSELCHANGE) vp << true; @@ -1038,7 +1038,7 @@ FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS vp << false; } - return TRUE; + return true; } void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -1046,13 +1046,13 @@ void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideStri //Not supported. } -FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_DWordArray array; @@ -1089,13 +1089,13 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX) - return FALSE; + return false; if (pFormField->CountSelectedItems() == 1) vp << pFormField->GetSelectedIndex(0); @@ -1112,7 +1112,7 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid vp << -1; } - return TRUE; + return true; } void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, @@ -1132,7 +1132,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX) { FX_DWORD dwFieldFlags = pFormField->GetFieldFlags(); - pFormField->ClearSelection(TRUE); + pFormField->ClearSelection(true); for (int i=0,sz=array.GetSize(); i<sz; i++) { @@ -1143,22 +1143,22 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt int iSelecting = (int32_t)array.GetAt(i); if (iSelecting < pFormField->CountOptions() && !pFormField->IsItemSelected(iSelecting)) - pFormField->SetItemSelection(iSelecting, TRUE); + pFormField->SetItemSelection(iSelecting, true); } - UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE); + UpdateFormField(pDocument, pFormField, true, true, true); } } } -FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { // MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT); - return FALSE; + return false; if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; ; } @@ -1166,7 +1166,7 @@ FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString { ; } - return TRUE; + return true; } void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex) @@ -1174,13 +1174,13 @@ void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_WideString WideStr; vp >> WideStr; @@ -1198,18 +1198,18 @@ FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON || pFormField->GetFieldType() == FIELDTYPE_SIGNATURE) - return FALSE; + return false; vp << pFormField->GetDefaultValue(); } - return TRUE; + return true; } void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, @@ -1218,13 +1218,13 @@ void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -1242,13 +1242,13 @@ FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSCROLL) vp << true; @@ -1256,7 +1256,7 @@ FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& vp << false; } - return TRUE; + return true; } void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -1264,13 +1264,13 @@ void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& sw //Not supported. } -FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -1279,14 +1279,14 @@ FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD && pFormField->GetFieldType() != FIELDTYPE_COMBOBOX) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSPELLCHECK) vp << true; @@ -1294,10 +1294,10 @@ FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr vp << false; } - return TRUE; + return true; } -void Field::SetDelay(FX_BOOL bDelay) +void Field::SetDelay(bool bDelay) { m_bDelay = bDelay; @@ -1308,11 +1308,11 @@ void Field::SetDelay(FX_BOOL bDelay) } } -FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -1323,16 +1323,16 @@ FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro { vp << m_bDelay; } - return TRUE; + return true; } -FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -1350,7 +1350,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -1359,7 +1359,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr ASSERT(pInterForm != NULL); CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField)); - if (!pWidget)return FALSE; + if (!pWidget)return false; FX_DWORD dwFlag = pWidget->GetFlags(); @@ -1387,7 +1387,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr } } - return TRUE; + return true; } void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -1407,7 +1407,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel if (nControlIndex < 0) { - FX_BOOL bSet = FALSE; + bool bSet = false; for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++) { CPDF_FormControl* pFormControl = pFormField->GetControl(j); @@ -1445,12 +1445,12 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel if (dwFlag != pWidget->GetFlags()) { pWidget->SetFlags(dwFlag); - bSet = TRUE; + bSet = true; } } } - if (bSet) UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); + if (bSet) UpdateFormField(pDocument, pFormField, true, false, true); } else { @@ -1489,7 +1489,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel if (dwFlag != pWidget->GetFlags()) { pWidget->SetFlags(dwFlag); - UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE); + UpdateFormControl(pDocument, pFormControl, true, false, true); } } } @@ -1497,21 +1497,21 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel } } -FX_BOOL Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) { - return FALSE; + return false; } vp << m_pJSDoc->GetCJSDoc(); - return TRUE; + return true; } -FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -1520,13 +1520,13 @@ FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT) vp << true; @@ -1534,30 +1534,30 @@ FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE vp << false; } - return TRUE; + return true; } -FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); if (FieldArray.GetSize() <= 0) - return FALSE; + return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON) - return FALSE; + return false; if (vp.IsSetting()) { if (!m_bCanSet) - return FALSE; + return false; if (!vp.IsArrayObject()) - return FALSE; + return false; } else { @@ -1573,36 +1573,36 @@ FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString else { if (m_nFormControlIndex >= pFormField->CountControls()) - return FALSE; + return false; CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex); if (!pFormControl) - return FALSE; + return false; ExportValusArray.SetElement(0, CJS_Value(m_isolate,pFormControl->GetExportValue().c_str())); } vp << ExportValusArray; } - return TRUE; + return true; } -FX_BOOL Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); if (FieldArray.GetSize() <= 0) - return FALSE; + return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; if (vp.IsSetting()) { if (!m_bCanSet) - return FALSE; + return false; bool bVP; vp >> bVP; @@ -1614,10 +1614,10 @@ FX_BOOL Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& else vp << false; } - return TRUE; + return true; } -FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1626,15 +1626,15 @@ FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); if (FieldArray.GetSize() <= 0) - return FALSE; + return false; if (vp.IsSetting()) { if (!m_bCanSet) - return FALSE; + return false; if (!vp.IsArrayObject()) - return FALSE; + return false; vp >> crArray; @@ -1656,7 +1656,7 @@ FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); if (!pFormControl) - return FALSE; + return false; int iColorType; pFormControl->GetBackgroundColor(iColorType); @@ -1684,13 +1684,13 @@ FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s pFormControl->GetOriginalBackgroundColor(3)); } else - return FALSE; + return false; color::ConvertPWLColorToArray(color, crArray); vp << crArray; } - return TRUE; + return true; } void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color) @@ -1698,13 +1698,13 @@ void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -1722,7 +1722,7 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -1731,7 +1731,7 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr ASSERT(pInterForm != NULL); CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField)); - if (!pWidget) return FALSE; + if (!pWidget) return false; FX_DWORD dwFlags = pWidget->GetFlags(); @@ -1743,7 +1743,7 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr vp << false; } - return TRUE; + return true; } void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -1763,7 +1763,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField if (nControlIndex < 0) { - FX_BOOL bSet = FALSE; + bool bSet = false; for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++) { if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j))) @@ -1787,13 +1787,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField if (dwFlags != pWidget->GetFlags()) { pWidget->SetFlags(dwFlags); - bSet = TRUE; + bSet = true; } } } if (bSet) - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); + UpdateFormField(pDocument, pFormField, true, false, true); } else { @@ -1821,7 +1821,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField if (dwFlags != pWidget->GetFlags()) { pWidget->SetFlags(dwFlags); - UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE); + UpdateFormControl(pDocument, pFormControl, true, false, true); } } } @@ -1829,13 +1829,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField } } -FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_ByteString strMode; vp >> strMode; @@ -1853,16 +1853,16 @@ FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl) return FALSE; + if (!pFormControl) return false; int eHM = pFormControl->GetHighlightingMode(); switch (eHM) @@ -1885,7 +1885,7 @@ FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s } } - return TRUE; + return true; } void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string) @@ -1893,13 +1893,13 @@ void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int iWidth; vp >> iWidth; @@ -1917,26 +1917,26 @@ FX_BOOL Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl) return FALSE; + if (!pFormControl) return false; CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); ASSERT(pInterForm != NULL); - if(!pFormField->CountControls()) return FALSE; + if(!pFormField->CountControls()) return false; CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); - if (!pWidget) return FALSE; + if (!pWidget) return false; vp << (int32_t)pWidget->GetBorderWidth(); } - return TRUE; + return true; } void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -1956,7 +1956,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi if (nControlIndex < 0) { - FX_BOOL bSet = FALSE; + bool bSet = false; for (int j=0,jsz=pFormField->CountControls(); j<jsz; j++) { CPDF_FormControl* pFormControl = pFormField->GetControl(j); @@ -1967,11 +1967,11 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi if (number != pWidget->GetBorderWidth()) { pWidget->SetBorderWidth(number); - bSet = TRUE; + bSet = true; } } } - if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE); + if (bSet) UpdateFormField(pDocument, pFormField, true, true, true); } else { @@ -1983,7 +1983,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi if (number != pWidget->GetBorderWidth()) { pWidget->SetBorderWidth(number); - UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE); + UpdateFormControl(pDocument, pFormControl, true, true, true); } } } @@ -1991,13 +1991,13 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi } } -FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -2015,13 +2015,13 @@ FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_MULTILINE) vp << true; @@ -2029,7 +2029,7 @@ FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s vp << false; } - return TRUE; + return true; } void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -2037,13 +2037,13 @@ void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -2061,13 +2061,13 @@ FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_LISTBOX) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_MULTISELECT) vp << true; @@ -2075,7 +2075,7 @@ FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS vp << false; } - return TRUE; + return true; } void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -2083,49 +2083,49 @@ void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideStri //Not supported. } -FX_BOOL Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting()) return FALSE; + if (!vp.IsGetting()) return false; CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; vp << m_FieldName; - return TRUE; + return true; } -FX_BOOL Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX) - return FALSE; + return false; - if (!vp.IsGetting()) return FALSE; + if (!vp.IsGetting()) return false; vp << (int32_t)pFormField->CountOptions(); - return TRUE; + return true; } -FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting()) return FALSE; + if (!vp.IsGetting()) return false; CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); - if (!pFormField) return FALSE; + if (!pFormField) return false; ASSERT(m_pDocument != NULL); @@ -2146,7 +2146,7 @@ FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError CPDFSDK_PageView* pPageView = pWidget->GetPageView(); if(!pPageView) - return FALSE; + return false; PageArray.SetElement(i, CJS_Value(m_isolate,(int32_t)pPageView->GetPageIndex())); } @@ -2158,16 +2158,16 @@ FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError vp << (int32_t) -1; } - return TRUE; + return true; } -FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -2185,13 +2185,13 @@ FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_PASSWORD) vp << true; @@ -2199,7 +2199,7 @@ FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE vp << false; } - return TRUE; + return true; } void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -2207,7 +2207,7 @@ void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2216,11 +2216,11 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -2232,7 +2232,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro if (m_nFormControlIndex < 0) { - FX_BOOL bSet = FALSE; + bool bSet = false; for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++) { if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j))) @@ -2246,17 +2246,17 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro if (dwFlags != pWidget->GetFlags()) { pWidget->SetFlags(dwFlags); - bSet = TRUE; + bSet = true; } } } if (bSet) - UpdateFormField(m_pDocument, pFormField, TRUE, FALSE, TRUE); + UpdateFormField(m_pDocument, pFormField, true, false, true); } else { - if(m_nFormControlIndex >= pFormField->CountControls()) return FALSE; + if(m_nFormControlIndex >= pFormField->CountControls()) return false; if (CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex)) { if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) @@ -2270,7 +2270,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro if (dwFlags != pWidget->GetFlags()) { pWidget->SetFlags(dwFlags); - UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), TRUE, FALSE, TRUE); + UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), true, false, true); } } } @@ -2283,7 +2283,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro ASSERT(pFormField != NULL); CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField)); - if (!pWidget) return FALSE; + if (!pWidget) return false; if (pWidget->GetFlags() & ANNOTFLAG_PRINT) vp << true; @@ -2291,20 +2291,20 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro vp << false; } - return TRUE; + return true; } -FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -2316,7 +2316,7 @@ FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON) vp << true; @@ -2324,20 +2324,20 @@ FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri vp << false; } - return TRUE; + return true; } -FX_BOOL Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -2354,17 +2354,17 @@ FX_BOOL Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE vp << false; } - return TRUE; + return true; } -FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; - if (!vp.IsArrayObject())return FALSE; + if (!m_bCanSet) return false; + if (!vp.IsArrayObject())return false; CJS_Array rcArray(m_isolate); vp >> rcArray; @@ -2395,7 +2395,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -2404,7 +2404,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError ASSERT(pInterForm != NULL); CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField)); - if (!pWidget) return FALSE; + if (!pWidget) return false; CFX_FloatRect crRect = pWidget->GetRect(); CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Rightx(m_isolate),Lower_Righty(m_isolate); @@ -2422,7 +2422,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError vp << rcArray; } - return TRUE; + return true; } void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPDF_Rect& rect) @@ -2442,7 +2442,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa if (nControlIndex < 0) { - FX_BOOL bSet = FALSE; + bool bSet = false; for (int i=0, sz=pFormField->CountControls(); i<sz; i++) { CPDF_FormControl* pFormControl = pFormField->GetControl(i); @@ -2469,13 +2469,13 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa crRect.bottom != rcOld.bottom) { pWidget->SetRect(crRect); - bSet = TRUE; + bSet = true; } } } } - if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE); + if (bSet) UpdateFormField(pDocument, pFormField, true, true, true); } else { @@ -2503,7 +2503,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa crRect.bottom != rcOld.bottom) { pWidget->SetRect(crRect); - UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE); + UpdateFormControl(pDocument, pFormControl, true, true, true); } } } @@ -2512,17 +2512,17 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa } } -FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; @@ -2535,7 +2535,7 @@ FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE ASSERT(pFormField != NULL); if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED) vp << true; @@ -2543,16 +2543,16 @@ FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE vp << false; } - return TRUE; + return true; } -FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; bool bVP; vp >> bVP; @@ -2570,13 +2570,13 @@ FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) - return FALSE; + return false; if (pFormField->GetFieldFlags() & FIELDFLAG_RICHTEXT) vp << true; @@ -2584,7 +2584,7 @@ FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE vp << false; } - return TRUE; + return true; } void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b) @@ -2592,19 +2592,19 @@ void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; ; } else { ; } - return TRUE; + return true; } void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex) @@ -2612,13 +2612,13 @@ void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -2636,18 +2636,18 @@ FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; vp << (int32_t)pFormControl->GetRotation(); } - return TRUE; + return true; } void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -2655,15 +2655,15 @@ void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; - if (!vp.IsArrayObject())return FALSE; + if (!vp.IsArrayObject())return false; CJS_Array crArray(m_isolate); vp >> crArray; @@ -2684,13 +2684,13 @@ FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; int iColorType; pFormControl->GetBorderColor(iColorType); @@ -2719,14 +2719,14 @@ FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& pFormControl->GetOriginalBorderColor(3)); } else - return FALSE; + return false; CJS_Array crArray(m_isolate); color::ConvertPWLColorToArray(color, crArray); vp << crArray; } - return TRUE; + return true; } void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color) @@ -2734,13 +2734,13 @@ void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& sw //Not supported. } -FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_ByteString csBCaption; vp >> csBCaption; @@ -2758,17 +2758,17 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON && pFormField->GetFieldType() != FIELDTYPE_CHECKBOX) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl) return FALSE; + if (!pFormControl) return false; CFX_WideString csWCaption = pFormControl->GetNormalCaption(); CFX_ByteString csBCaption; @@ -2797,7 +2797,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro vp << csBCaption; } - return TRUE; + return true; } void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, @@ -2806,21 +2806,21 @@ void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN //Not supported. } -FX_BOOL Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CJS_Array crArray(m_isolate); - if (!vp.IsArrayObject())return FALSE; + if (!vp.IsArrayObject())return false; vp >> crArray; CPWL_Color color; @@ -2839,13 +2839,13 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; int iColorType; FX_ARGB color; @@ -2866,7 +2866,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s vp << crArray; } - return TRUE; + return true; } void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color) @@ -2874,17 +2874,17 @@ void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_ByteString csFontName; vp >> csFontName; - if (csFontName.IsEmpty()) return FALSE; + if (csFontName.IsEmpty()) return false; if (m_bDelay) { @@ -2899,13 +2899,13 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; int nFieldType = pFormField->GetFieldType(); @@ -2915,15 +2915,15 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE nFieldType == FIELDTYPE_TEXTFIELD) { CPDF_Font * pFont = pFormControl->GetDefaultControlFont(); - if (!pFont) return FALSE; + if (!pFont) return false; vp << pFont->GetBaseFont(); } else - return FALSE; + return false; } - return TRUE; + return true; } void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string) @@ -2931,13 +2931,13 @@ void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int nVP; vp >> nVP; @@ -2955,13 +2955,13 @@ FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance(); @@ -2972,7 +2972,7 @@ FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE vp << (int)fFontSize; } - return TRUE; + return true; } void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) @@ -2980,15 +2980,15 @@ void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!vp.IsGetting()) return FALSE; + if (!vp.IsGetting()) return false; CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -3024,16 +3024,16 @@ FX_BOOL Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError break; } - return TRUE; + return true; } -FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CFX_WideString swName; vp >> swName; @@ -3051,7 +3051,7 @@ FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -3059,7 +3059,7 @@ FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE vp << (CFX_WideString)pFormField->GetAlternateName(); } - return TRUE; + return true; } void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string) @@ -3067,13 +3067,13 @@ void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); if (vp.IsSetting()) { - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; CJS_WideStringArray strArray; @@ -3109,7 +3109,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -3119,14 +3119,14 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro switch (pFormField->GetFieldType()) { case FIELDTYPE_PUSHBUTTON: - return FALSE; + return false; case FIELDTYPE_COMBOBOX: case FIELDTYPE_TEXTFIELD: { CFX_WideString swValue = pFormField->GetValue(); double dRet; - FX_BOOL bDot; + bool bDot; if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot)) { if (bDot) @@ -3160,7 +3160,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro CFX_WideString swValue = pFormField->GetValue(); double dRet; - FX_BOOL bDot; + bool bDot; if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot)) { if (bDot) @@ -3176,14 +3176,14 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro case FIELDTYPE_CHECKBOX: case FIELDTYPE_RADIOBUTTON: { - FX_BOOL bFind = FALSE; + bool bFind = false; for (int i = 0 , sz = pFormField->CountControls(); i < sz; i++) { if (pFormField->GetControl(i)->IsChecked()) { CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue(); double dRet; - FX_BOOL bDot; + bool bDot; if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot)) { if (bDot) @@ -3194,7 +3194,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro else vp << swValue; - bFind = TRUE; + bFind = true; break; } else @@ -3210,7 +3210,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro } } - return TRUE; + return true; } void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, @@ -3238,8 +3238,8 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN if (pFormField->GetValue() != strArray.GetAt(0)) { CFX_WideString WideString = strArray.GetAt(0); - pFormField->SetValue(strArray.GetAt(0), TRUE); - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); + pFormField->SetValue(strArray.GetAt(0), true); + UpdateFormField(pDocument, pFormField, true, false, true); } break; case FIELDTYPE_CHECKBOX: //mantis: 0004493 @@ -3247,14 +3247,14 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN { if (pFormField->GetValue() != strArray.GetAt(0)) { - pFormField->SetValue(strArray.GetAt(0), TRUE); - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); + pFormField->SetValue(strArray.GetAt(0), true); + UpdateFormField(pDocument, pFormField, true, false, true); } } break; case FIELDTYPE_LISTBOX: { - FX_BOOL bModified = FALSE; + bool bModified = false; for (int i=0,sz=strArray.GetSize(); i<sz; i++) { @@ -3262,21 +3262,21 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN if (!pFormField->IsItemSelected(iIndex)) { - bModified = TRUE; + bModified = true; break; } } if (bModified) { - pFormField->ClearSelection(TRUE); + pFormField->ClearSelection(true); for (int i=0,sz=strArray.GetSize(); i<sz; i++) { int iIndex = pFormField->FindOption(strArray.GetAt(i)); - pFormField->SetItemSelection(iIndex, TRUE, TRUE); + pFormField->SetItemSelection(iIndex, true, true); } - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); + UpdateFormField(pDocument, pFormField, true, false, true); } } break; @@ -3286,25 +3286,25 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN } } -FX_BOOL Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!vp.IsGetting()) return FALSE; + if (!vp.IsGetting()) return false; CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; if (pFormField->GetFieldType() == FIELDTYPE_CHECKBOX) { - if(!pFormField->CountControls()) return FALSE; + if(!pFormField->CountControls()) return false; if (pFormField->GetControl(0)->IsChecked()) vp << L"Yes"; @@ -3331,18 +3331,18 @@ FX_BOOL Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStrin else vp << pFormField->GetValue().c_str(); - return TRUE; + return true; } /* --------------------------------- methods --------------------------------- */ -FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -3357,17 +3357,17 @@ FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& pa if(!wsFileName.IsEmpty()) { pFormField->SetValue(wsFileName); - UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); + UpdateFormField(m_pDocument, pFormField, true, true, true); } } else - return FALSE; + return false; - return TRUE; + return true; } -FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3378,16 +3378,16 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; if (nface == 0) vRet = pFormControl->GetNormalCaption().c_str(); @@ -3396,14 +3396,14 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, else if (nface == 2) vRet = pFormControl->GetRolloverCaption().c_str(); else - return FALSE; + return false; - return TRUE; + return true; } //#pragma warning(disable: 4800) -FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3414,16 +3414,16 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) - return FALSE; + return false; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -3432,7 +3432,7 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ ASSERT(pRuntime != NULL); JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon")); - ASSERT(pObj.IsEmpty() == FALSE); + ASSERT(pObj.IsEmpty() == false); CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj); ASSERT(pJS_Icon != NULL); @@ -3448,27 +3448,27 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ else if (nface == 2) pIconStream = pFormControl->GetRolloverIcon(); else - return FALSE; + return false; pIcon->SetStream(pIconStream); vRet = pJS_Icon; - return TRUE; + return true; } //#pragma warning(default: 4800) -FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { #if 0 ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); - if (!pFormField)return FALSE; + if (!pFormField)return false; CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); ASSERT(pEnv); @@ -3477,7 +3477,7 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, if (sIconFileName.IsEmpty()) { vRet = 1; - return TRUE; + return true; } CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); @@ -3487,110 +3487,110 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, if (!pStream) { vRet = -1; - return TRUE; + return true; } CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); - if (!pFormControl)return FALSE; + if (!pFormControl)return false; pFormControl->SetNormalIcon(pStream); - UpdateFormControl(m_pDocument, pFormControl, TRUE, TRUE, TRUE); + UpdateFormControl(m_pDocument, pFormControl, true, true, true); vRet = 0; #endif // 0 - return TRUE; + return true; } -FX_BOOL Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int iSize = params.size(); if (iSize < 1) - return FALSE; + return false; int nWidget = params[0].ToInt(); - FX_BOOL bCheckit = TRUE; + bool bCheckit = true; if (iSize >= 2) bCheckit = params[1].ToBool(); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON) - return FALSE; + return false; if(nWidget <0 || nWidget >= pFormField->CountControls()) - return FALSE; + return false; if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON) - pFormField->CheckControl(nWidget, bCheckit, TRUE); + pFormField->CheckControl(nWidget, bCheckit, true); else - pFormField->CheckControl(nWidget, bCheckit, TRUE); + pFormField->CheckControl(nWidget, bCheckit, true); - UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); - return TRUE; + UpdateFormField(m_pDocument, pFormField, true, true, true); + return true; } -FX_BOOL Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); - if (!m_bCanSet) return FALSE; + if (!m_bCanSet) return false; int iSize = params.size(); if (iSize < 1) - return FALSE; + return false; int nWidget = params[0].ToInt(); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if(nWidget <0 || nWidget >= pFormField->CountControls()) { - vRet = FALSE; - return FALSE; + vRet = false; + return false; } if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX) || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)) { - vRet = TRUE; + vRet = true; } else - vRet = FALSE; + vRet = false; - return TRUE; + return true; } -FX_BOOL Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2) @@ -3602,13 +3602,13 @@ int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2) } -FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CGW_ArrayTemplate<CFX_WideString*> swSort; @@ -3633,7 +3633,7 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val CFX_WideString* pStr = swSort.GetAt(j); JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field")); - ASSERT(pObj.IsEmpty() == FALSE); + ASSERT(pObj.IsEmpty() == false); CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj); ASSERT(pJSField != NULL); @@ -3652,10 +3652,10 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val vRet = FormFieldArray; swSort.RemoveAll(); - return TRUE; + return true; } -FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); int iSize = params.size(); @@ -3664,13 +3664,13 @@ FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va if (iSize >= 1) nIdx = params[0].ToInt(); - FX_BOOL bExport = TRUE; + bool bExport = true; if (iSize >= 2) bExport = params[1].ToBool(); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); @@ -3692,22 +3692,22 @@ FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va vRet = pFormField->GetOptionLabel(nIdx).c_str(); } else - return FALSE; + return false; - return TRUE; + return true; } -FX_BOOL Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3717,32 +3717,32 @@ FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if(nIndex <0 || nIndex >= pFormField->CountControls()) { - vRet = FALSE; - return FALSE; + vRet = false; + return false; } if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX) || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)) { if (pFormField->GetControl(nIndex)->IsChecked() !=0 ) - vRet = TRUE; + vRet = true; else - vRet = FALSE; + vRet = false; } else - vRet = FALSE; + vRet = false; - return TRUE; + return true; } -FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3752,49 +3752,49 @@ FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); if(nIndex <0 || nIndex >= pFormField->CountControls()) { - vRet = FALSE; - return FALSE; + vRet = false; + return false; } if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX) || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)) { if (pFormField->GetControl(nIndex)->IsDefaultChecked() != 0) - vRet = TRUE; + vRet = true; else - vRet = FALSE; + vRet = false; } else - vRet = FALSE; + vRet = false; - return TRUE; + return true; } -FX_BOOL Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); - if (FieldArray.GetSize() <= 0) return FALSE; + if (FieldArray.GetSize() <= 0) return false; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); int32_t nCount = pFormField->CountControls(); - if (nCount < 1) return FALSE; + if (nCount < 1) return false; CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); ASSERT(pInterForm != NULL); @@ -3810,7 +3810,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val ASSERT(pEnv); CPDF_Page* pPage = (CPDF_Page*)pEnv->FFI_GetCurrentPage(m_pDocument->GetDocument()); if(!pPage) - return FALSE; + return false; if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage)) { for (int32_t i=0; i<nCount; i++) @@ -3832,57 +3832,57 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val m_pDocument->SetFocusAnnot(pWidget); } - return TRUE; + return true; } -FX_BOOL Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { vp << (CJS_Object*)NULL; } - return TRUE; + return true; } /////////////////////////////////////////// delay ///////////////////////////////////////////// diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp index 6b3e02e1ec..27a9773235 100644 --- a/fpdfsdk/src/javascript/Icon.cpp +++ b/fpdfsdk/src/javascript/Icon.cpp @@ -57,11 +57,11 @@ CFX_WideString Icon::GetIconName() return m_swIconName; } -FX_BOOL Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if(!vp.IsGetting())return FALSE; + if(!vp.IsGetting())return false; vp << m_swIconName; - return TRUE; + return true; } diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp index 72be34d751..0edbf0d0e5 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); diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp index 1769e3053f..1056c446f4 100644 --- a/fpdfsdk/src/javascript/JS_EventHandler.cpp +++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp @@ -20,21 +20,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), @@ -121,7 +121,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); @@ -132,7 +132,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); @@ -142,7 +142,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; @@ -153,7 +153,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); @@ -163,7 +163,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); @@ -175,7 +175,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); @@ -188,11 +188,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); @@ -213,8 +213,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); @@ -230,7 +230,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); @@ -244,7 +244,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); @@ -255,7 +255,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); @@ -264,7 +264,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); @@ -273,7 +273,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); @@ -282,7 +282,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); @@ -291,7 +291,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); @@ -300,7 +300,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); @@ -309,7 +309,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); @@ -318,7 +318,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); @@ -327,7 +327,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); @@ -336,7 +336,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); @@ -395,33 +395,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; } @@ -444,17 +444,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; } @@ -555,7 +555,7 @@ const FX_WCHAR* CJS_EventHandler::Type() return L""; } -FX_BOOL& CJS_EventHandler::Rc() +bool& CJS_EventHandler::Rc() { if (m_pbRc) { return *m_pbRc; @@ -579,7 +579,7 @@ int & CJS_EventHandler::SelStart() return m_nSelStartDu; } -FX_BOOL CJS_EventHandler::Shift() +bool CJS_EventHandler::Shift() { return m_bShift; } @@ -591,9 +591,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); @@ -625,9 +625,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); @@ -653,7 +653,7 @@ CFX_WideString& CJS_EventHandler::Value() return *m_pValue; } -FX_BOOL CJS_EventHandler::WillCommit() +bool CJS_EventHandler::WillCommit() { return m_bWillCommit; } diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp index 8c7bd7150e..71e3a50a60 100644 --- a/fpdfsdk/src/javascript/JS_GlobalData.cpp +++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp @@ -296,7 +296,7 @@ void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname) } } -FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent) +bool CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, bool bPersistent) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -304,18 +304,18 @@ FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_ sPropName.TrimLeft(); sPropName.TrimRight(); - if (sPropName.GetLength() == 0) return FALSE; + if (sPropName.GetLength() == 0) return false; if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName)) { pData->bPersistent = bPersistent; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname) +bool CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -323,7 +323,7 @@ FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname) sPropName.TrimLeft(); sPropName.TrimRight(); - if (sPropName.GetLength() == 0) return FALSE; + if (sPropName.GetLength() == 0) return false; int nFind = FindGlobalVariable(sPropName); @@ -331,10 +331,10 @@ FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname) { delete m_arrayGlobalData.GetAt(nFind); m_arrayGlobalData.RemoveAt(nFind); - return TRUE; + return true; } - return FALSE; + return false; } int32_t CJS_GlobalData::GetSize() const @@ -417,7 +417,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() break; } SetGlobalVariableNumber(sEntry, dData); - SetGlobalVariablePersistent(sEntry, TRUE); + SetGlobalVariablePersistent(sEntry, true); } break; case JS_GLOBALDATA_TYPE_BOOLEAN: @@ -425,7 +425,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() FX_WORD wData = *((FX_WORD*)p); p += sizeof(FX_WORD); SetGlobalVariableBoolean(sEntry, (bool)(wData == 1)); - SetGlobalVariablePersistent(sEntry, TRUE); + SetGlobalVariablePersistent(sEntry, true); } break; case JS_GLOBALDATA_TYPE_STRING: @@ -437,14 +437,14 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() break; SetGlobalVariableString(sEntry, CFX_ByteString(p, dwLength)); - SetGlobalVariablePersistent(sEntry, TRUE); + SetGlobalVariablePersistent(sEntry, true); p += sizeof(char) * dwLength; } break; case JS_GLOBALDATA_TYPE_NULL: { SetGlobalVariableNull(sEntry); - SetGlobalVariablePersistent(sEntry, TRUE); + SetGlobalVariablePersistent(sEntry, true); } } } diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index 485cd27813..7333e88cd2 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -40,7 +40,7 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environ embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot; } JS_Initial(embedderDataSlot); - m_bInit = TRUE; + m_bInit = true; } return new CJS_Runtime(pApp); } @@ -58,7 +58,7 @@ void CJS_RuntimeFactory::Release() { JS_Release(); ReleaseGlobalData(); - m_bInit = FALSE; + m_bInit = false; } } } @@ -108,7 +108,7 @@ void CJS_ArrayBufferAllocator::Free(void* data, size_t length) { CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) : m_pApp(pApp), m_pDocument(NULL), - m_bBlocking(FALSE), + m_bBlocking(false), m_pFieldEventPath(NULL), m_isolate(NULL) { @@ -150,46 +150,46 @@ CJS_Runtime::~CJS_Runtime() m_isolate->Dispose(); } -FX_BOOL CJS_Runtime::InitJSObjects() +bool CJS_Runtime::InitJSObjects() { v8::Isolate::Scope isolate_scope(GetIsolate()); v8::HandleScope handle_scope(GetIsolate()); v8::Local<v8::Context> context = v8::Context::New(GetIsolate()); v8::Context::Scope context_scope(context); //0 - 8 - if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_Border::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Display::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Font::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Position::Init(*this, JS_STATIC) < 0) return false; + if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return false; + if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Style::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return false; //9 - 11 - if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_App::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Color::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Console::Init(*this, JS_STATIC) < 0) return false; //12 - 14 - if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE; - if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE; + if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return false; + if (CJS_Event::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return false; //15 - 17 - if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE; - if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_Global::Init(*this, JS_STATIC) < 0) return false; + if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return false; + if (CJS_Util::Init(*this, JS_STATIC) < 0) return false; - if (CJS_PublicMethods::Init(*this) < 0) return FALSE; - if (CJS_GlobalConsts::Init(*this) < 0) return FALSE; - if (CJS_GlobalArrays::Init(*this) < 0) return FALSE; + if (CJS_PublicMethods::Init(*this) < 0) return false; + if (CJS_GlobalConsts::Init(*this) < 0) return false; + if (CJS_GlobalArrays::Init(*this) < 0) return false; - if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return FALSE; - if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return FALSE; + if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return false; + if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return false; - return TRUE; + return true; } IFXJS_Context* CJS_Runtime::NewContext() @@ -255,7 +255,7 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc) } } -FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType) +bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType) { if (m_pFieldEventPath == NULL) { @@ -264,7 +264,7 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_ m_pFieldEventPath->eEventType = eEventType; m_pFieldEventPath->pNext = NULL; - return TRUE; + return true; } //to search @@ -273,7 +273,7 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_ while (p) { if (p->eEventType == eEventType && p->sTargetName == sTargetName) - return FALSE; + return false; pLast = p; p = p->pNext; @@ -287,12 +287,12 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_ pLast->pNext = pNew; - return TRUE; + return true; } void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType) { - FX_BOOL bFind = FALSE; + bool bFind = false; CJS_FieldEvent* p = m_pFieldEventPath; CJS_FieldEvent* pLast = NULL; @@ -300,7 +300,7 @@ void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_ { if (p->eEventType == eEventType && p->sTargetName == sTargetName) { - bFind = TRUE; + bFind = true; break; } diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp index 058f2eaf45..611b1112a0 100644 --- a/fpdfsdk/src/javascript/JS_Value.cpp +++ b/fpdfsdk/src/javascript/JS_Value.cpp @@ -256,45 +256,45 @@ FXJSVALUETYPE CJS_Value::GetType() const return VT_unknown; } -FX_BOOL CJS_Value::IsArrayObject() const +bool CJS_Value::IsArrayObject() const { - if(m_pValue.IsEmpty()) return FALSE; + if(m_pValue.IsEmpty()) return false; return m_pValue->IsArray(); } -FX_BOOL CJS_Value::IsDateObject() const +bool CJS_Value::IsDateObject() const { - if(m_pValue.IsEmpty()) return FALSE; + if(m_pValue.IsEmpty()) return false; return m_pValue->IsDate(); } //CJS_Value::operator CJS_Array() -FX_BOOL CJS_Value::ConvertToArray(CJS_Array &array) const +bool CJS_Value::ConvertToArray(CJS_Array &array) const { if (IsArrayObject()) { array.Attach(JS_ToArray(m_isolate, m_pValue)); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const +bool CJS_Value::ConvertToDate(CJS_Date &date) const { // if (GetType() == VT_date) // { // date = (double)(*this); -// return TRUE; +// return true; // } if (IsDateObject()) { date.Attach(m_pValue); - return TRUE; + return true; } - return FALSE; + return false; } /* ---------------------------- CJS_PropValue ---------------------------- */ @@ -314,12 +314,12 @@ CJS_PropValue::~CJS_PropValue() { } -FX_BOOL CJS_PropValue::IsSetting() +bool CJS_PropValue::IsSetting() { return m_bIsSetting; } -FX_BOOL CJS_PropValue::IsGetting() +bool CJS_PropValue::IsGetting() { return !m_bIsSetting; } @@ -480,9 +480,9 @@ void CJS_Array::Attach(v8::Local<v8::Array> pArray) m_pArray = pArray; } -FX_BOOL CJS_Array::IsAttached() +bool CJS_Array::IsAttached() { - return FALSE; + return false; } void CJS_Array::GetElement(unsigned index,CJS_Value &value) @@ -543,9 +543,9 @@ CJS_Date::~CJS_Date() { } -FX_BOOL CJS_Date::IsValidDate() +bool CJS_Date::IsValidDate() { - if(m_pDate.IsEmpty()) return FALSE; + if(m_pDate.IsEmpty()) return false; return !JS_PortIsNan(JS_ToNumber(m_isolate, m_pDate)); } diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index daecdbec89..0aa23d16a9 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -72,76 +72,76 @@ static const FX_WCHAR* fullmonths[] = L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December" }; -FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string) +bool CJS_PublicMethods::IsNumber(const FX_WCHAR* string) { CFX_WideString sTrim = StrTrim(string); const FX_WCHAR* pTrim = sTrim.c_str(); const FX_WCHAR* p = pTrim; - FX_BOOL bDot = FALSE; - FX_BOOL bKXJS = FALSE; + bool bDot = false; + bool bKXJS = false; wchar_t c; while ((c = *p)) { if (c == '.' || c == ',') { - if (bDot) return FALSE; - bDot = TRUE; + if (bDot) return false; + bDot = true; } else if (c == '-' || c == '+') { if (p != pTrim) - return FALSE; + return false; } else if (c == 'e' || c == 'E') { if (bKXJS) - return FALSE; + return false; p++; c = *p; if (c == '+' || c == '-') { - bKXJS = TRUE; + bKXJS = true; } else { - return FALSE; + return false; } } else if (!IsDigit(c)) { - return FALSE; + return false; } p++; } - return TRUE; + return true; } -FX_BOOL CJS_PublicMethods::IsDigit(wchar_t ch) +bool CJS_PublicMethods::IsDigit(wchar_t ch) { return (ch >= L'0' && ch <= L'9'); } -FX_BOOL CJS_PublicMethods::IsDigit(char ch) +bool CJS_PublicMethods::IsDigit(char ch) { return (ch >= '0' && ch <= '9'); } -FX_BOOL CJS_PublicMethods::IsAlphabetic(wchar_t ch) +bool CJS_PublicMethods::IsAlphabetic(wchar_t ch) { return ((ch >= L'a' && ch <= L'z') || (ch >= L'A' && ch <= L'Z')); } -FX_BOOL CJS_PublicMethods::IsAlphaNumeric(wchar_t ch) +bool CJS_PublicMethods::IsAlphaNumeric(wchar_t ch) { return (IsDigit(ch) || IsAlphabetic(ch)); } -FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask) +bool CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask) { switch (c_Mask) { @@ -152,13 +152,13 @@ FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask) case L'O': return IsAlphaNumeric(c_Change); case L'X': - return TRUE; + return true; default: return (c_Change == c_Mask); } } -FX_BOOL CJS_PublicMethods::isReservedMaskChar(wchar_t ch) +bool CJS_PublicMethods::isReservedMaskChar(wchar_t ch) { return ch == L'9' || ch == L'A' || ch == L'O' || ch == L'X'; } @@ -226,13 +226,13 @@ CFX_ByteString CJS_PublicMethods::StrTrim(const FX_CHAR* pStr) return StrRTrim(StrLTrim(pStr)); } -double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS) +double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits, bool& bDot, bool& bSign, bool& bKXJS) { - bDot = FALSE; - bSign = FALSE; - bKXJS = FALSE; + bDot = false; + bSign = false; + bKXJS = false; - FX_BOOL bDigitExist = FALSE; + bool bDigitExist = false; const FX_WCHAR* p = swSource; wchar_t c; @@ -253,7 +253,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig if (!pStart) { - bAllDigits = FALSE; + bAllDigits = false; return 0; } @@ -267,7 +267,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig double dRet = 0; p = pStart; - bAllDigits = TRUE; + bAllDigits = true; CFX_WideString swDigits; while (p <= pEnd) @@ -277,14 +277,14 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig if (IsDigit(c)) { swDigits += c; - bDigitExist = TRUE; + bDigitExist = true; } else { switch (c) { case L' ': - bAllDigits = FALSE; + bAllDigits = false; break; case L'.': case L',': @@ -298,10 +298,10 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig { swDigits += L'0'; swDigits += L'.'; - bDigitExist = TRUE; + bDigitExist = true; } - bDot = TRUE; + bDot = true; break; } case 'e': @@ -312,7 +312,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig c = *p; if (c == '+' || c == '-') { - bKXJS = TRUE; + bKXJS = true; swDigits += 'e'; swDigits += c; } @@ -322,21 +322,21 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig if (!bDigitExist && !bSign) { swDigits += c; - bSign = TRUE; + bSign = true; break; } default: - bAllDigits = FALSE; + bAllDigits = false; if (p != pStart && !bDot && bDigitExist) { swDigits += L'.'; - bDot = TRUE; + bDot = true; } else { - bDot = FALSE; - bDigitExist = FALSE; + bDot = false; + bDigitExist = false; swDigits = L""; } break; @@ -374,19 +374,19 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig double CJS_PublicMethods::ParseStringToNumber(const FX_WCHAR* swSource) { - FX_BOOL bAllDigits = FALSE; - FX_BOOL bDot = FALSE; - FX_BOOL bSign = FALSE; - FX_BOOL bKXJS = FALSE; + bool bAllDigits = false; + bool bDot = false; + bool bSign = false; + bool bKXJS = false; return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS); } -FX_BOOL CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot) +bool CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, bool & bDot) { - FX_BOOL bAllDigits = FALSE; - FX_BOOL bSign = FALSE; - FX_BOOL bKXJS = FALSE; + bool bAllDigits = false; + bool bSign = false; + bool bKXJS = false; dRet = ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS); @@ -477,7 +477,7 @@ CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& string return swRet; } -double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat) +double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bWrongFormat) { double dt = JS_GetDateTime(); @@ -525,7 +525,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& nMonth = number[1]; } - bWrongFormat = FALSE; + bWrongFormat = false; } else if (nIndex == 3) { @@ -552,11 +552,11 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& nYear = number[2]; } - bWrongFormat = FALSE; + bWrongFormat = false; } else { - bWrongFormat = TRUE; + bWrongFormat = true; return dt; } @@ -565,7 +565,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& return JS_DateParse(swTemp.c_str()); } -double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, FX_BOOL& bWrongFormat) +double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, bool& bWrongFormat) { double dt = JS_GetDateTime(); @@ -581,9 +581,9 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF int nYearSub = 99; //nYear - 2000; - FX_BOOL bPm = FALSE; - FX_BOOL bExit = FALSE; - bWrongFormat = FALSE; + bool bPm = false; + bool bExit = false; + bWrongFormat = false; int i=0; int j=0; @@ -715,7 +715,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF case 'm': { CFX_WideString sMonth = ParseStringString(value, j, nSkip); - FX_BOOL bFind = FALSE; + bool bFind = false; for (int m = 0; m < 12; m++) { if (sMonth.CompareNoCase(months[m]) == 0) @@ -723,7 +723,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF nMonth = m + 1; i+=3; j+=nSkip; - bFind = TRUE; + bFind = true; break; } } @@ -757,7 +757,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF break; case 'm': { - FX_BOOL bFind = FALSE; + bool bFind = false; CFX_WideString sMonth = ParseStringString(value, j, nSkip); sMonth.MakeLower(); @@ -772,7 +772,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF nMonth = m + 1; i += 4; j += nSkip; - bFind = TRUE; + bFind = true; break; } } @@ -795,8 +795,8 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF { if (j >= value.GetLength() || format.GetAt(i) != value.GetAt(j)) { - bWrongFormat = TRUE; - bExit = TRUE; + bWrongFormat = true; + bExit = true; } i++; j++; @@ -804,8 +804,8 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF if (oldj == j) { - bWrongFormat = TRUE; - bExit = TRUE; + bWrongFormat = true; + bExit = true; } } @@ -813,12 +813,12 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF default: if (value.GetLength() <= j) { - bExit = TRUE; + bExit = true; } else if (format.GetAt(i) != value.GetAt(j)) { - bWrongFormat = TRUE; - bExit = TRUE; + bWrongFormat = true; + bExit = true; } i++; @@ -833,19 +833,19 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF nYear += 2000; if (nMonth < 1 || nMonth > 12) - bWrongFormat = TRUE; + bWrongFormat = true; if (nDay < 1 || nDay > 31) - bWrongFormat = TRUE; + bWrongFormat = true; if (nHour < 0 || nHour > 24) - bWrongFormat = TRUE; + bWrongFormat = true; if (nMin < 0 || nMin > 60) - bWrongFormat = TRUE; + bWrongFormat = true; if (nSec < 0 || nSec > 60) - bWrongFormat = TRUE; + bWrongFormat = true; double dRet = 0; @@ -1021,7 +1021,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideStr /* -------------------------------------------------------------------------- */ //function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) -FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { #if _FX_OS_ != _FX_ANDROID_ v8::Isolate* isolate = ::GetIsolate(cc); @@ -1033,21 +1033,21 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete if (params.size() != 6) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString& Value = pEvent->Value(); CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value)); - if (strValue.IsEmpty()) return TRUE; + if (strValue.IsEmpty()) return true; int iDec = params[0].ToInt(); int iSepStyle = params[1].ToInt(); int iNegStyle = params[2].ToInt(); // params[3] is iCurrStyle, it's not used. std::wstring wstrCurrency(params[4].ToCFXWideString().c_str()); - FX_BOOL bCurrencyPrepend = params[5].ToBool(); + bool bCurrencyPrepend = params[5].ToBool(); if (iDec < 0) iDec = -iDec; @@ -1224,11 +1224,11 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete } Value = strValue2.c_str(); #endif - return TRUE; + return true; } //function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) -FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1236,13 +1236,13 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param ASSERT(pEvent != NULL); if(params.size() < 2) - return FALSE; + return false; int iSepStyle = params[1].ToInt(); if (iSepStyle < 0 || iSepStyle > 3) iSepStyle = 0; if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString & val = pEvent->Value(); CFX_WideString & w_strChange = pEvent->Change(); CFX_WideString w_strValue = val; @@ -1252,18 +1252,18 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param CFX_WideString wstrChange = w_strChange; CFX_WideString wstrValue = StrLTrim(w_strValue.c_str()); if (wstrValue.IsEmpty()) - return TRUE; + return true; CFX_WideString swTemp = wstrValue; swTemp.Replace(L",", L"."); if (!IsNumber(swTemp.c_str())) { - pEvent->Rc() = FALSE; + pEvent->Rc() = false; sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE); Alert(pContext, sError.c_str()); - return TRUE; + return true; } - return TRUE; // it happens after the last keystroke and before validating, + return true; // it happens after the last keystroke and before validating, } std::wstring w_strValue2 = w_strValue.c_str(); @@ -1271,15 +1271,15 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param std::wstring w_strSelected; if(-1 != pEvent->SelStart()) w_strSelected = w_strValue2.substr(pEvent->SelStart(),(pEvent->SelEnd() - pEvent->SelStart())); - FX_BOOL bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1); + bool bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1); if (bHasSign) { //can't insert "change" in front to sign postion. if (pEvent->SelStart() == 0) { - FX_BOOL &bRc = pEvent->Rc(); - bRc = FALSE; - return TRUE; + bool &bRc = pEvent->Rc(); + bRc = false; + return true; } } @@ -1297,49 +1297,49 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param break; } - FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1); + bool bHasSep = (w_strValue2.find(cSep) != -1); for (std::wstring::iterator it = w_strChange2.begin(); it != w_strChange2.end(); it++) { if (*it == cSep) { if (bHasSep) { - FX_BOOL &bRc = pEvent->Rc(); - bRc = FALSE; - return TRUE; + bool &bRc = pEvent->Rc(); + bRc = false; + return true; } - bHasSep = TRUE; + bHasSep = true; continue; } if (*it == L'-') { if (bHasSign) { - FX_BOOL &bRc = pEvent->Rc(); - bRc = FALSE; - return TRUE; + bool &bRc = pEvent->Rc(); + bRc = false; + return true; } if (it != w_strChange2.begin()) //sign's position is not correct { - FX_BOOL &bRc = pEvent->Rc(); - bRc = FALSE; - return TRUE; + bool &bRc = pEvent->Rc(); + bRc = false; + return true; } if (pEvent->SelStart() != 0) { - FX_BOOL &bRc = pEvent->Rc(); - bRc = FALSE; - return TRUE; + bool &bRc = pEvent->Rc(); + bRc = false; + return true; } - bHasSign = TRUE; + bHasSign = true; continue; } if (!IsDigit(*it)) { - FX_BOOL &bRc = pEvent->Rc(); - bRc = FALSE; - return TRUE; + bool &bRc = pEvent->Rc(); + bRc = false; + return true; } } @@ -1351,12 +1351,12 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param w_strValue2 = w_prefix + w_strChange2 + w_postfix; w_strValue = w_strValue2.c_str(); val = w_strValue; - return TRUE; + return true; } //function AFPercent_Format(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { #if _FX_OS_ != _FX_ANDROID_ CJS_Context* pContext = (CJS_Context *)cc; @@ -1367,15 +1367,15 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet if (params.size() != 2) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString& Value = pEvent->Value(); CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value)); if (strValue.IsEmpty()) - return TRUE; + return true; int iDec = params[0].ToInt(); if (iDec < 0) @@ -1461,16 +1461,16 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet strValue += "%"; Value = CFX_WideString::FromLocal(strValue); #endif - return TRUE; + return true; } //AFPercent_Keystroke(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return AFNumber_Keystroke(cc,params,vRet,sError); } //function AFDate_FormatEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1480,18 +1480,18 @@ FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Paramete if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString& val = pEvent->Value(); CFX_WideString strValue = val; if (strValue.IsEmpty()) - return TRUE; + return true; CFX_WideString sFormat = params[0].ToCFXWideString(); - FX_BOOL bWrongFormat = FALSE; + bool bWrongFormat = false; double dDate = 0.0f; if(strValue.Find(L"GMT") != -1) @@ -1510,11 +1510,11 @@ FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Paramete CFX_WideString swMsg; swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str()); Alert(pContext, swMsg.c_str()); - return FALSE; + return false; } val = MakeFormatDate(dDate,sFormat); - return TRUE; + return true; } double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) @@ -1578,7 +1578,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) } //AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1588,33 +1588,33 @@ FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Param if (params.size() != 1) { sError = L"AFDate_KeystrokeEx's parameters' size r not correct"; - return FALSE; + return false; } if (pEvent->WillCommit()) { if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString strValue = pEvent->Value(); if (strValue.IsEmpty()) - return TRUE; + return true; CFX_WideString sFormat = params[0].ToCFXWideString(); - FX_BOOL bWrongFormat = FALSE; + bool bWrongFormat = false; double dRet = MakeRegularDate(strValue,sFormat,bWrongFormat); if (bWrongFormat || JS_PortIsNan(dRet)) { CFX_WideString swMsg; swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str()); Alert(pContext, swMsg.c_str()); - pEvent->Rc() = FALSE; - return TRUE; + pEvent->Rc() = false; + return true; } } - return TRUE; + return true; } -FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1624,7 +1624,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters ASSERT(pContext != NULL); sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } int iIndex = params[0].ToInt(); @@ -1645,7 +1645,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters } //AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1655,7 +1655,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Paramet ASSERT(pContext != NULL); sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } int iIndex = params[0].ToInt(); @@ -1676,7 +1676,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Paramet } //function AFTime_Format(ptf) -FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1685,7 +1685,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } int iIndex = params[0].ToInt(); @@ -1703,7 +1703,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters return AFDate_FormatEx(cc,newParams,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); if (params.size() != 1) @@ -1711,7 +1711,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Paramet CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } int iIndex = params[0].ToInt(); @@ -1729,18 +1729,18 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Paramet return AFDate_KeystrokeEx(cc,newParams,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return AFDate_FormatEx(cc,params,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return AFDate_KeystrokeEx(cc,params,vRet,sError); } //function AFSpecial_Format(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1748,7 +1748,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } std::string cFormat; @@ -1758,7 +1758,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet ASSERT(pEvent != NULL); if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString& Value = pEvent->Value(); std::string strSrc = CFX_ByteString::FromUnicode(Value).c_str(); @@ -1788,12 +1788,12 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet std::string strDes; util::printx(cFormat,strSrc,strDes); Value = CFX_WideString::FromLocal(strDes.c_str()); - return TRUE; + return true; } //function AFSpecial_KeystrokeEx(mask) -FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1804,23 +1804,23 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa if (params.size() < 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString& valEvent = pEvent->Value(); CFX_WideString wstrMask = params[0].ToCFXWideString(); if (wstrMask.IsEmpty()) - return TRUE; + return true; std::wstring wstrValue = valEvent.c_str(); if (pEvent->WillCommit()) { if (wstrValue.empty()) - return TRUE; + return true; int iIndexMask = 0; for (std::wstring::iterator it = wstrValue.begin(); it != wstrValue.end(); it++) { @@ -1833,30 +1833,30 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa if (iIndexMask != wstrMask.GetLength() || (iIndexMask != wstrValue.size() && wstrMask.GetLength() != 0)) { Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE).c_str()); - pEvent->Rc() = FALSE; + pEvent->Rc() = false; } - return TRUE; + return true; } CFX_WideString &wideChange = pEvent->Change(); std::wstring wChange = wideChange.c_str(); if (wChange.empty()) - return TRUE; + return true; int iIndexMask = pEvent->SelStart(); if (wstrValue.length() - (pEvent->SelEnd()-pEvent->SelStart()) + wChange.length() > (FX_DWORD)wstrMask.GetLength()) { Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str()); - pEvent->Rc() = FALSE; - return TRUE; + pEvent->Rc() = false; + return true; } if (iIndexMask >= wstrMask.GetLength() && (!wChange.empty())) { Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str()); - pEvent->Rc() = FALSE; - return TRUE; + pEvent->Rc() = false; + return true; } for (std::wstring::iterator it = wChange.begin(); it != wChange.end(); it++) @@ -1864,8 +1864,8 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa if (iIndexMask >= wstrMask.GetLength()) { Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str()); - pEvent->Rc() = FALSE; - return TRUE; + pEvent->Rc() = false; + return true; } wchar_t w_Mask = wstrMask[iIndexMask]; if (!isReservedMaskChar(w_Mask)) @@ -1875,19 +1875,19 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa wchar_t w_Change = *it; if (!maskSatisfied(w_Change,w_Mask)) { - pEvent->Rc() = FALSE; - return TRUE; + pEvent->Rc() = false; + return true; } iIndexMask++; } wideChange = wChange.c_str(); - return TRUE; + return true; } //function AFSpecial_Keystroke(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1899,14 +1899,14 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } std::string cFormat; int iIndex = params[0].ToInt(); if(!pEvent->m_pValue) - return FALSE; + return false; //CJS_Value val = pEvent->Value(); CFX_WideString& val = pEvent->Value(); std::string strSrc = CFX_ByteString::FromUnicode(val).c_str(); @@ -1946,7 +1946,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para return AFSpecial_KeystrokeEx(cc,params2,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1956,7 +1956,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_WideString swValue; @@ -1966,7 +1966,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters if (pEventHandler->WillCommit()) { vRet = swValue.c_str(); - return TRUE; + return true; } CFX_WideString prefix,postfix; @@ -1983,10 +1983,10 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters vRet = (prefix + pEventHandler->Change() + postfix).c_str(); - return TRUE; + return true; } -FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1994,13 +1994,13 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters if (params.size() != 2) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_WideString sValue = params[0].ToCFXWideString(); CFX_WideString sFormat = params[1].ToCFXWideString(); - FX_BOOL bWrongFormat = FALSE; + bool bWrongFormat = false; double dDate = MakeRegularDate(sValue,sFormat,bWrongFormat); if (JS_PortIsNan(dDate)) @@ -2008,14 +2008,14 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters CFX_WideString swMsg; swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str()); Alert((CJS_Context *)cc, swMsg.c_str()); - return FALSE; + return false; } vRet = dDate; - return TRUE; + return true; } -FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() != 3) { @@ -2023,14 +2023,14 @@ FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& par ASSERT(pContext != NULL); sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } vRet = (double)AF_Simple(params[0].ToCFXWideString().c_str(), params[1].ToDouble(), params[2].ToDouble()); - return TRUE; + return true; } -FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() != 1) { @@ -2038,13 +2038,13 @@ FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& ASSERT(pContext != NULL); sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } vRet = ParseStringToNumber(params[0].ToCFXWideString().c_str()); - return TRUE; + return true; } -FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -2054,7 +2054,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param if (params.size() != 2) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CJS_Value params1 = params[1]; @@ -2062,7 +2062,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param if (!params1.IsArrayObject() && params1.GetType() != VT_string) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CPDFSDK_Document* pReaderDoc = pContext->GetReaderDocument(); @@ -2162,13 +2162,13 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param if((CJS_EventHandler*)pContext->GetEventHandler()->m_pValue) ((CJS_EventHandler*)pContext->GetEventHandler())->Value() = jsValue.ToCFXWideString(); - return TRUE; + return true; } /* This function validates the current event to ensure that its value is ** within the specified range. */ -FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -2178,17 +2178,17 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Paramet if (params.size() != 4) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if(!pEvent->m_pValue) - return FALSE; + return false; if (pEvent->Value().IsEmpty() ) - return TRUE; + return true; double dEentValue = atof(CFX_ByteString::FromUnicode(pEvent->Value())); - FX_BOOL bGreaterThan = params[0].ToBool(); + bool bGreaterThan = params[0].ToBool(); double dGreaterThan = params[1].ToDouble(); - FX_BOOL bLessThan = params[2].ToBool(); + bool bLessThan = params[2].ToBool(); double dLessThan = params[3].ToDouble(); CFX_WideString swMsg; @@ -2215,12 +2215,12 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Paramet if (!swMsg.IsEmpty()) { Alert(pContext, swMsg.c_str()); - pEvent->Rc() = FALSE; + pEvent->Rc() = false; } - return TRUE; + return true; } -FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); CJS_Context* pContext = (CJS_Context*)cc; @@ -2229,7 +2229,7 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CJS_Array nums(isolate); @@ -2269,5 +2269,5 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters else vRet.SetNull(); - return TRUE; + return true; } diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index af329655fd..0f35297485 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -134,10 +134,10 @@ app::~app(void) m_aTimer.RemoveAll(); } -FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) - return FALSE; + return false; CJS_Context* pContext = (CJS_Context *)cc; CPDFDoc_Environment* pApp = pContext->GetReaderApp(); @@ -166,120 +166,120 @@ FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else vp.SetNull(); - return TRUE; + return true; } -FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { bool bVP; vp >> bVP; - m_bCalculate = (FX_BOOL)bVP; + m_bCalculate = (bool)bVP; CJS_Context* pContext = (CJS_Context*)cc; CPDFDoc_Environment* pApp = pContext->GetReaderApp(); CJS_Runtime* pRuntime = pContext->GetJSRuntime(); CJS_Array aDocs(pRuntime->GetIsolate()); if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument()) - pDoc->GetInterForm()->EnableCalculate((FX_BOOL)m_bCalculate); + pDoc->GetInterForm()->EnableCalculate((bool)m_bCalculate); } else { vp << (bool)m_bCalculate; } - return TRUE; + return true; } -FX_BOOL app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { vp << JS_NUM_FORMSVERSION; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { vp << L"unknown"; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { vp << JS_STR_VIEWERVARIATION; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { vp << JS_STR_VIEWERVERSION; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { vp << JS_STR_PLATFORM; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { vp << JS_STR_LANGUANGE; - return TRUE; + return true; } - return FALSE; + return false; } //creates a new fdf object that contains no data //comment: need reader support //note: //CFDF_Document * CPDFDoc_Environment::NewFDF(); -FX_BOOL app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } //opens a specified pdf document and returns its document object //comment:need reader support //note: as defined in js reference, the proto of this function's fourth parmeters, how old an fdf document while do not show it. //CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); -FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); if (iSize < 1) - return FALSE; + return false; CFX_WideString swMsg = L""; CFX_WideString swTitle = L""; @@ -336,7 +336,7 @@ FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v } else if (params[0].GetType() == VT_boolean) { - FX_BOOL bGet = params[0].ToBool(); + bool bGet = params[0].ToBool(); if (bGet) swMsg = L"true"; else @@ -354,7 +354,7 @@ FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v { if (params[0].GetType() == VT_boolean) { - FX_BOOL bGet = params[0].ToBool(); + bool bGet = params[0].ToBool(); if (bGet) swMsg = L"true"; else @@ -386,11 +386,11 @@ FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc), swMsg.c_str(), swTitle.c_str(), iType, iIcon); pRuntime->EndBlock(); - return TRUE; + return true; } -FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() == 1) { @@ -398,42 +398,42 @@ FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR CJS_Runtime* pRuntime = pContext->GetJSRuntime(); CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp(); pEnv->JS_appBeep(params[0].ToInt()); - return TRUE; + return true; } sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } -FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() > 2 || params.size() == 0) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_WideString script = params.size() > 0 ? params[0].ToCFXWideString() : L""; if (script.IsEmpty()) { sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE); - return TRUE; + return true; } CJS_Runtime* pRuntime = pContext->GetJSRuntime(); @@ -463,15 +463,15 @@ FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va vRet = pRetObj; - return TRUE; + return true; } -FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() > 2 || params.size() == 0) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CJS_Context* pContext = (CJS_Context*)cc; @@ -483,7 +483,7 @@ FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val if (script.IsEmpty()) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE); - return TRUE; + return true; } FX_DWORD dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000; @@ -512,10 +512,10 @@ FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val vRet = pRetObj; - return TRUE; + return true; } -FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -525,7 +525,7 @@ FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V if (params.size() != 1) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if (params[0].GetType() == VT_fxobject) @@ -560,10 +560,10 @@ FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V } } - return TRUE; + return true; } -FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -573,7 +573,7 @@ FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_ if (params.size() != 1) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } if (params[0].GetType() == VT_fxobject) @@ -608,12 +608,12 @@ FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_ } } - return TRUE; + return true; } -FX_BOOL app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } void app::TimerProc(CJS_Timer* pTimer) @@ -651,24 +651,24 @@ void app::RunJsScript(CJS_Runtime* pRuntime,const CFX_WideString& wsScript) } } -FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. - return TRUE; + return true; } -FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. - return TRUE; + return true; } -FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; v8::Isolate* isolate = GetIsolate(cc); - FX_BOOL bUI = TRUE; + bool bUI = true; CFX_WideString cTo = L""; CFX_WideString cCc = L""; CFX_WideString cBcc = L""; @@ -676,7 +676,7 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& CFX_WideString cMsg = L""; if (params.size() < 1) - return FALSE; + return false; if (params[0].GetType() == VT_object) { @@ -701,7 +701,7 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& cMsg = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString(); } else { if (params.size() < 2) - return FALSE; + return false; bUI = params[0].ToBool(); cTo = params[1].ToCFXWideString(); @@ -726,16 +726,16 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str()); pRuntime->EndBlock(); - return FALSE; + return false; } -FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -746,24 +746,24 @@ FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri vp<<m_bRuntimeHighLight; } - return TRUE; + return true; } -FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) @@ -792,17 +792,17 @@ CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) return sRet; } -FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CFX_WideString swQuestion = L""; CFX_WideString swLabel = L""; @@ -873,7 +873,7 @@ FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value MAX_INPUT_BYTES); if (nLengthBytes <= 0) { vRet.SetNull(); - return FALSE; + return false; } nLengthBytes = std::min(nLengthBytes, MAX_INPUT_BYTES); @@ -881,15 +881,15 @@ FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value CFX_WideString::FromUTF16LE((unsigned short*)pBuff.get(), nLengthBytes / sizeof(unsigned short)); vRet = ret_string.c_str(); - return TRUE; + return true; } -FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return FALSE; + return false; } -FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp index a2bbadcd51..7c3c1374b2 100644 --- a/fpdfsdk/src/javascript/color.cpp +++ b/fpdfsdk/src/javascript/color.cpp @@ -155,7 +155,7 @@ void color::ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color) } #define JS_IMPLEMENT_COLORPROP(prop, var)\ -FX_BOOL color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\ +bool color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\ {\ CJS_Context* pContext = (CJS_Context*)cc;\ v8::Isolate* isolate = pContext->GetJSRuntime()->GetIsolate();\ @@ -168,10 +168,10 @@ FX_BOOL color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError else\ {\ CJS_Array array(isolate);\ - if (!vp.ConvertToArray(array)) return FALSE;\ + if (!vp.ConvertToArray(array)) return false;\ ConvertArrayToPWLColor(array, var);\ }\ - return TRUE;\ + return true;\ } JS_IMPLEMENT_COLORPROP(transparent, m_crTransparent) @@ -187,13 +187,13 @@ JS_IMPLEMENT_COLORPROP(dkGray, m_crDKGray) JS_IMPLEMENT_COLORPROP(gray, m_crGray) JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray) -FX_BOOL color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = GetIsolate(cc); int iSize = params.size(); - if (iSize < 2) return FALSE; + if (iSize < 2) return false; CJS_Array aSource(isolate); - if (!params[0].ConvertToArray(aSource)) return FALSE; + if (!params[0].ConvertToArray(aSource)) return false; CPWL_Color crSource; ConvertArrayToPWLColor(aSource, crSource); @@ -224,18 +224,18 @@ FX_BOOL color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu ConvertPWLColorToArray(crDest, aDest); vRet = aDest; - return TRUE; + return true; } -FX_BOOL color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = GetIsolate(cc); - if (params.size() < 2) return FALSE; + if (params.size() < 2) return false; CJS_Array array1(isolate), array2(isolate); - if (!params[0].ConvertToArray(array1)) return FALSE; - if (!params[1].ConvertToArray(array2)) return FALSE; + if (!params[0].ConvertToArray(array1)) return false; + if (!params[1].ConvertToArray(array2)) return false; CPWL_Color color1; CPWL_Color color2; @@ -246,6 +246,6 @@ FX_BOOL color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& color1.ConvertColorType(color2.nColorType); vRet = color1 == color2; - return TRUE; + return true; } diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp index ed9b1fbc56..4d8067110a 100644 --- a/fpdfsdk/src/javascript/console.cpp +++ b/fpdfsdk/src/javascript/console.cpp @@ -38,28 +38,28 @@ console::~console() { } -FX_BOOL console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } -FX_BOOL console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() < 1) { - return FALSE; + return false; } - return TRUE; + return true; } -FX_BOOL console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { - return TRUE; + return true; } diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp index f57b1fb607..ee73e42311 100644 --- a/fpdfsdk/src/javascript/event.cpp +++ b/fpdfsdk/src/javascript/event.cpp @@ -56,7 +56,7 @@ event::~event(void) { } -FX_BOOL event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -73,12 +73,12 @@ FX_BOOL event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr { vp << wChange; } - return TRUE; + return true; } -FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -86,12 +86,12 @@ FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE ASSERT(pEvent != NULL); vp << pEvent->ChangeEx(); - return TRUE; + return true; } -FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -99,10 +99,10 @@ FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s ASSERT(pEvent != NULL); vp << pEvent->CommitKey(); - return TRUE; + return true; } -FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -110,18 +110,18 @@ FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s ASSERT(pEvent != NULL); if (!vp.IsGetting() && wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0) - return FALSE; + return false; if (pEvent->FieldFull()) - vp << TRUE; + vp << true; else - vp << FALSE; - return TRUE; + vp << false; + return true; } -FX_BOOL event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -129,15 +129,15 @@ FX_BOOL event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr ASSERT(pEvent != NULL); if (pEvent->KeyDown()) - vp << TRUE; + vp << true; else - vp << FALSE; - return TRUE; + vp << false; + return true; } -FX_BOOL event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -145,15 +145,15 @@ FX_BOOL event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE ASSERT(pEvent != NULL); if (pEvent->Modifier()) - vp << TRUE; + vp << true; else - vp << FALSE; - return TRUE; + vp << false; + return true; } -FX_BOOL event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -161,17 +161,17 @@ FX_BOOL event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError ASSERT(pEvent != NULL); vp << pEvent->Name(); - return TRUE; + return true; } -FX_BOOL event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); ASSERT(pEvent != NULL); - FX_BOOL &bRc = pEvent->Rc(); + bool &bRc = pEvent->Rc(); if (vp.IsSetting()) { vp>>bRc; @@ -180,12 +180,12 @@ FX_BOOL event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { vp<<bRc; } - return TRUE; + return true; } -FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; if (vp.IsSetting()) { } @@ -193,12 +193,12 @@ FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& { ; } - return TRUE; + return true; } -FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; if (vp.IsSetting()) { } @@ -206,13 +206,13 @@ FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString { ; } - return TRUE; + return true; } -FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - return TRUE; + return true; if (vp.IsSetting()) { } @@ -220,10 +220,10 @@ FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s { ; } - return TRUE; + return true; } -FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -232,7 +232,7 @@ FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0) { - return TRUE; + return true; } int &iSelEnd = pEvent->SelEnd(); @@ -244,10 +244,10 @@ FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr { vp << iSelEnd; } - return TRUE; + return true; } -FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -256,7 +256,7 @@ FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0) { - return TRUE; + return true; } int &iSelStart = pEvent->SelStart(); if (vp.IsSetting()) @@ -267,12 +267,12 @@ FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE { vp << iSelStart; } - return TRUE; + return true; } -FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -280,15 +280,15 @@ FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro ASSERT(pEvent != NULL); if (pEvent->Shift()) - vp << TRUE; + vp << true; else - vp << FALSE; - return TRUE; + vp << false; + return true; } -FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -296,12 +296,12 @@ FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr ASSERT(pEvent != NULL); vp << pEvent->Source()->GetJSObject(); - return TRUE; + return true; } -FX_BOOL event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -309,12 +309,12 @@ FX_BOOL event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr ASSERT(pEvent != NULL); vp<<pEvent->Target_Field()->GetJSObject(); - return TRUE; + return true; } -FX_BOOL event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -322,12 +322,12 @@ FX_BOOL event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& ASSERT(pEvent != NULL); vp << pEvent->TargetName(); - return TRUE; + return true; } -FX_BOOL event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -335,10 +335,10 @@ FX_BOOL event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError ASSERT(pEvent != NULL); vp << pEvent->Type(); - return TRUE; + return true; } -FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -346,9 +346,9 @@ FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro ASSERT(pEvent != NULL); if (wcscmp((const wchar_t*)pEvent->Type(),L"Field") != 0) - return FALSE; + return false; if(!pEvent->m_pValue) - return FALSE; + return false; CFX_WideString & val = pEvent->Value(); if (vp.IsSetting()) { @@ -358,12 +358,12 @@ FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro { vp << val; } - return TRUE; + return true; } -FX_BOOL event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) +bool event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return false; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -371,9 +371,9 @@ FX_BOOL event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& ASSERT(pEvent != NULL); if (pEvent->WillCommit()) - vp << TRUE; + vp << true; else - vp << FALSE; - return TRUE; + vp << false; + return true; } diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index 6965c8c884..98a3cd6cb5 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -96,7 +96,7 @@ END_JS_STATIC_METHOD() IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, global_alternate, global); -FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc) +bool CJS_Global::InitInstance(IFXJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -106,7 +106,7 @@ FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc) pGlobal->Initial(pContext->GetReaderApp()); - return TRUE; + return true; }; global_alternate::global_alternate(CJS_Object* pJSObject) @@ -128,26 +128,26 @@ void global_alternate::Initial(CPDFDoc_Environment* pApp) UpdateGlobalPersistentVariables(); } -FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname) +bool global_alternate::QueryProperty(const FX_WCHAR* propname) { return CFX_WideString(propname) != L"setPersistent"; } -FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError) +bool global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError) { js_global_data* pData = NULL; CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname); if (m_mapGlobal.Lookup(sPropName, (void*&)pData)) { - pData->bDeleted = TRUE; - return TRUE; + pData->bDeleted = true; + return true; } - return FALSE; + return false; } -FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError) +bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -158,34 +158,34 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname { double dData; vp >> dData; - return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), FALSE); + return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), false); } case VT_boolean: { bool bData; vp >> bData; - return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), FALSE); + return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), false); } case VT_string: { CFX_ByteString sData; vp >> sData; - return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), FALSE); + return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), false); } case VT_object: { JSObject pData; vp >> pData; - return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE); + return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, false); } case VT_null: { - return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), FALSE); + return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), false); } case VT_undefined: { DelProperty(cc, propname, sError); - return TRUE; + return true; } default: break; @@ -197,51 +197,51 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname if (!m_mapGlobal.Lookup(CFX_ByteString::FromUnicode(propname), pVoid)) { vp.SetNull(); - return TRUE; + return true; } if (!pVoid) { vp.SetNull(); - return TRUE; + return true; } js_global_data* pData = (js_global_data*)pVoid; if (pData->bDeleted) - return TRUE; + return true; switch (pData->nType) { case JS_GLOBALDATA_TYPE_NUMBER: vp << pData->dData; - return TRUE; + return true; case JS_GLOBALDATA_TYPE_BOOLEAN: vp << pData->bData; - return TRUE; + return true; case JS_GLOBALDATA_TYPE_STRING: vp << pData->sData; - return TRUE; + return true; case JS_GLOBALDATA_TYPE_OBJECT: { v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(vp.GetIsolate(),pData->pData); vp << obj; - return TRUE; + return true; } case JS_GLOBALDATA_TYPE_NULL: vp.SetNull(); - return TRUE; + return true; default: break; } } - return FALSE; + return false; } -FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = static_cast<CJS_Context*>(cc); if (params.size() != 2) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); - return FALSE; + return false; } CFX_ByteString sName = params[0].ToCFXByteString(); @@ -252,12 +252,12 @@ FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& if (pData && !pData->bDeleted) { pData->bPersistent = params[1].ToBool(); - return TRUE; + return true; } } sError = JSGetStringFromID(pContext, IDS_STRING_JSNOGLOBAL); - return FALSE; + return false; } void global_alternate::UpdateGlobalPersistentVariables() @@ -480,10 +480,10 @@ void global_alternate::DestroyGlobalPersisitentVariables() } -FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, +bool global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent) { - if (propname == NULL) return FALSE; + if (propname == NULL) return false; js_global_data* pTemp = NULL; m_mapGlobal.Lookup(propname, (void*&)pTemp); @@ -498,7 +498,7 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, pTemp->nType = nType; } - pTemp->bDeleted = FALSE; + pTemp->bDeleted = false; switch (nType) { @@ -525,10 +525,10 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, case JS_GLOBALDATA_TYPE_NULL: break; default: - return FALSE; + return false; } - return TRUE; + return true; } js_global_data* pNewData = NULL; @@ -575,12 +575,12 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, } break; default: - return FALSE; + return false; } m_mapGlobal.SetAt(propname, (void*)pNewData); - return TRUE; + return true; } FXJSVALUETYPE GET_VALUE_TYPE(v8::Local<v8::Value> p) diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp index 1478feb1fa..820e7301d3 100644 --- a/fpdfsdk/src/javascript/report.cpp +++ b/fpdfsdk/src/javascript/report.cpp @@ -36,14 +36,14 @@ Report::~Report() } -FX_BOOL Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } -FX_BOOL Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. - return TRUE; + return true; } diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index 4083ed58da..21a7cb83ff 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -98,7 +98,7 @@ const stru_TbConvert fcTable[] = { int util::ParstDataType(std::wstring* sFormat) { - bool bPercent = FALSE; + bool bPercent = false; for (size_t i = 0; i < sFormat->length(); ++i) { wchar_t c = (*sFormat)[i]; @@ -136,11 +136,11 @@ int util::ParstDataType(std::wstring* sFormat) return -1; } -FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); if (iSize < 1) - return FALSE; + return false; std::wstring c_ConvChar(params[0].ToCFXWideString().c_str()); std::vector<std::wstring> c_strConvers; int iOffset = 0; @@ -198,16 +198,16 @@ FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& c_strResult.erase(c_strResult.begin()); vRet = c_strResult.c_str(); - return TRUE; + return true; } -FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = GetIsolate(cc); int iSize = params.size(); if (iSize < 2) - return FALSE; + return false; CJS_Value p1(isolate); p1 = params[0]; @@ -217,13 +217,13 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& if (!p2.ConvertToDate(jsDate)) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1); - return FALSE; + return false; } if (!jsDate.IsValidDate()) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT2); - return FALSE; + return false; } if (p1.GetType() == VT_number) @@ -261,11 +261,11 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& jsDate.GetSeconds()); break; default: - return FALSE; + return false; } vRet = swResult.c_str(); - return TRUE; + return true; } if (p1.GetType() == VT_string) { @@ -279,7 +279,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& if (bXFAPicture) { - return FALSE; //currently, it doesn't support XFAPicture. + return false; //currently, it doesn't support XFAPicture. } int iIndex; @@ -355,9 +355,9 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& strFormat = wcsftime(buf, 64, cFormat.c_str(), &time); cFormat = buf; vRet = cFormat.c_str(); - return TRUE; + return true; } - return FALSE; + return false; } void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose) @@ -450,11 +450,11 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur cPurpose = cFormat; } -FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); if (iSize<2) - return FALSE; + return false; CFX_WideString sFormat = params[0].ToCFXWideString(); CFX_WideString sSource = params[1].ToCFXWideString(); std::string cFormat = CFX_ByteString::FromUnicode(sFormat).c_str(); @@ -462,7 +462,7 @@ FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& std::string cDest; printx(cFormat,cSource,cDest); vRet = cDest.c_str(); - return TRUE; + return true; } void util::printx(const std::string &cFormat,const std::string &cSource2,std::string &cPurpose) @@ -564,19 +564,19 @@ void util::printx(const std::string &cFormat,const std::string &cSource2,std::st } } -FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { v8::Isolate* isolate = GetIsolate(cc); int iSize = params.size(); if (iSize < 2) - return FALSE; + return false; CFX_WideString sFormat = params[0].ToCFXWideString(); CFX_WideString sDate = params[1].ToCFXWideString(); double dDate = JS_GetDateTime(); if (sDate.GetLength() > 0) { - FX_BOOL bWrongFormat = FALSE; + bool bWrongFormat = false; dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat); } @@ -590,7 +590,7 @@ FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet.SetNull(); } - return TRUE; + return true; } int64_t FX_atoi64(const char *nptr) @@ -618,15 +618,15 @@ int64_t FX_atoi64(const char *nptr) return sign == '-' ? -total : total; } -FX_BOOL util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) +bool util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); if (iSize == 0) - return FALSE; + return false; int nByte = params[0].ToInt(); unsigned char cByte = (unsigned char)nByte; CFX_WideString csValue; csValue.Format(L"%c", cByte); vRet = csValue.c_str(); - return TRUE; + return true; } |