summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cscript_hostpseudomodel.cpp')
-rw-r--r--xfa/fxfa/parser/cscript_hostpseudomodel.cpp75
1 files changed, 37 insertions, 38 deletions
diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
index 89230c34e9..6140ad37d8 100644
--- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
@@ -41,7 +41,7 @@ void CScript_HostPseudoModel::LoadString(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::AppType(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify)
@@ -54,7 +54,7 @@ void CScript_HostPseudoModel::AppType(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::CalculationsEnabled(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -70,7 +70,7 @@ void CScript_HostPseudoModel::CalculationsEnabled(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::CurrentPage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -85,7 +85,7 @@ void CScript_HostPseudoModel::CurrentPage(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Language(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -101,7 +101,7 @@ void CScript_HostPseudoModel::Language(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::NumPages(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -116,7 +116,7 @@ void CScript_HostPseudoModel::NumPages(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Platform(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -131,7 +131,7 @@ void CScript_HostPseudoModel::Platform(CFXJSE_Value* pValue,
pValue->SetString(FX_UTF8Encode(wsPlatform).AsStringC());
}
void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
@@ -151,7 +151,7 @@ void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::ValidationsEnabled(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -163,12 +163,12 @@ void CScript_HostPseudoModel::ValidationsEnabled(CFXJSE_Value* pValue,
pValue->ToBoolean());
return;
}
- FX_BOOL bEnabled = pNotify->GetDocEnvironment()->IsValidationsEnabled(hDoc);
+ bool bEnabled = pNotify->GetDocEnvironment()->IsValidationsEnabled(hDoc);
pValue->SetBoolean(bEnabled);
}
void CScript_HostPseudoModel::Variation(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!m_pDocument->GetScriptContext()->IsRunAtClient())
return;
@@ -184,7 +184,7 @@ void CScript_HostPseudoModel::Variation(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Version(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -198,7 +198,7 @@ void CScript_HostPseudoModel::Version(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Name(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -297,7 +297,7 @@ void CScript_HostPseudoModel::Response(CFXJSE_Arguments* pArguments) {
CFX_WideString wsQuestion;
CFX_WideString wsTitle;
CFX_WideString wsDefaultAnswer;
- FX_BOOL bMark = FALSE;
+ bool bMark = false;
if (iLength >= 1) {
CFX_ByteString bsQuestion = pArguments->GetUTF8String(0);
wsQuestion = CFX_WideString::FromUTF8(bsQuestion.AsStringC());
@@ -311,7 +311,7 @@ void CScript_HostPseudoModel::Response(CFXJSE_Arguments* pArguments) {
wsDefaultAnswer = CFX_WideString::FromUTF8(bsDefaultAnswer.AsStringC());
}
if (iLength >= 4) {
- bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE;
+ bMark = pArguments->GetInt32(3) == 0 ? false : true;
}
CFX_WideString wsAnswer = pNotify->GetAppProvider()->Response(
wsQuestion, wsTitle, wsDefaultAnswer, bMark);
@@ -513,29 +513,28 @@ void CScript_HostPseudoModel::MessageBox(CFXJSE_Arguments* pArguments) {
if (pValue)
pValue->SetInteger(iValue);
}
-FX_BOOL CScript_HostPseudoModel::ValidateArgsForMsg(
- CFXJSE_Arguments* pArguments,
- int32_t iArgIndex,
- CFX_WideString& wsValue) {
+bool CScript_HostPseudoModel::ValidateArgsForMsg(CFXJSE_Arguments* pArguments,
+ int32_t iArgIndex,
+ CFX_WideString& wsValue) {
if (!pArguments || iArgIndex < 0) {
- return FALSE;
+ return false;
}
- FX_BOOL bIsJsType = FALSE;
+ bool bIsJsType = false;
if (m_pDocument->GetScriptContext()->GetType() ==
XFA_SCRIPTLANGTYPE_Javascript) {
- bIsJsType = TRUE;
+ bIsJsType = true;
}
std::unique_ptr<CFXJSE_Value> pValueArg(pArguments->GetValue(iArgIndex));
if (!pValueArg->IsString() && bIsJsType) {
ThrowException(XFA_IDS_ARGUMENT_MISMATCH);
- return FALSE;
+ return false;
}
if (pValueArg->IsNull()) {
wsValue = FX_WSTRC(L"");
} else {
wsValue = pValueArg->ToWideString();
}
- return TRUE;
+ return true;
}
void CScript_HostPseudoModel::DocumentCountInBatch(
CFXJSE_Arguments* pArguments) {
@@ -557,9 +556,9 @@ void CScript_HostPseudoModel::Print(CFXJSE_Arguments* pArguments) {
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
uint32_t dwOptions = 0;
- FX_BOOL bShowDialog = TRUE;
+ bool bShowDialog = true;
if (iLength >= 1) {
- bShowDialog = pArguments->GetInt32(0) == 0 ? FALSE : TRUE;
+ bShowDialog = pArguments->GetInt32(0) == 0 ? false : true;
}
if (bShowDialog) {
dwOptions |= XFA_PRINTOPT_ShowDialog;
@@ -572,38 +571,38 @@ void CScript_HostPseudoModel::Print(CFXJSE_Arguments* pArguments) {
if (iLength >= 3) {
nEndPage = pArguments->GetInt32(2);
}
- FX_BOOL bCanCancel = TRUE;
+ bool bCanCancel = true;
if (iLength >= 4) {
- bCanCancel = pArguments->GetInt32(3) == 0 ? FALSE : TRUE;
+ bCanCancel = pArguments->GetInt32(3) == 0 ? false : true;
}
if (bCanCancel) {
dwOptions |= XFA_PRINTOPT_CanCancel;
}
- FX_BOOL bShrinkPage = TRUE;
+ bool bShrinkPage = true;
if (iLength >= 5) {
- bShrinkPage = pArguments->GetInt32(4) == 0 ? FALSE : TRUE;
+ bShrinkPage = pArguments->GetInt32(4) == 0 ? false : true;
}
if (bShrinkPage) {
dwOptions |= XFA_PRINTOPT_ShrinkPage;
}
- FX_BOOL bAsImage = TRUE;
+ bool bAsImage = true;
if (iLength >= 6) {
- bAsImage = pArguments->GetInt32(5) == 0 ? FALSE : TRUE;
+ bAsImage = pArguments->GetInt32(5) == 0 ? false : true;
}
if (bAsImage) {
dwOptions |= XFA_PRINTOPT_AsImage;
}
- FX_BOOL bReverseOrder = TRUE;
+ bool bReverseOrder = true;
if (iLength >= 7) {
- bAsImage = pArguments->GetInt32(5) == 0 ? FALSE : TRUE;
+ bAsImage = pArguments->GetInt32(5) == 0 ? false : true;
}
- bReverseOrder = pArguments->GetInt32(6) == 0 ? FALSE : TRUE;
+ bReverseOrder = pArguments->GetInt32(6) == 0 ? false : true;
if (bReverseOrder) {
dwOptions |= XFA_PRINTOPT_ReverseOrder;
}
- FX_BOOL bPrintAnnot = TRUE;
+ bool bPrintAnnot = true;
if (iLength >= 8) {
- bPrintAnnot = pArguments->GetInt32(7) == 0 ? FALSE : TRUE;
+ bPrintAnnot = pArguments->GetInt32(7) == 0 ? false : true;
}
if (bPrintAnnot) {
dwOptions |= XFA_PRINTOPT_PrintAnnot;
@@ -632,13 +631,13 @@ void CScript_HostPseudoModel::ExportData(CFXJSE_Arguments* pArguments) {
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
CFX_WideString wsFilePath;
- FX_BOOL bXDP = TRUE;
+ bool bXDP = true;
if (iLength >= 1) {
CFX_ByteString bsFilePath = pArguments->GetUTF8String(0);
wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsStringC());
}
if (iLength >= 2) {
- bXDP = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
+ bXDP = pArguments->GetInt32(1) == 0 ? false : true;
}
pNotify->GetDocEnvironment()->ExportData(hDoc, wsFilePath, bXDP);
}