summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp474
-rw-r--r--fpdfsdk/src/javascript/Field.cpp880
-rw-r--r--fpdfsdk/src/javascript/Icon.cpp6
-rw-r--r--fpdfsdk/src/javascript/JS_Context.cpp64
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp102
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.cpp24
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp68
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp34
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp376
-rw-r--r--fpdfsdk/src/javascript/app.cpp178
-rw-r--r--fpdfsdk/src/javascript/color.cpp24
-rw-r--r--fpdfsdk/src/javascript/console.cpp18
-rw-r--r--fpdfsdk/src/javascript/event.cpp140
-rw-r--r--fpdfsdk/src/javascript/global.cpp68
-rw-r--r--fpdfsdk/src/javascript/report.cpp8
-rw-r--r--fpdfsdk/src/javascript/util.cpp46
16 files changed, 1255 insertions, 1255 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 668032dcba..59816f091f 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)
-bool CJS_Document::InitInstance(IFXJS_Context* cc)
+FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -152,7 +152,7 @@ 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.
-bool Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -226,10 +226,10 @@ bool Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
m_pDocument->ClearChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -241,10 +241,10 @@ bool Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
{
}
- return true;
+ return TRUE;
}
-bool Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -276,55 +276,55 @@ bool Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
}
}
- return true;
+ return TRUE;
}
-bool Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
+FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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
-bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
if (pPDFForm->CountFields(wideName) <= 0)
{
vRet.SetNull();
- return true;
+ return TRUE;
}
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
@@ -346,66 +346,66 @@ bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
pField->AttachField(this, wideName);
vRet = pJSField;
- return true;
+ return TRUE;
}
//Gets the name of the nth field in the document
-bool Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
}
-bool Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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(bool bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
+//int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
-bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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();
- bool bUI = iLength > 0 ? params[0].ToBool() : true;
+ FX_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 @@ bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
CFX_ByteTextBuf textBuf;
if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
- return false;
+ return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -429,24 +429,24 @@ bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
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;
}
-bool Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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);
- bool bUI = true;
+ FX_BOOL bUI = TRUE;
int nStart = 0;
int nEnd = 0;
- bool bSilent = false;
- bool bShrinkToFit = false;
- bool bPrintAsImage = false;
- bool bReverse = false;
- bool bAnnotations = false;
+ FX_BOOL bSilent = FALSE;
+ FX_BOOL bShrinkToFit = FALSE;
+ FX_BOOL bPrintAsImage = FALSE;
+ FX_BOOL bReverse = FALSE;
+ FX_BOOL bAnnotations = FALSE;
int nlength = params.size();
if(nlength ==9)
@@ -500,26 +500,26 @@ bool Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
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.
-bool Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
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.
-bool Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
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;
}
-bool Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
- bool bFDF = true;
- bool bEmpty = false;
+ FX_BOOL bFDF = TRUE;
+ FX_BOOL bEmpty = FALSE;
v8::Isolate* isolate = GetIsolate(cc);
CJS_Array aFields(isolate);
@@ -677,16 +677,16 @@ bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
- bool bAll = (aFields.GetLength() == 0);
+ FX_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 @@ bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
}
}
- 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;
}
-bool Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
+FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
{
- return false;
+ return FALSE;
}
-bool Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
+FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
{
- return false;
+ return FALSE;
}
-bool Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- bool bUI = true;
+ FX_BOOL bUI = TRUE;
CFX_WideString cTo = L"";
CFX_WideString cCc = L"";
CFX_WideString cBcc = L"";
@@ -803,40 +803,40 @@ bool Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
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;
}
-bool Document::author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
}
-bool Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
}
vp << pObj;
}
- return true;
+ return TRUE;
}
-bool Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
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;
}
-bool Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
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;
}
-bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
@@ -938,7 +938,7 @@ bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
vp >> m_bDelay;
if (m_bDelay)
@@ -969,14 +969,14 @@ bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
}
}
}
- return true;
+ return TRUE;
}
-bool Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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())
{
@@ -985,21 +985,21 @@ bool Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
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;
}
-bool Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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())
{
@@ -1008,21 +1008,21 @@ bool Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
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;
}
-bool Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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())
{
@@ -1031,21 +1031,21 @@ bool Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
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;
}
-bool Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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())
{
@@ -1054,24 +1054,24 @@ bool Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
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;
}
-bool Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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())
{
@@ -1080,58 +1080,58 @@ bool Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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;
}
-bool Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
//In Chrome case,should always return true.
if (vp.IsGetting()) {
vp << true;
}
- return true;
+ return TRUE;
}
-bool Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
@@ -1141,10 +1141,10 @@ bool Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
{
vp >> m_cwBaseURL;
}
- return true;
+ return TRUE;
}
-bool Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -1166,15 +1166,15 @@ bool Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
pInterForm->EnableCalculate(bCalculate);
}
- return true;
+ return TRUE;
}
-bool Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
@@ -1189,7 +1189,7 @@ bool Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideSt
}else{
vp << L"";
}
- return true;
+ return TRUE;
}
CFX_WideString Document::ReversalStr(CFX_WideString cbFrom)
@@ -1239,74 +1239,74 @@ CFX_WideString Document::CutString(CFX_WideString cbFrom)
return cbRet;
}
-bool Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- return true;
+ return TRUE;
}
-bool Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet.SetNull();
- return true;
+ return TRUE;
}
-bool Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet.SetNull();
- return true;
+ return TRUE;
}
-bool Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet = VT_undefined;
- return true;
+ return TRUE;
}
-bool Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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)
@@ -1370,12 +1370,12 @@ IconElement* IconTree::operator [](int iIndex)
return NULL;
}
-bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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();
@@ -1384,13 +1384,13 @@ bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
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;
@@ -1402,21 +1402,21 @@ bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
pNewIcon->NextIcon = NULL;
pNewIcon->IconStream = pIcon;
m_pIconTree->InsertIconElement(pNewIcon);
- return true;
+ return TRUE;
}
-bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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);
@@ -1431,13 +1431,13 @@ bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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);
@@ -1445,19 +1445,19 @@ bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
}
vp << Icons;
- return true;
+ return TRUE;
}
-bool Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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();
@@ -1470,82 +1470,82 @@ bool Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
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;
}
-bool Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, no supported.
- return true;
+ return TRUE;
}
-bool Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not implemented.
- return true;
+ return TRUE;
}
-bool Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
}
-bool Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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);
@@ -1584,23 +1584,23 @@ bool Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, C
}
vRet = swRet.c_str();
- return true;
+ return TRUE;
}
-bool Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
}
-bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
@@ -1611,11 +1611,11 @@ bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params,
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);
@@ -1640,10 +1640,10 @@ bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params,
vRet = nWords;
- return true;
+ return TRUE;
}
-bool Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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();
@@ -1652,7 +1652,7 @@ bool Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, C
// Not implemented yet.
vRet = pRetObj;
- return true;
+ return TRUE;
}
#define ISLATINWORD(u) (u != 0x20 && u <= 0x28FF)
@@ -1666,7 +1666,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj)
CPDF_Font* pFont = pTextObj->GetFont();
if (!pFont) return 0;
- bool bIsLatin = false;
+ FX_BOOL bIsLatin = FALSE;
for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
{
@@ -1701,7 +1701,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex
if (!pFont) return L"";
int nWords = 0;
- bool bIsLatin = false;
+ FX_BOOL bIsLatin = FALSE;
for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
{
@@ -1732,10 +1732,10 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex
return swRet;
}
-bool Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
/**
@@ -1748,39 +1748,39 @@ bool Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
(refW, ReflowWidth)
*/
-bool Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, no supported.
- return true;
+ return TRUE;
}
-bool Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 ca16c90c01..614843426e 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)
-bool CJS_Field::InitInstance(IFXJS_Context* cc)
+FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -120,15 +120,15 @@ 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);
}
-bool Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
+FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
{
ASSERT(pDocument != NULL);
m_pJSDoc = pDocument;
@@ -194,17 +194,17 @@ bool Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
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,
- bool bChangeMark, bool bResetAP, bool bRefresh)
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_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);
- bool bFormated = false;
+ FX_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,
- bool bChangeMark, bool bResetAP, bool bRefresh)
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_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)
{
- bool bFormated = false;
+ FX_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);
}
-bool Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel)
+FX_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 ---------------------------------------- */
-bool Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::alignment(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);
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 @@ bool Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
}
}
- 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.
}
-bool Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::borderStyle(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);
- 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 @@ bool Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
}
}
- 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)
{
- bool bSet = false;
+ FX_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
}
}
-bool Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::buttonAlignX(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;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
@@ -600,7 +600,7 @@ bool Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
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.
}
-bool Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::buttonAlignY(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;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
@@ -651,7 +651,7 @@ bool Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
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.
}
-bool Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::buttonFitBounds(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();
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.
}
-bool Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::buttonPosition(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;
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.
}
-bool Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::buttonScaleHow(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();
if (IconFit.IsProportionalScale())
@@ -793,7 +793,7 @@ bool Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
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.
}
-bool Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::buttonScaleWhen(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();
int ScaleM = IconFit.GetScaleMethod();
@@ -855,7 +855,7 @@ bool Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
}
}
- 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.
}
-bool Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::calcOrderIndex(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_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
ASSERT(pRDInterForm != NULL);
@@ -904,7 +904,7 @@ bool Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
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.
}
-bool Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::charLimit(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);
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.
}
-bool Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ 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 @@ 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.
}
-bool Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::commitOnSelChange(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_LISTBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_COMMITONSELCHANGE)
vp << true;
@@ -1038,7 +1038,7 @@ bool Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
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.
}
-bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideSt
{
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 @@ bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideSt
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);
}
}
}
-bool Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
;
}
- 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.
}
-bool Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::defaultValue(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 ||
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.
}
-bool Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::doNotScroll(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_DONOTSCROLL)
vp << true;
@@ -1256,7 +1256,7 @@ bool Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
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.
}
-bool Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::doNotSpellCheck(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 &&
pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSPELLCHECK)
vp << true;
@@ -1294,10 +1294,10 @@ bool Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
vp << false;
}
- return true;
+ return TRUE;
}
-void Field::SetDelay(bool bDelay)
+void Field::SetDelay(FX_BOOL bDelay)
{
m_bDelay = bDelay;
@@ -1308,11 +1308,11 @@ void Field::SetDelay(bool bDelay)
}
}
-bool Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << m_bDelay;
}
- return true;
+ return TRUE;
}
-bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::display(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);
@@ -1359,7 +1359,7 @@ bool Field::display(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;
FX_DWORD dwFlag = pWidget->GetFlags();
@@ -1387,7 +1387,7 @@ bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
}
}
- 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)
{
- bool bSet = false;
+ FX_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
}
}
-bool Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::editable(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_COMBOBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT)
vp << true;
@@ -1534,30 +1534,30 @@ bool Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
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;
}
-bool Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
else
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -1626,15 +1626,15 @@ bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
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 @@ bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
if (!pFormControl)
- return false;
+ return FALSE;
int iColorType;
pFormControl->GetBackgroundColor(iColorType);
@@ -1684,13 +1684,13 @@ bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
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.
}
-bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::hidden(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);
@@ -1731,7 +1731,7 @@ bool Field::hidden(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;
FX_DWORD dwFlags = pWidget->GetFlags();
@@ -1743,7 +1743,7 @@ bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
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)
{
- bool bSet = false;
+ FX_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
}
}
-bool Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::highlight(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);
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 @@ bool Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
}
}
- 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.
}
-bool Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::lineWidth(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);
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)
{
- bool bSet = false;
+ FX_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
}
}
-bool Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::multiline(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);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_MULTILINE)
vp << true;
@@ -2029,7 +2029,7 @@ bool Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
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.
}
-bool Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::multipleSelection(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_LISTBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_MULTISELECT)
vp << true;
@@ -2075,7 +2075,7 @@ bool Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
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.
}
-bool Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ 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 @@ bool Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << (int32_t) -1;
}
- return true;
+ return TRUE;
}
-bool Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::password(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_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_PASSWORD)
vp << true;
@@ -2199,7 +2199,7 @@ bool Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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.
}
-bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -2216,11 +2216,11 @@ bool Field::print(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;
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2232,7 +2232,7 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
if (m_nFormControlIndex < 0)
{
- bool bSet = false;
+ FX_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 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
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 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
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 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
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 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)
vp << true;
@@ -2324,20 +2324,20 @@ bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ 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 @@ 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 @@ 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)
{
- bool bSet = false;
+ FX_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
}
}
-bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED)
vp << true;
@@ -2543,16 +2543,16 @@ bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::richText(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_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_RICHTEXT)
vp << true;
@@ -2584,7 +2584,7 @@ bool Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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.
}
-bool Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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.
}
-bool Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::rotation(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);
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.
}
-bool Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::strokeColor(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 iColorType;
pFormControl->GetBorderColor(iColorType);
@@ -2719,14 +2719,14 @@ bool Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
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.
}
-bool Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::style(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_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 @@ bool Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
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.
}
-bool Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::textColor(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);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
int iColorType;
FX_ARGB color;
@@ -2866,7 +2866,7 @@ bool Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
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.
}
-bool Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::textFont(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);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
int nFieldType = pFormField->GetFieldType();
@@ -2915,15 +2915,15 @@ bool Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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.
}
-bool Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::textSize(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);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
@@ -2972,7 +2972,7 @@ bool Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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.
}
-bool Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
break;
}
- return true;
+ return TRUE;
}
-bool Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::userName(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);
@@ -3059,7 +3059,7 @@ bool Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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.
}
-bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::value(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);
@@ -3119,14 +3119,14 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
switch (pFormField->GetFieldType())
{
case FIELDTYPE_PUSHBUTTON:
- return false;
+ return FALSE;
case FIELDTYPE_COMBOBOX:
case FIELDTYPE_TEXTFIELD:
{
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- bool bDot;
+ FX_BOOL bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3160,7 +3160,7 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- bool bDot;
+ FX_BOOL bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3176,14 +3176,14 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
{
- bool bFind = false;
+ FX_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;
- bool bDot;
+ FX_BOOL bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3194,7 +3194,7 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
else
vp << swValue;
- bFind = true;
+ bFind = TRUE;
break;
}
else
@@ -3210,7 +3210,7 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
}
}
- 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:
{
- bool bModified = false;
+ FX_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
}
}
-bool Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
vp << pFormField->GetValue().c_str();
- return true;
+ return TRUE;
}
/* --------------------------------- methods --------------------------------- */
-bool Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& param
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;
}
-bool Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3378,16 +3378,16 @@ bool Field::buttonGetCaption(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;
if (nface == 0)
vRet = pFormControl->GetNormalCaption().c_str();
@@ -3396,14 +3396,14 @@ bool Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJ
else if (nface == 2)
vRet = pFormControl->GetRolloverCaption().c_str();
else
- return false;
+ return FALSE;
- return true;
+ return TRUE;
}
//#pragma warning(disable: 4800)
-bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3414,16 +3414,16 @@ bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
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 @@ bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
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 @@ bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
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)
-bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
if (sIconFileName.IsEmpty())
{
vRet = 1;
- return true;
+ return TRUE;
}
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
@@ -3487,110 +3487,110 @@ bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
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;
}
-bool Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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();
- bool bCheckit = true;
+ FX_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;
}
-bool Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
}
-bool Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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)
}
-bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
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 @@ bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet = FormFieldArray;
swSort.RemoveAll();
- return true;
+ return TRUE;
}
-bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
if (iSize >= 1)
nIdx = params[0].ToInt();
- bool bExport = true;
+ FX_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 @@ bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
vRet = pFormField->GetOptionLabel(nIdx).c_str();
}
else
- return false;
+ return FALSE;
- return true;
+ return TRUE;
}
-bool Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3717,32 +3717,32 @@ bool Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
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;
}
-bool Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3752,49 +3752,49 @@ bool Field::isDefaultChecked(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(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;
}
-bool Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
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 @@ bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
m_pDocument->SetFocusAnnot(pWidget);
}
- return true;
+ return TRUE;
}
-bool Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 27a9773235..6b3e02e1ec 100644
--- a/fpdfsdk/src/javascript/Icon.cpp
+++ b/fpdfsdk/src/javascript/Icon.cpp
@@ -57,11 +57,11 @@ CFX_WideString Icon::GetIconName()
return m_swIconName;
}
-bool Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 0edbf0d0e5..72be34d751 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();
}
-bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
+FX_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 @@ bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString&
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 @@ bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString&
m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());
m_pEventHandler->Destroy();
- m_bBusy = false;
+ m_bBusy = FALSE;
return nRet >= 0;
}
-bool CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
+FX_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 @@ bool CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
return DoJob(0, script, info);
}
-bool CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
+FX_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(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseDown(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseEnter(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseExit(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseUp(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Focus(FX_BOOL bModifier, FX_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(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Blur(FX_BOOL bModifier, FX_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, bool& bRc)
+void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_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, bool bWillCommit)
+void CJS_Context::OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit)
{
m_pEventHandler->OnField_Format(pTarget, Value, bWillCommit);
}
void CJS_Context::OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- bool bKeyDown, bool bModifier, int &nSelEnd,int &nSelStart,
- bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
- bool bWillCommit, bool bFieldFull, bool& bRc)
+ 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)
{
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,
- bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, bool& bRc)
+ FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, FX_BOOL& bRc)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Validate(strChange, strChangeEx, bKeyDown, bModifier, bShift, pTarget, Value, bRc);
}
-void CJS_Context::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Focus(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Blur(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Open(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Close(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseDown(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseUp(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseEnter(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseExit(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_InView(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_OutView(FX_BOOL bModifier, FX_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 1056c446f4..1769e3053f 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(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEENTER);
@@ -132,7 +132,7 @@ void CJS_EventHandler::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_Form
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEEXIT);
@@ -142,7 +142,7 @@ void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEDOWN);
m_eEventType = JET_FIELD_MOUSEDOWN;
@@ -153,7 +153,7 @@ void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEUP);
@@ -163,7 +163,7 @@ void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormFie
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_FOCUS);
@@ -175,7 +175,7 @@ void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField
m_pValue = (CFX_WideString*)&Value;
}
-void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_BLUR);
@@ -188,11 +188,11 @@ void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField*
}
void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
- 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)
+ 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)
{
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,
- bool bKeyDown, bool bModifier, bool bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc)
+ FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_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, bool& bRc)
+ CFX_WideString& Value, FX_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,
- bool bWillCommit)
+ FX_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(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_FOCUS);
@@ -264,7 +264,7 @@ void CJS_EventHandler::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_BLUR);
@@ -273,7 +273,7 @@ void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot*
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_OPEN);
@@ -282,7 +282,7 @@ void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot*
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_CLOSE);
@@ -291,7 +291,7 @@ void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEDOWN);
@@ -300,7 +300,7 @@ void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_A
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEUP);
@@ -309,7 +309,7 @@ void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Ann
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEENTER);
@@ -318,7 +318,7 @@ void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEEXIT);
@@ -327,7 +327,7 @@ void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_A
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_INVIEW);
@@ -336,7 +336,7 @@ void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Anno
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_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;
}
-bool CJS_EventHandler::IsValid()
+FX_BOOL CJS_EventHandler::IsValid()
{
return m_bValid;
}
@@ -444,17 +444,17 @@ int CJS_EventHandler::CommitKey()
return m_nCommitKey;
}
-bool CJS_EventHandler::FieldFull()
+FX_BOOL CJS_EventHandler::FieldFull()
{
return m_bFieldFull;
}
-bool CJS_EventHandler::KeyDown()
+FX_BOOL CJS_EventHandler::KeyDown()
{
return m_bKeyDown;
}
-bool CJS_EventHandler::Modifier()
+FX_BOOL CJS_EventHandler::Modifier()
{
return m_bModifier;
}
@@ -555,7 +555,7 @@ const FX_WCHAR* CJS_EventHandler::Type()
return L"";
}
-bool& CJS_EventHandler::Rc()
+FX_BOOL& CJS_EventHandler::Rc()
{
if (m_pbRc) {
return *m_pbRc;
@@ -579,7 +579,7 @@ int & CJS_EventHandler::SelStart()
return m_nSelStartDu;
}
-bool CJS_EventHandler::Shift()
+FX_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;
}
-bool CJS_EventHandler::WillCommit()
+FX_BOOL CJS_EventHandler::WillCommit()
{
return m_bWillCommit;
}
diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp
index 71e3a50a60..8c7bd7150e 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)
}
}
-bool CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, bool bPersistent)
+FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -304,18 +304,18 @@ bool CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, bool b
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;
}
-bool CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
+FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -323,7 +323,7 @@ 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 @@ 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 7333e88cd2..485cd27813 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();
}
-bool CJS_Runtime::InitJSObjects()
+FX_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)
}
}
-bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
+FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
if (m_pFieldEventPath == NULL)
{
@@ -264,7 +264,7 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
m_pFieldEventPath->eEventType = eEventType;
m_pFieldEventPath->pNext = NULL;
- return true;
+ return TRUE;
}
//to search
@@ -273,7 +273,7 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
while (p)
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
- return false;
+ return FALSE;
pLast = p;
p = p->pNext;
@@ -287,12 +287,12 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
pLast->pNext = pNew;
- return true;
+ return TRUE;
}
void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
- bool bFind = false;
+ FX_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 611b1112a0..058f2eaf45 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;
}
-bool CJS_Value::IsArrayObject() const
+FX_BOOL CJS_Value::IsArrayObject() const
{
- if(m_pValue.IsEmpty()) return false;
+ if(m_pValue.IsEmpty()) return FALSE;
return m_pValue->IsArray();
}
-bool CJS_Value::IsDateObject() const
+FX_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()
-bool CJS_Value::ConvertToArray(CJS_Array &array) const
+FX_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;
}
-bool CJS_Value::ConvertToDate(CJS_Date &date) const
+FX_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()
{
}
-bool CJS_PropValue::IsSetting()
+FX_BOOL CJS_PropValue::IsSetting()
{
return m_bIsSetting;
}
-bool CJS_PropValue::IsGetting()
+FX_BOOL CJS_PropValue::IsGetting()
{
return !m_bIsSetting;
}
@@ -480,9 +480,9 @@ void CJS_Array::Attach(v8::Local<v8::Array> pArray)
m_pArray = pArray;
}
-bool CJS_Array::IsAttached()
+FX_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()
{
}
-bool CJS_Date::IsValidDate()
+FX_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 0aa23d16a9..daecdbec89 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"
};
-bool CJS_PublicMethods::IsNumber(const FX_WCHAR* string)
+FX_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;
- bool bDot = false;
- bool bKXJS = false;
+ FX_BOOL bDot = FALSE;
+ FX_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;
}
-bool CJS_PublicMethods::IsDigit(wchar_t ch)
+FX_BOOL CJS_PublicMethods::IsDigit(wchar_t ch)
{
return (ch >= L'0' && ch <= L'9');
}
-bool CJS_PublicMethods::IsDigit(char ch)
+FX_BOOL CJS_PublicMethods::IsDigit(char ch)
{
return (ch >= '0' && ch <= '9');
}
-bool CJS_PublicMethods::IsAlphabetic(wchar_t ch)
+FX_BOOL CJS_PublicMethods::IsAlphabetic(wchar_t ch)
{
return ((ch >= L'a' && ch <= L'z') || (ch >= L'A' && ch <= L'Z'));
}
-bool CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
+FX_BOOL CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
{
return (IsDigit(ch) || IsAlphabetic(ch));
}
-bool CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
+FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
{
switch (c_Mask)
{
@@ -152,13 +152,13 @@ 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);
}
}
-bool CJS_PublicMethods::isReservedMaskChar(wchar_t ch)
+FX_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, bool& bAllDigits, bool& bDot, bool& bSign, bool& bKXJS)
+double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS)
{
- bDot = false;
- bSign = false;
- bKXJS = false;
+ bDot = FALSE;
+ bSign = FALSE;
+ bKXJS = FALSE;
- bool bDigitExist = false;
+ FX_BOOL bDigitExist = FALSE;
const FX_WCHAR* p = swSource;
wchar_t c;
@@ -253,7 +253,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
if (!pStart)
{
- bAllDigits = false;
+ bAllDigits = FALSE;
return 0;
}
@@ -267,7 +267,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
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, bool& bAllDigits
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, bool& bAllDigits
{
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, bool& bAllDigits
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, bool& bAllDigits
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, bool& bAllDigits
double CJS_PublicMethods::ParseStringToNumber(const FX_WCHAR* swSource)
{
- bool bAllDigits = false;
- bool bDot = false;
- bool bSign = false;
- bool bKXJS = false;
+ FX_BOOL bAllDigits = FALSE;
+ FX_BOOL bDot = FALSE;
+ FX_BOOL bSign = FALSE;
+ FX_BOOL bKXJS = FALSE;
return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
}
-bool CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, bool & bDot)
+FX_BOOL CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot)
{
- bool bAllDigits = false;
- bool bSign = false;
- bool bKXJS = false;
+ FX_BOOL bAllDigits = FALSE;
+ FX_BOOL bSign = FALSE;
+ FX_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, bool& bWrongFormat)
+double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat)
{
double dt = JS_GetDateTime();
@@ -525,7 +525,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bW
nMonth = number[1];
}
- bWrongFormat = false;
+ bWrongFormat = FALSE;
}
else if (nIndex == 3)
{
@@ -552,11 +552,11 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bW
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, bool& bW
return JS_DateParse(swTemp.c_str());
}
-double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, bool& bWrongFormat)
+double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, FX_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;
- bool bPm = false;
- bool bExit = false;
- bWrongFormat = false;
+ FX_BOOL bPm = FALSE;
+ FX_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);
- bool bFind = false;
+ FX_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':
{
- bool bFind = false;
+ FX_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)
-bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters&
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());
- bool bCurrencyPrepend = params[5].ToBool();
+ FX_BOOL bCurrencyPrepend = params[5].ToBool();
if (iDec < 0) iDec = -iDec;
@@ -1224,11 +1224,11 @@ bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters&
}
Value = strValue2.c_str();
#endif
- return true;
+ return TRUE;
}
//function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
-bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
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 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
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 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
std::wstring w_strSelected;
if(-1 != pEvent->SelStart())
w_strSelected = w_strValue2.substr(pEvent->SelStart(),(pEvent->SelEnd() - pEvent->SelStart()));
- bool bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
+ FX_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)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
}
@@ -1297,49 +1297,49 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
break;
}
- bool bHasSep = (w_strValue2.find(cSep) != -1);
+ FX_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)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
- bHasSep = true;
+ bHasSep = TRUE;
continue;
}
if (*it == L'-')
{
if (bHasSign)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
if (it != w_strChange2.begin()) //sign's position is not correct
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
if (pEvent->SelStart() != 0)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
- bHasSign = true;
+ bHasSign = TRUE;
continue;
}
if (!IsDigit(*it))
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
}
@@ -1351,12 +1351,12 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
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)
-bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters
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 @@ bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters
strValue += "%";
Value = CFX_WideString::FromLocal(strValue);
#endif
- return true;
+ return TRUE;
}
//AFPercent_Keystroke(nDec, sepStyle)
-bool CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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)
-bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters&
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();
- bool bWrongFormat = false;
+ FX_BOOL bWrongFormat = FALSE;
double dDate = 0.0f;
if(strValue.Find(L"GMT") != -1)
@@ -1510,11 +1510,11 @@ bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters&
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)
-bool CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Paramete
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();
- bool bWrongFormat = false;
+ FX_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;
}
-bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& p
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
int iIndex = params[0].ToInt();
@@ -1645,7 +1645,7 @@ bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& p
}
//AFDate_KeystrokeEx(cFormat)
-bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
int iIndex = params[0].ToInt();
@@ -1676,7 +1676,7 @@ bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters
}
//function AFTime_Format(ptf)
-bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& p
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 @@ bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& p
return AFDate_FormatEx(cc,newParams,vRet,sError);
}
-bool CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFTime_Keystroke(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();
@@ -1729,18 +1729,18 @@ bool CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters
return AFDate_KeystrokeEx(cc,newParams,vRet,sError);
}
-bool CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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);
}
-bool CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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)
-bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
std::string cFormat;
@@ -1758,7 +1758,7 @@ bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters
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 @@ bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters
std::string strDes;
util::printx(cFormat,strSrc,strDes);
Value = CFX_WideString::FromLocal(strDes.c_str());
- return true;
+ return TRUE;
}
//function AFSpecial_KeystrokeEx(mask)
-bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
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 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
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 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
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 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
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)
-bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Paramet
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 @@ bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Paramet
return AFSpecial_KeystrokeEx(cc,params2,vRet,sError);
}
-bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& p
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString swValue;
@@ -1966,7 +1966,7 @@ bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& p
if (pEventHandler->WillCommit())
{
vRet = swValue.c_str();
- return true;
+ return TRUE;
}
CFX_WideString prefix,postfix;
@@ -1983,10 +1983,10 @@ bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& p
vRet = (prefix + pEventHandler->Change() + postfix).c_str();
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& p
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();
- bool bWrongFormat = false;
+ FX_BOOL bWrongFormat = FALSE;
double dDate = MakeRegularDate(sValue,sFormat,bWrongFormat);
if (JS_PortIsNan(dDate))
@@ -2008,14 +2008,14 @@ bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& p
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;
}
-bool CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params
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;
}
-bool CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& pa
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
vRet = ParseStringToNumber(params[0].ToCFXWideString().c_str());
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Paramete
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CJS_Value params1 = params[1];
@@ -2062,7 +2062,7 @@ bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Paramete
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 @@ bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Paramete
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. */
-bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters
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()));
- bool bGreaterThan = params[0].ToBool();
+ FX_BOOL bGreaterThan = params[0].ToBool();
double dGreaterThan = params[1].ToDouble();
- bool bLessThan = params[2].ToBool();
+ FX_BOOL bLessThan = params[2].ToBool();
double dLessThan = params[3].ToDouble();
CFX_WideString swMsg;
@@ -2215,12 +2215,12 @@ bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters
if (!swMsg.IsEmpty())
{
Alert(pContext, swMsg.c_str());
- pEvent->Rc() = false;
+ pEvent->Rc() = FALSE;
}
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& p
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CJS_Array nums(isolate);
@@ -2269,5 +2269,5 @@ bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& p
else
vRet.SetNull();
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index 0f35297485..af329655fd 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -134,10 +134,10 @@ app::~app(void)
m_aTimer.RemoveAll();
}
-bool app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
vp.SetNull();
- return true;
+ return TRUE;
}
-bool app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
bool bVP;
vp >> bVP;
- m_bCalculate = (bool)bVP;
+ m_bCalculate = (FX_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((bool)m_bCalculate);
+ pDoc->GetInterForm()->EnableCalculate((FX_BOOL)m_bCalculate);
}
else
{
vp << (bool)m_bCalculate;
}
- return true;
+ return TRUE;
}
-bool app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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;
}
-bool app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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();
-bool app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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);
-bool app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet
}
else if (params[0].GetType() == VT_boolean)
{
- bool bGet = params[0].ToBool();
+ FX_BOOL bGet = params[0].ToBool();
if (bGet)
swMsg = L"true";
else
@@ -354,7 +354,7 @@ bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet
{
if (params[0].GetType() == VT_boolean)
{
- bool bGet = params[0].ToBool();
+ FX_BOOL bGet = params[0].ToBool();
if (bGet)
swMsg = L"true";
else
@@ -386,11 +386,11 @@ bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet
vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc), swMsg.c_str(), swTitle.c_str(), iType, iIcon);
pRuntime->EndBlock();
- return true;
+ return TRUE;
}
-bool app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() == 1)
{
@@ -398,42 +398,42 @@ bool app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet,
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;
}
-bool app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
vRet = pRetObj;
- return true;
+ return TRUE;
}
-bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
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 @@ bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet = pRetObj;
- return true;
+ return TRUE;
}
-bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
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 @@ bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
}
}
- return true;
+ return TRUE;
}
-bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
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 @@ bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
}
}
- return true;
+ return TRUE;
}
-bool app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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)
}
}
-bool app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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);
- bool bUI = true;
+ FX_BOOL bUI = TRUE;
CFX_WideString cTo = L"";
CFX_WideString cCc = L"";
CFX_WideString cBcc = L"";
@@ -676,7 +676,7 @@ bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
CFX_WideString cMsg = L"";
if (params.size() < 1)
- return false;
+ return FALSE;
if (params[0].GetType() == VT_object)
{
@@ -701,7 +701,7 @@ bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
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 @@ bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
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;
}
-bool app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
@@ -746,24 +746,24 @@ bool app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
vp<<m_bRuntimeHighLight;
}
- return true;
+ return TRUE;
}
-bool app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
}
-bool app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
MAX_INPUT_BYTES);
if (nLengthBytes <= 0) {
vRet.SetNull();
- return false;
+ return FALSE;
}
nLengthBytes = std::min(nLengthBytes, MAX_INPUT_BYTES);
@@ -881,15 +881,15 @@ bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
CFX_WideString::FromUTF16LE((unsigned short*)pBuff.get(),
nLengthBytes / sizeof(unsigned short));
vRet = ret_string.c_str();
- return true;
+ return TRUE;
}
-bool app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 7c3c1374b2..a2bbadcd51 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)\
-bool color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\
+FX_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 @@ 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)
-bool color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
ConvertPWLColorToArray(crDest, aDest);
vRet = aDest;
- return true;
+ return TRUE;
}
-bool color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
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 4d8067110a..ed9b1fbc56 100644
--- a/fpdfsdk/src/javascript/console.cpp
+++ b/fpdfsdk/src/javascript/console.cpp
@@ -38,28 +38,28 @@ console::~console()
{
}
-bool console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
}
-bool console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 ee73e42311..f57b1fb607 100644
--- a/fpdfsdk/src/javascript/event.cpp
+++ b/fpdfsdk/src/javascript/event.cpp
@@ -56,7 +56,7 @@ event::~event(void)
{
}
-bool event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << wChange;
}
- return true;
+ return TRUE;
}
-bool event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pEvent != NULL);
vp << pEvent->ChangeEx();
- return true;
+ return TRUE;
}
-bool event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
ASSERT(pEvent != NULL);
vp << pEvent->CommitKey();
- return true;
+ return TRUE;
}
-bool event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
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;
}
-bool event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
ASSERT(pEvent != NULL);
if (pEvent->KeyDown())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
-bool event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pEvent != NULL);
if (pEvent->Modifier())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
-bool event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp << pEvent->Name();
- return true;
+ return TRUE;
}
-bool event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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);
- bool &bRc = pEvent->Rc();
+ FX_BOOL &bRc = pEvent->Rc();
if (vp.IsSetting())
{
vp>>bRc;
@@ -180,12 +180,12 @@ bool event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp<<bRc;
}
- return true;
+ return TRUE;
}
-bool event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
if (vp.IsSetting())
{
}
@@ -193,12 +193,12 @@ bool event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
{
;
}
- return true;
+ return TRUE;
}
-bool event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
if (vp.IsSetting())
{
}
@@ -206,13 +206,13 @@ bool event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
;
}
- return true;
+ return TRUE;
}
-bool event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
if (vp.IsSetting())
{
}
@@ -220,10 +220,10 @@ bool event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
;
}
- return true;
+ return TRUE;
}
-bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
{
- return true;
+ return TRUE;
}
int &iSelEnd = pEvent->SelEnd();
@@ -244,10 +244,10 @@ bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << iSelEnd;
}
- return true;
+ return TRUE;
}
-bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
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 @@ bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
vp << iSelStart;
}
- return true;
+ return TRUE;
}
-bool event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
if (pEvent->Shift())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
-bool event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp << pEvent->Source()->GetJSObject();
- return true;
+ return TRUE;
}
-bool event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp<<pEvent->Target_Field()->GetJSObject();
- return true;
+ return TRUE;
}
-bool event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ASSERT(pEvent != NULL);
vp << pEvent->TargetName();
- return true;
+ return TRUE;
}
-bool event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp << pEvent->Type();
- return true;
+ return TRUE;
}
-bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
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 @@ bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << val;
}
- return true;
+ return TRUE;
}
-bool event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_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 @@ bool event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
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 98a3cd6cb5..6965c8c884 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);
-bool CJS_Global::InitInstance(IFXJS_Context* cc)
+FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -106,7 +106,7 @@ 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();
}
-bool global_alternate::QueryProperty(const FX_WCHAR* propname)
+FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname)
{
return CFX_WideString(propname) != L"setPersistent";
}
-bool global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError)
+FX_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;
}
-bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
@@ -158,34 +158,34 @@ bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, C
{
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 @@ bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, C
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;
}
-bool global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& pa
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()
}
-bool global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
+FX_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 @@ 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 @@ 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 @@ 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 820e7301d3..1478feb1fa 100644
--- a/fpdfsdk/src/javascript/report.cpp
+++ b/fpdfsdk/src/javascript/report.cpp
@@ -36,14 +36,14 @@ Report::~Report()
}
-bool Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 21a7cb83ff..4083ed58da 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;
}
-bool util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
c_strResult.erase(c_strResult.begin());
vRet = c_strResult.c_str();
- return true;
+ return TRUE;
}
-bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
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 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
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 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
if (bXFAPicture)
{
- return false; //currently, it doesn't support XFAPicture.
+ return FALSE; //currently, it doesn't support XFAPicture.
}
int iIndex;
@@ -355,9 +355,9 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
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;
}
-bool util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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 @@ bool util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
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
}
}
-bool util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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)
{
- bool bWrongFormat = false;
+ FX_BOOL bWrongFormat = FALSE;
dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat);
}
@@ -590,7 +590,7 @@ bool util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRe
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;
}
-bool util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_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;
}