diff options
Diffstat (limited to 'xfa/fxfa/parser')
88 files changed, 2275 insertions, 2334 deletions
diff --git a/xfa/fxfa/parser/cscript_datawindow.cpp b/xfa/fxfa/parser/cscript_datawindow.cpp index 50ed398ec0..c0354a112c 100644 --- a/xfa/fxfa/parser/cscript_datawindow.cpp +++ b/xfa/fxfa/parser/cscript_datawindow.cpp @@ -29,17 +29,17 @@ void CScript_DataWindow::GotoRecord(CFXJSE_Arguments* pArguments) {} void CScript_DataWindow::IsRecordGroup(CFXJSE_Arguments* pArguments) {} void CScript_DataWindow::RecordsBefore(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CScript_DataWindow::CurrentRecordNumber(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CScript_DataWindow::RecordsAfter(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CScript_DataWindow::IsDefined(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} diff --git a/xfa/fxfa/parser/cscript_datawindow.h b/xfa/fxfa/parser/cscript_datawindow.h index b2b35e9c59..e41b7fe17d 100644 --- a/xfa/fxfa/parser/cscript_datawindow.h +++ b/xfa/fxfa/parser/cscript_datawindow.h @@ -20,17 +20,15 @@ class CScript_DataWindow : public CXFA_Object { void GotoRecord(CFXJSE_Arguments* pArguments); void IsRecordGroup(CFXJSE_Arguments* pArguments); void RecordsBefore(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void CurrentRecordNumber(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void RecordsAfter(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); - void IsDefined(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); + void IsDefined(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); }; #endif // XFA_FXFA_PARSER_CSCRIPT_DATAWINDOW_H_ diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp index dd6142c47c..8a7d80b5d3 100644 --- a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp @@ -20,7 +20,7 @@ namespace { void StringProperty(CFXJSE_Value* pValue, CFX_WideString& wsValue, - FX_BOOL bSetting) { + bool bSetting) { if (bSetting) { wsValue = pValue->ToWideString(); return; @@ -28,7 +28,7 @@ void StringProperty(CFXJSE_Value* pValue, pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); } -void InterProperty(CFXJSE_Value* pValue, int32_t& iValue, FX_BOOL bSetting) { +void InterProperty(CFXJSE_Value* pValue, int32_t& iValue, bool bSetting) { if (bSetting) { iValue = pValue->ToInteger(); return; @@ -36,7 +36,7 @@ void InterProperty(CFXJSE_Value* pValue, int32_t& iValue, FX_BOOL bSetting) { pValue->SetInteger(iValue); } -void BooleanProperty(CFXJSE_Value* pValue, FX_BOOL& bValue, FX_BOOL bSetting) { +void BooleanProperty(CFXJSE_Value* pValue, bool& bValue, bool bSetting) { if (bSetting) { bValue = pValue->ToBoolean(); return; @@ -56,7 +56,7 @@ CScript_EventPseudoModel::~CScript_EventPseudoModel() {} void CScript_EventPseudoModel::Property(CFXJSE_Value* pValue, XFA_Event dwFlag, - FX_BOOL bSetting) { + bool bSetting) { CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) return; @@ -121,82 +121,82 @@ void CScript_EventPseudoModel::Property(CFXJSE_Value* pValue, } } void CScript_EventPseudoModel::Change(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::Change, bSetting); } void CScript_EventPseudoModel::CommitKey(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::CommitKey, bSetting); } void CScript_EventPseudoModel::FullText(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::FullText, bSetting); } void CScript_EventPseudoModel::KeyDown(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::Keydown, bSetting); } void CScript_EventPseudoModel::Modifier(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::Modifier, bSetting); } void CScript_EventPseudoModel::NewContentType(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::NewContentType, bSetting); } void CScript_EventPseudoModel::NewText(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::NewText, bSetting); } void CScript_EventPseudoModel::PrevContentType(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::PreviousContentType, bSetting); } void CScript_EventPseudoModel::PrevText(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::PreviousText, bSetting); } void CScript_EventPseudoModel::Reenter(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::Reenter, bSetting); } void CScript_EventPseudoModel::SelEnd(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::SelectionEnd, bSetting); } void CScript_EventPseudoModel::SelStart(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::SelectionStart, bSetting); } void CScript_EventPseudoModel::Shift(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::Shift, bSetting); } void CScript_EventPseudoModel::SoapFaultCode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::SoapFaultCode, bSetting); } void CScript_EventPseudoModel::SoapFaultString(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::SoapFaultString, bSetting); } void CScript_EventPseudoModel::Target(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Property(pValue, XFA_Event::Target, bSetting); } diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.h b/xfa/fxfa/parser/cscript_eventpseudomodel.h index c747ad2d19..6415287c8e 100644 --- a/xfa/fxfa/parser/cscript_eventpseudomodel.h +++ b/xfa/fxfa/parser/cscript_eventpseudomodel.h @@ -35,52 +35,36 @@ class CScript_EventPseudoModel : public CXFA_Object { explicit CScript_EventPseudoModel(CXFA_Document* pDocument); ~CScript_EventPseudoModel() override; - void Change(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); - void CommitKey(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void FullText(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void KeyDown(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void Modifier(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); + void Change(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void CommitKey(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void FullText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void KeyDown(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void Modifier(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void NewContentType(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); - void NewText(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); + void NewText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void PrevContentType(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); - void PrevText(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void Reenter(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void SelEnd(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); - void SelStart(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void Shift(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); + void PrevText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void Reenter(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void SelEnd(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void SelStart(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void Shift(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void SoapFaultCode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void SoapFaultString(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); - void Target(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); + void Target(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void Emit(CFXJSE_Arguments* pArguments); void Reset(CFXJSE_Arguments* pArguments); protected: - void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, FX_BOOL bSetting); + void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, bool bSetting); }; #endif // XFA_FXFA_PARSER_CSCRIPT_EVENTPSEUDOMODEL_H_ 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); } diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.h b/xfa/fxfa/parser/cscript_hostpseudomodel.h index c2183ac9d7..76c910b801 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.h +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.h @@ -16,35 +16,23 @@ class CScript_HostPseudoModel : public CXFA_Object { explicit CScript_HostPseudoModel(CXFA_Document* pDocument); ~CScript_HostPseudoModel() override; - void AppType(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); + void AppType(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void CalculationsEnabled(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void CurrentPage(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); - void Language(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void NumPages(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void Platform(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void Title(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); + void Language(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void NumPages(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void Platform(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void Title(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void ValidationsEnabled(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); - void Variation(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void Version(CFXJSE_Value* pValue, - FX_BOOL bSetting, - XFA_ATTRIBUTE eAttribute); - void Name(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); + void Variation(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void Version(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); + void Name(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void GotoURL(CFXJSE_Arguments* pArguments); void OpenList(CFXJSE_Arguments* pArguments); void Response(CFXJSE_Arguments* pArguments); @@ -66,9 +54,9 @@ class CScript_HostPseudoModel : public CXFA_Object { void LoadString(CFXJSE_Value* pValue, CXFA_FFNotify* pNotify, uint32_t dwFlag); - FX_BOOL ValidateArgsForMsg(CFXJSE_Arguments* pArguments, - int32_t iArgIndex, - CFX_WideString& wsValue); + bool ValidateArgsForMsg(CFXJSE_Arguments* pArguments, + int32_t iArgIndex, + CFX_WideString& wsValue); }; #endif // XFA_FXFA_PARSER_CSCRIPT_HOSTPSEUDOMODEL_H_ diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp index b6ee3672e6..a9c63666b3 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp @@ -32,7 +32,7 @@ CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument) CScript_LayoutPseudoModel::~CScript_LayoutPseudoModel() {} void CScript_LayoutPseudoModel::Ready(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { @@ -105,7 +105,7 @@ void CScript_LayoutPseudoModel::HWXY(CFXJSE_Arguments* pArguments, pValue->SetFloat(0); return; } - pLayoutItem->GetRect(rtRect, TRUE); + pLayoutItem->GetRect(rtRect, true); switch (layoutModel) { case XFA_LAYOUTMODEL_H: measure.Set(rtRect.height, XFA_UNIT_Pt); @@ -144,7 +144,7 @@ void CScript_LayoutPseudoModel::Y(CFXJSE_Arguments* pArguments) { } void CScript_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments, - FX_BOOL bNumbered) { + bool bNumbered) { CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; @@ -171,7 +171,7 @@ void CScript_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments, } void CScript_LayoutPseudoModel::PageCount(CFXJSE_Arguments* pArguments) { - NumberedPageCount(pArguments, TRUE); + NumberedPageCount(pArguments, true); } void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) { @@ -205,13 +205,13 @@ void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) { } void CScript_LayoutPseudoModel::Page(CFXJSE_Arguments* pArguments) { - PageImp(pArguments, FALSE); + PageImp(pArguments, false); } void CScript_LayoutPseudoModel::GetObjArray(CXFA_LayoutProcessor* pDocLayout, int32_t iPageNo, const CFX_WideString& wsType, - FX_BOOL bOnPageArea, + bool bOnPageArea, CXFA_NodeArray& retArray) { CXFA_ContainerLayoutItem* pLayoutPage = pDocLayout->GetPage(iPageNo); if (!pLayoutPage) { @@ -348,7 +348,7 @@ void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) { } int32_t iIndex = 0; CFX_WideString wsType; - FX_BOOL bOnPageArea = FALSE; + bool bOnPageArea = false; if (iLength >= 1) { iIndex = pArguments->GetInt32(0); } @@ -357,7 +357,7 @@ void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) { wsType = CFX_WideString::FromUTF8(bsType.AsStringC()); } if (iLength >= 3) { - bOnPageArea = pArguments->GetInt32(2) == 0 ? FALSE : TRUE; + bOnPageArea = pArguments->GetInt32(2) == 0 ? false : true; } CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { @@ -376,7 +376,7 @@ void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) { } void CScript_LayoutPseudoModel::AbsPageCount(CFXJSE_Arguments* pArguments) { - NumberedPageCount(pArguments, FALSE); + NumberedPageCount(pArguments, false); } void CScript_LayoutPseudoModel::AbsPageCountInBatch( @@ -402,7 +402,7 @@ void CScript_LayoutPseudoModel::Relayout(CFXJSE_Arguments* pArguments) { if (pContentRootNode) { pLayoutProcessor->AddChangedContainer(pContentRootNode); } - pLayoutProcessor->SetForceReLayout(TRUE); + pLayoutProcessor->SetForceReLayout(true); } void CScript_LayoutPseudoModel::AbsPageSpan(CFXJSE_Arguments* pArguments) { @@ -432,22 +432,22 @@ void CScript_LayoutPseudoModel::SheetInBatch(CFXJSE_Arguments* pArguments) { } void CScript_LayoutPseudoModel::Sheet(CFXJSE_Arguments* pArguments) { - PageImp(pArguments, TRUE); + PageImp(pArguments, true); } void CScript_LayoutPseudoModel::RelayoutPageArea(CFXJSE_Arguments* pArguments) { } void CScript_LayoutPseudoModel::SheetCount(CFXJSE_Arguments* pArguments) { - NumberedPageCount(pArguments, FALSE); + NumberedPageCount(pArguments, false); } void CScript_LayoutPseudoModel::AbsPage(CFXJSE_Arguments* pArguments) { - PageImp(pArguments, TRUE); + PageImp(pArguments, true); } void CScript_LayoutPseudoModel::PageImp(CFXJSE_Arguments* pArguments, - FX_BOOL bAbsPage) { + bool bAbsPage) { int32_t iLength = pArguments->GetLength(); if (iLength != 1) { const FX_WCHAR* methodName; diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.h b/xfa/fxfa/parser/cscript_layoutpseudomodel.h index d7661bcda9..ad64417bf3 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.h +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.h @@ -24,14 +24,14 @@ class CScript_LayoutPseudoModel : public CXFA_Object { explicit CScript_LayoutPseudoModel(CXFA_Document* pDocument); ~CScript_LayoutPseudoModel() override; - void Ready(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); + void Ready(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute); void HWXY(CFXJSE_Arguments* pArguments, XFA_LAYOUTMODEL_HWXY layoutModel); void H(CFXJSE_Arguments* pArguments); void W(CFXJSE_Arguments* pArguments); void X(CFXJSE_Arguments* pArguments); void Y(CFXJSE_Arguments* pArguments); - void NumberedPageCount(CFXJSE_Arguments* pArguments, FX_BOOL bNumbered); + void NumberedPageCount(CFXJSE_Arguments* pArguments, bool bNumbered); void PageCount(CFXJSE_Arguments* pArguments); void PageSpan(CFXJSE_Arguments* pArguments); void Page(CFXJSE_Arguments* pArguments); @@ -52,9 +52,9 @@ class CScript_LayoutPseudoModel : public CXFA_Object { void GetObjArray(CXFA_LayoutProcessor* pDocLayout, int32_t iPageNo, const CFX_WideString& wsType, - FX_BOOL bOnPageArea, + bool bOnPageArea, CXFA_NodeArray& retArray); - void PageImp(CFXJSE_Arguments* pArguments, FX_BOOL bAbsPage); + void PageImp(CFXJSE_Arguments* pArguments, bool bAbsPage); }; #endif // XFA_FXFA_PARSER_CSCRIPT_LAYOUTPSEUDOMODEL_H_ diff --git a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp index 5a484ab12c..391f3be381 100644 --- a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp @@ -44,7 +44,7 @@ void CScript_SignaturePseudoModel::Sign(CFXJSE_Arguments* pArguments) { CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetBoolean(FALSE); + pValue->SetBoolean(false); } void CScript_SignaturePseudoModel::Enumerate(CFXJSE_Arguments* pArguments) { @@ -64,5 +64,5 @@ void CScript_SignaturePseudoModel::Clear(CFXJSE_Arguments* pArguments) { CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetBoolean(FALSE); + pValue->SetBoolean(false); } diff --git a/xfa/fxfa/parser/cxfa_arraynodelist.cpp b/xfa/fxfa/parser/cxfa_arraynodelist.cpp index 06aab400f1..8c9040a121 100644 --- a/xfa/fxfa/parser/cxfa_arraynodelist.cpp +++ b/xfa/fxfa/parser/cxfa_arraynodelist.cpp @@ -21,13 +21,12 @@ int32_t CXFA_ArrayNodeList::GetLength() { return m_array.GetSize(); } -FX_BOOL CXFA_ArrayNodeList::Append(CXFA_Node* pNode) { +bool CXFA_ArrayNodeList::Append(CXFA_Node* pNode) { m_array.Add(pNode); - return TRUE; + return true; } -FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, - CXFA_Node* pBeforeNode) { +bool CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) { if (!pBeforeNode) { m_array.Add(pNewNode); } else { @@ -39,10 +38,10 @@ FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, } } } - return TRUE; + return true; } -FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) { +bool CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) { int32_t iSize = m_array.GetSize(); for (int32_t i = 0; i < iSize; ++i) { if (m_array[i] == pNode) { @@ -50,7 +49,7 @@ FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) { break; } } - return TRUE; + return true; } CXFA_Node* CXFA_ArrayNodeList::Item(int32_t iIndex) { diff --git a/xfa/fxfa/parser/cxfa_attachnodelist.cpp b/xfa/fxfa/parser/cxfa_attachnodelist.cpp index fb8d026698..c23b900af6 100644 --- a/xfa/fxfa/parser/cxfa_attachnodelist.cpp +++ b/xfa/fxfa/parser/cxfa_attachnodelist.cpp @@ -18,7 +18,7 @@ int32_t CXFA_AttachNodeList::GetLength() { m_pAttachNode->GetElementType() == XFA_Element::Subform); } -FX_BOOL CXFA_AttachNodeList::Append(CXFA_Node* pNode) { +bool CXFA_AttachNodeList::Append(CXFA_Node* pNode) { CXFA_Node* pParent = pNode->GetNodeItem(XFA_NODEITEM_Parent); if (pParent) { pParent->RemoveChild(pNode); @@ -26,8 +26,7 @@ FX_BOOL CXFA_AttachNodeList::Append(CXFA_Node* pNode) { return m_pAttachNode->InsertChild(pNode); } -FX_BOOL CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode, - CXFA_Node* pBeforeNode) { +bool CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) { CXFA_Node* pParent = pNewNode->GetNodeItem(XFA_NODEITEM_Parent); if (pParent) { pParent->RemoveChild(pNewNode); @@ -35,7 +34,7 @@ FX_BOOL CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode, return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); } -FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { +bool CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { return m_pAttachNode->RemoveChild(pNode); } diff --git a/xfa/fxfa/parser/cxfa_binditems.cpp b/xfa/fxfa/parser/cxfa_binditems.cpp index fa691fe38b..fdb4f0c376 100644 --- a/xfa/fxfa/parser/cxfa_binditems.cpp +++ b/xfa/fxfa/parser/cxfa_binditems.cpp @@ -22,6 +22,6 @@ void CXFA_BindItems::GetRef(CFX_WideStringC& wsRef) { m_pNode->TryCData(XFA_ATTRIBUTE_Ref, wsRef); } -FX_BOOL CXFA_BindItems::SetConnection(const CFX_WideString& wsConnection) { +bool CXFA_BindItems::SetConnection(const CFX_WideString& wsConnection) { return m_pNode->SetCData(XFA_ATTRIBUTE_Connection, wsConnection); } diff --git a/xfa/fxfa/parser/cxfa_binditems.h b/xfa/fxfa/parser/cxfa_binditems.h index cb47cf02f1..191941a3fb 100644 --- a/xfa/fxfa/parser/cxfa_binditems.h +++ b/xfa/fxfa/parser/cxfa_binditems.h @@ -19,7 +19,7 @@ class CXFA_BindItems : public CXFA_Data { void GetLabelRef(CFX_WideStringC& wsLabelRef); void GetValueRef(CFX_WideStringC& wsValueRef); void GetRef(CFX_WideStringC& wsRef); - FX_BOOL SetConnection(const CFX_WideString& wsConnection); + bool SetConnection(const CFX_WideString& wsConnection); }; #endif // XFA_FXFA_PARSER_CXFA_BINDITEMS_H_ diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp index 3204ab01db..9d9b4b47ad 100644 --- a/xfa/fxfa/parser/cxfa_box.cpp +++ b/xfa/fxfa/parser/cxfa_box.cpp @@ -14,7 +14,7 @@ namespace { void GetStrokesInternal(CXFA_Node* pNode, CXFA_StrokeArray& strokes, - FX_BOOL bNull) { + bool bNull) { strokes.RemoveAll(); if (!pNode) return; @@ -106,42 +106,42 @@ CXFA_Edge CXFA_Box::GetEdge(int32_t nIndex) const { } void CXFA_Box::GetStrokes(CXFA_StrokeArray& strokes) const { - GetStrokesInternal(m_pNode, strokes, FALSE); + GetStrokesInternal(m_pNode, strokes, false); } -FX_BOOL CXFA_Box::IsCircular() const { +bool CXFA_Box::IsCircular() const { if (!m_pNode) - return FALSE; + return false; return m_pNode->GetBoolean(XFA_ATTRIBUTE_Circular); } -FX_BOOL CXFA_Box::GetStartAngle(FX_FLOAT& fStartAngle) const { +bool CXFA_Box::GetStartAngle(FX_FLOAT& fStartAngle) const { fStartAngle = 0; if (!m_pNode) - return FALSE; + return false; CXFA_Measurement ms; - FX_BOOL bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_StartAngle, ms, FALSE); + bool bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_StartAngle, ms, false); if (bRet) fStartAngle = ms.GetValue(); return bRet; } -FX_BOOL CXFA_Box::GetSweepAngle(FX_FLOAT& fSweepAngle) const { +bool CXFA_Box::GetSweepAngle(FX_FLOAT& fSweepAngle) const { fSweepAngle = 360; if (!m_pNode) - return FALSE; + return false; CXFA_Measurement ms; - FX_BOOL bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_SweepAngle, ms, FALSE); + bool bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_SweepAngle, ms, false); if (bRet) fSweepAngle = ms.GetValue(); return bRet; } -CXFA_Fill CXFA_Box::GetFill(FX_BOOL bModified) const { +CXFA_Fill CXFA_Box::GetFill(bool bModified) const { if (!m_pNode) return CXFA_Fill(nullptr); @@ -154,12 +154,12 @@ CXFA_Margin CXFA_Box::GetMargin() const { : nullptr); } -int32_t CXFA_Box::Get3DStyle(FX_BOOL& bVisible, FX_FLOAT& fThickness) const { +int32_t CXFA_Box::Get3DStyle(bool& bVisible, FX_FLOAT& fThickness) const { if (IsArc()) return 0; CXFA_StrokeArray strokes; - GetStrokesInternal(m_pNode, strokes, TRUE); + GetStrokesInternal(m_pNode, strokes, true); CXFA_Stroke stroke(nullptr); int32_t iType = Style3D(strokes, stroke); if (iType) { diff --git a/xfa/fxfa/parser/cxfa_box.h b/xfa/fxfa/parser/cxfa_box.h index 5cf141271d..014155ceb7 100644 --- a/xfa/fxfa/parser/cxfa_box.h +++ b/xfa/fxfa/parser/cxfa_box.h @@ -29,24 +29,24 @@ class CXFA_Box : public CXFA_Data { int32_t CountEdges() const; CXFA_Edge GetEdge(int32_t nIndex = 0) const; void GetStrokes(CXFA_StrokeArray& strokes) const; - FX_BOOL IsCircular() const; - FX_BOOL GetStartAngle(FX_FLOAT& fStartAngle) const; + bool IsCircular() const; + bool GetStartAngle(FX_FLOAT& fStartAngle) const; FX_FLOAT GetStartAngle() const { FX_FLOAT fStartAngle; GetStartAngle(fStartAngle); return fStartAngle; } - FX_BOOL GetSweepAngle(FX_FLOAT& fSweepAngle) const; + bool GetSweepAngle(FX_FLOAT& fSweepAngle) const; FX_FLOAT GetSweepAngle() const { FX_FLOAT fSweepAngle; GetSweepAngle(fSweepAngle); return fSweepAngle; } - CXFA_Fill GetFill(FX_BOOL bModified = FALSE) const; + CXFA_Fill GetFill(bool bModified = false) const; CXFA_Margin GetMargin() const; - int32_t Get3DStyle(FX_BOOL& bVisible, FX_FLOAT& fThickness) const; + int32_t Get3DStyle(bool& bVisible, FX_FLOAT& fThickness) const; }; #endif // XFA_FXFA_PARSER_CXFA_BOX_H_ diff --git a/xfa/fxfa/parser/cxfa_calculate.cpp b/xfa/fxfa/parser/cxfa_calculate.cpp index 17379cb6c7..d7b1f71caa 100644 --- a/xfa/fxfa/parser/cxfa_calculate.cpp +++ b/xfa/fxfa/parser/cxfa_calculate.cpp @@ -13,7 +13,7 @@ CXFA_Calculate::CXFA_Calculate(CXFA_Node* pNode) : CXFA_Data(pNode) {} int32_t CXFA_Calculate::GetOverride() { XFA_ATTRIBUTEENUM eAtt = XFA_ATTRIBUTEENUM_Error; - m_pNode->TryEnum(XFA_ATTRIBUTE_Override, eAtt, FALSE); + m_pNode->TryEnum(XFA_ATTRIBUTE_Override, eAtt, false); return eAtt; } diff --git a/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp index 646f8a45e5..dd759b699a 100644 --- a/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp +++ b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp @@ -11,7 +11,7 @@ #include "xfa/fxfa/parser/cxfa_measurement.h" CXFA_ContainerLayoutItem::CXFA_ContainerLayoutItem(CXFA_Node* pNode) - : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(nullptr) {} + : CXFA_LayoutItem(pNode, false), m_pOldSubform(nullptr) {} CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const { return m_pFormNode->GetDocument()->GetLayoutProcessor(); diff --git a/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp b/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp index 7e9311fec9..a10a678279 100644 --- a/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp +++ b/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp @@ -7,7 +7,7 @@ #include "xfa/fxfa/parser/cxfa_contentlayoutitem.h" CXFA_ContentLayoutItem::CXFA_ContentLayoutItem(CXFA_Node* pNode) - : CXFA_LayoutItem(pNode, TRUE), + : CXFA_LayoutItem(pNode, true), m_pPrev(nullptr), m_pNext(nullptr), m_dwStatus(0) {} diff --git a/xfa/fxfa/parser/cxfa_data.cpp b/xfa/fxfa/parser/cxfa_data.cpp index 5f059a7dfe..19f85088b8 100644 --- a/xfa/fxfa/parser/cxfa_data.cpp +++ b/xfa/fxfa/parser/cxfa_data.cpp @@ -65,18 +65,18 @@ XFA_Element CXFA_Data::GetElementType() const { return m_pNode ? m_pNode->GetElementType() : XFA_Element::Unknown; } -FX_BOOL CXFA_Data::TryMeasure(XFA_ATTRIBUTE eAttr, - FX_FLOAT& fValue, - FX_BOOL bUseDefault) const { +bool CXFA_Data::TryMeasure(XFA_ATTRIBUTE eAttr, + FX_FLOAT& fValue, + bool bUseDefault) const { CXFA_Measurement ms; if (m_pNode->TryMeasure(eAttr, ms, bUseDefault)) { fValue = ms.ToUnit(XFA_UNIT_Pt); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_Data::SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue) { +bool CXFA_Data::SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue) { CXFA_Measurement ms(fValue, XFA_UNIT_Pt); return m_pNode->SetMeasure(eAttr, ms); } diff --git a/xfa/fxfa/parser/cxfa_data.h b/xfa/fxfa/parser/cxfa_data.h index 829c84cc9f..890486d5fa 100644 --- a/xfa/fxfa/parser/cxfa_data.h +++ b/xfa/fxfa/parser/cxfa_data.h @@ -24,10 +24,10 @@ class CXFA_Data { XFA_Element GetElementType() const; protected: - FX_BOOL TryMeasure(XFA_ATTRIBUTE eAttr, - FX_FLOAT& fValue, - FX_BOOL bUseDefault = FALSE) const; - FX_BOOL SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue); + bool TryMeasure(XFA_ATTRIBUTE eAttr, + FX_FLOAT& fValue, + bool bUseDefault = false) const; + bool SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue); CXFA_Node* m_pNode; }; diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index de2d08bbc2..ad9693f98f 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -76,11 +76,11 @@ CFX_WideString ExportEncodeContent(const CFX_WideStringC& str) { void SaveAttribute(CXFA_Node* pNode, XFA_ATTRIBUTE eName, const CFX_WideStringC& wsName, - FX_BOOL bProto, + bool bProto, CFX_WideString& wsOutput) { CFX_WideString wsValue; if ((!bProto && !pNode->HasAttribute((XFA_ATTRIBUTE)eName, bProto)) || - !pNode->GetAttribute((XFA_ATTRIBUTE)eName, wsValue, FALSE)) { + !pNode->GetAttribute((XFA_ATTRIBUTE)eName, wsValue, false)) { return; } wsValue = ExportEncodeAttribute(wsValue); @@ -91,8 +91,8 @@ void SaveAttribute(CXFA_Node* pNode, wsOutput += FX_WSTRC(L"\""); } -FX_BOOL AttributeSaveInDataModel(CXFA_Node* pNode, XFA_ATTRIBUTE eAttribute) { - FX_BOOL bSaveInDataModel = FALSE; +bool AttributeSaveInDataModel(CXFA_Node* pNode, XFA_ATTRIBUTE eAttribute) { + bool bSaveInDataModel = false; if (pNode->GetElementType() != XFA_Element::Image) return bSaveInDataModel; @@ -103,32 +103,32 @@ FX_BOOL AttributeSaveInDataModel(CXFA_Node* pNode, XFA_ATTRIBUTE eAttribute) { CXFA_Node* pFieldNode = pValueNode->GetNodeItem(XFA_NODEITEM_Parent); if (pFieldNode && pFieldNode->GetBindData() && eAttribute == XFA_ATTRIBUTE_Href) { - bSaveInDataModel = TRUE; + bSaveInDataModel = true; } return bSaveInDataModel; } -FX_BOOL ContentNodeNeedtoExport(CXFA_Node* pContentNode) { +bool ContentNodeNeedtoExport(CXFA_Node* pContentNode) { CFX_WideString wsContent; - if (!pContentNode->TryContent(wsContent, FALSE, FALSE)) - return FALSE; + if (!pContentNode->TryContent(wsContent, false, false)) + return false; ASSERT(pContentNode->IsContentNode()); CXFA_Node* pParentNode = pContentNode->GetNodeItem(XFA_NODEITEM_Parent); if (!pParentNode || pParentNode->GetElementType() != XFA_Element::Value) - return TRUE; + return true; CXFA_Node* pGrandParentNode = pParentNode->GetNodeItem(XFA_NODEITEM_Parent); if (!pGrandParentNode || !pGrandParentNode->IsContainerNode()) - return TRUE; + return true; if (pGrandParentNode->GetBindData()) - return FALSE; + return false; CXFA_WidgetData* pWidgetData = pGrandParentNode->GetWidgetData(); XFA_Element eUIType = pWidgetData->GetUIType(); if (eUIType == XFA_Element::PasswordEdit) - return FALSE; - return TRUE; + return false; + return true; } void RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot, @@ -151,7 +151,7 @@ void RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot, void RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_WideTextBuf& buf, - FX_BOOL bSaveXML) { + bool bSaveXML) { CFX_WideString wsAttrs; int32_t iAttrs = 0; const uint8_t* pAttrs = @@ -185,7 +185,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, break; CFX_WideString wsContentType; - pNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); + pNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false); if (pRawValueNode->GetElementType() == XFA_Element::SharpxHTML && wsContentType == FX_WSTRC(L"text/html")) { CFDE_XMLNode* pExDataXML = pNode->GetXMLMappingNode(); @@ -197,7 +197,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, if (!pRichTextXML) break; - IFX_MemoryStream* pMemStream = FX_CreateMemoryStream(TRUE); + IFX_MemoryStream* pMemStream = FX_CreateMemoryStream(true); IFX_Stream* pTempStream = IFX_Stream::CreateStream( (IFX_SeekableWriteStream*)pMemStream, FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | @@ -211,7 +211,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, } else if (pRawValueNode->GetElementType() == XFA_Element::Sharpxml && wsContentType == FX_WSTRC(L"text/xml")) { CFX_WideString wsRawValue; - pRawValueNode->GetAttribute(XFA_ATTRIBUTE_Value, wsRawValue, FALSE); + pRawValueNode->GetAttribute(XFA_ATTRIBUTE_Value, wsRawValue, false); if (wsRawValue.IsEmpty()) break; @@ -269,7 +269,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, if (!pTemplateNode || pTemplateNode->CountChildren(XFA_Element::Unknown) != pNode->CountChildren(XFA_Element::Unknown)) { - bSaveXML = TRUE; + bSaveXML = true; } } CFX_WideTextBuf newBuf; @@ -283,7 +283,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, if (!bSaveXML && !wsChildren.IsEmpty() && pNode->GetElementType() == XFA_Element::Items) { wsChildren.clear(); - bSaveXML = TRUE; + bSaveXML = true; CXFA_Node* pChild = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); while (pChild) { RegenerateFormFile_Changed(pChild, newBuf, bSaveXML); @@ -299,7 +299,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, pNode->HasAttribute(XFA_ATTRIBUTE_Name)) { CFX_WideStringC wsElement = pNode->GetClassName(); CFX_WideString wsName; - SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, wsName); + SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), true, wsName); buf << FX_WSTRC(L"<"); buf << wsElement; buf << wsName; @@ -318,7 +318,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, void RegenerateFormFile_Container(CXFA_Node* pNode, IFX_Stream* pStream, - FX_BOOL bSaveXML = FALSE) { + bool bSaveXML = false) { XFA_Element eType = pNode->GetElementType(); if (eType == XFA_Element::Field || eType == XFA_Element::Draw || !pNode->IsContainerNode()) { @@ -334,7 +334,7 @@ void RegenerateFormFile_Container(CXFA_Node* pNode, pStream->WriteString(L"<", 1); pStream->WriteString(wsElement.c_str(), wsElement.GetLength()); CFX_WideString wsOutput; - SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, wsOutput); + SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), true, wsOutput); CFX_WideString wsAttrs; int32_t iAttrs = 0; const uint8_t* pAttrs = @@ -346,7 +346,7 @@ void RegenerateFormFile_Container(CXFA_Node* pNode, continue; CFX_WideString wsAttr; - SaveAttribute(pNode, pAttr->eName, pAttr->pName, FALSE, wsAttr); + SaveAttribute(pNode, pAttr->eName, pAttr->pName, false, wsAttr); wsOutput += wsAttr; } @@ -373,7 +373,7 @@ void RegenerateFormFile_Container(CXFA_Node* pNode, void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, IFX_Stream* pStream, const FX_CHAR* pChecksum, - FX_BOOL bSaveXML) { + bool bSaveXML) { if (pNode->IsModelNode()) { static const FX_WCHAR s_pwsTagName[] = L"<form"; static const FX_WCHAR s_pwsClose[] = L"</form\n>"; @@ -444,34 +444,34 @@ CXFA_DataExporter::CXFA_DataExporter(CXFA_Document* pDocument) ASSERT(m_pDocument); } -FX_BOOL CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite) { +bool CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite) { return Export(pWrite, m_pDocument->GetRoot(), 0, nullptr); } -FX_BOOL CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite, - CXFA_Node* pNode, - uint32_t dwFlag, - const FX_CHAR* pChecksum) { +bool CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite, + CXFA_Node* pNode, + uint32_t dwFlag, + const FX_CHAR* pChecksum) { if (!pWrite) { ASSERT(false); - return FALSE; + return false; } IFX_Stream* pStream = IFX_Stream::CreateStream( pWrite, FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | FX_STREAMACCESS_Append); if (!pStream) - return FALSE; + return false; pStream->SetCodePage(FX_CODEPAGE_UTF8); - FX_BOOL bRet = Export(pStream, pNode, dwFlag, pChecksum); + bool bRet = Export(pStream, pNode, dwFlag, pChecksum); pStream->Release(); return bRet; } -FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, - CXFA_Node* pNode, - uint32_t dwFlag, - const FX_CHAR* pChecksum) { +bool CXFA_DataExporter::Export(IFX_Stream* pStream, + CXFA_Node* pNode, + uint32_t dwFlag, + const FX_CHAR* pChecksum) { CFDE_XMLDoc* pXMLDoc = m_pDocument->GetXMLDoc(); if (pNode->IsModelNode()) { switch (pNode->GetPacketID()) { @@ -491,7 +491,7 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pNode->GetXMLMappingNode()); if (!pElement || pElement->GetType() != FDE_XMLNODE_Element) - return FALSE; + return false; CXFA_Node* pDataNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); ASSERT(pDataNode); @@ -508,13 +508,13 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pNode->GetXMLMappingNode()); if (!pElement || pElement->GetType() != FDE_XMLNODE_Element) - return FALSE; + return false; pXMLDoc->SaveXMLNode(pStream, pElement); break; } } - return TRUE; + return true; } CXFA_Node* pDataNode = pNode->GetNodeItem(XFA_NODEITEM_Parent); @@ -530,12 +530,12 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pExportNode->GetXMLMappingNode()); if (!pElement || pElement->GetType() != FDE_XMLNODE_Element) - return FALSE; + return false; XFA_DataExporter_DealWithDataGroupNode(pExportNode); pElement->SetString(L"xmlns:xfa", L"http://www.xfa.org/schema/xfa-data/1.0/"); pXMLDoc->SaveXMLNode(pStream, pElement); pElement->RemoveAttribute(L"xmlns:xfa"); - return TRUE; + return true; } diff --git a/xfa/fxfa/parser/cxfa_dataexporter.h b/xfa/fxfa/parser/cxfa_dataexporter.h index c1123d1fe9..41f32a2fad 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.h +++ b/xfa/fxfa/parser/cxfa_dataexporter.h @@ -18,17 +18,17 @@ class CXFA_DataExporter { public: explicit CXFA_DataExporter(CXFA_Document* pDocument); - FX_BOOL Export(IFX_SeekableWriteStream* pWrite); - FX_BOOL Export(IFX_SeekableWriteStream* pWrite, - CXFA_Node* pNode, - uint32_t dwFlag, - const FX_CHAR* pChecksum); + bool Export(IFX_SeekableWriteStream* pWrite); + bool Export(IFX_SeekableWriteStream* pWrite, + CXFA_Node* pNode, + uint32_t dwFlag, + const FX_CHAR* pChecksum); protected: - FX_BOOL Export(IFX_Stream* pStream, - CXFA_Node* pNode, - uint32_t dwFlag, - const FX_CHAR* pChecksum); + bool Export(IFX_Stream* pStream, + CXFA_Node* pNode, + uint32_t dwFlag, + const FX_CHAR* pChecksum); CXFA_Document* const m_pDocument; }; diff --git a/xfa/fxfa/parser/cxfa_dataimporter.cpp b/xfa/fxfa/parser/cxfa_dataimporter.cpp index 62c6536393..c0c798dfe6 100644 --- a/xfa/fxfa/parser/cxfa_dataimporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataimporter.cpp @@ -21,24 +21,24 @@ CXFA_DataImporter::CXFA_DataImporter(CXFA_Document* pDocument) ASSERT(m_pDocument); } -FX_BOOL CXFA_DataImporter::ImportData(IFX_SeekableReadStream* pDataDocument) { +bool CXFA_DataImporter::ImportData(IFX_SeekableReadStream* pDataDocument) { std::unique_ptr<CXFA_SimpleParser> pDataDocumentParser( new CXFA_SimpleParser(m_pDocument, false)); if (pDataDocumentParser->StartParse(pDataDocument, XFA_XDPPACKET_Datasets) != XFA_PARSESTATUS_Ready) { - return FALSE; + return false; } if (pDataDocumentParser->DoParse(nullptr) < XFA_PARSESTATUS_Done) - return FALSE; + return false; CXFA_Node* pImportDataRoot = pDataDocumentParser->GetRootNode(); if (!pImportDataRoot) - return FALSE; + return false; CXFA_Node* pDataModel = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Datasets)); if (!pDataModel) - return FALSE; + return false; CXFA_Node* pDataNode = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Data)); if (pDataNode) @@ -57,6 +57,6 @@ FX_BOOL CXFA_DataImporter::ImportData(IFX_SeekableReadStream* pDataDocument) { pParentXMLNode->RemoveChildNode(pXMLNode); pDataModel->InsertChild(pImportDataRoot); } - m_pDocument->DoDataRemerge(FALSE); - return TRUE; + m_pDocument->DoDataRemerge(false); + return true; } diff --git a/xfa/fxfa/parser/cxfa_dataimporter.h b/xfa/fxfa/parser/cxfa_dataimporter.h index d01f24cb05..86e41a8130 100644 --- a/xfa/fxfa/parser/cxfa_dataimporter.h +++ b/xfa/fxfa/parser/cxfa_dataimporter.h @@ -16,7 +16,7 @@ class CXFA_DataImporter { public: explicit CXFA_DataImporter(CXFA_Document* pDocument); - FX_BOOL ImportData(IFX_SeekableReadStream* pDataDocument); + bool ImportData(IFX_SeekableReadStream* pDataDocument); protected: CXFA_Document* const m_pDocument; diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index a644c6a92e..cc5f74ae23 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -50,7 +50,7 @@ void MergeNodeRecurse(CXFA_Document* pDocument, } return; } - CXFA_Node* pNewNode = pProtoNode->Clone(TRUE); + CXFA_Node* pNewNode = pProtoNode->Clone(true); pNewNode->SetTemplateNode(pProtoNode); pDestNodeParent->InsertChild(pNewNode, nullptr); } @@ -234,7 +234,7 @@ void CXFA_Document::AddPurgeNode(CXFA_Node* pNode) { m_PurgeNodes.insert(pNode); } -FX_BOOL CXFA_Document::RemovePurgeNode(CXFA_Node* pNode) { +bool CXFA_Document::RemovePurgeNode(CXFA_Node* pNode) { return !!m_PurgeNodes.erase(pNode); } @@ -245,29 +245,29 @@ void CXFA_Document::PurgeNodes() { m_PurgeNodes.clear(); } -void CXFA_Document::SetFlag(uint32_t dwFlag, FX_BOOL bOn) { +void CXFA_Document::SetFlag(uint32_t dwFlag, bool bOn) { if (bOn) m_dwDocFlags |= dwFlag; else m_dwDocFlags &= ~dwFlag; } -FX_BOOL CXFA_Document::IsInteractive() { +bool CXFA_Document::IsInteractive() { if (m_dwDocFlags & XFA_DOCFLAG_HasInteractive) return !!(m_dwDocFlags & XFA_DOCFLAG_Interactive); CXFA_Node* pConfig = ToNode(GetXFAObject(XFA_HASHCODE_Config)); if (!pConfig) - return FALSE; + return false; CFX_WideString wsInteractive; CXFA_Node* pPresent = pConfig->GetFirstChildByClass(XFA_Element::Present); if (!pPresent) - return FALSE; + return false; CXFA_Node* pPDF = pPresent->GetFirstChildByClass(XFA_Element::Pdf); if (!pPDF) - return FALSE; + return false; CXFA_Node* pFormFiller = pPDF->GetChild(0, XFA_Element::Interactive); if (pFormFiller) { @@ -275,10 +275,10 @@ FX_BOOL CXFA_Document::IsInteractive() { if (pFormFiller->TryContent(wsInteractive) && wsInteractive == FX_WSTRC(L"1")) { m_dwDocFlags |= XFA_DOCFLAG_Interactive; - return TRUE; + return true; } } - return FALSE; + return false; } CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() { diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h index 919be5da2d..4fd2d79504 100644 --- a/xfa/fxfa/parser/cxfa_document.h +++ b/xfa/fxfa/parser/cxfa_document.h @@ -75,13 +75,13 @@ class CXFA_Document { void SetRoot(CXFA_Node* pNewRoot); void AddPurgeNode(CXFA_Node* pNode); - FX_BOOL RemovePurgeNode(CXFA_Node* pNode); + bool RemovePurgeNode(CXFA_Node* pNode); void PurgeNodes(); bool HasFlag(uint32_t dwFlag) { return (m_dwDocFlags & dwFlag) == dwFlag; } - void SetFlag(uint32_t dwFlag, FX_BOOL bOn); + void SetFlag(uint32_t dwFlag, bool bOn); - FX_BOOL IsInteractive(); + bool IsInteractive(); XFA_VERSION GetCurVersionMode() { return m_eCurVersionMode; } XFA_VERSION RecognizeXFAVersionNumber(CFX_WideString& wsTemplateNS); @@ -90,13 +90,13 @@ class CXFA_Document { void DoProtoMerge(); void DoDataMerge(); - void DoDataRemerge(FX_BOOL bDoDataMerge); + void DoDataRemerge(bool bDoDataMerge); CXFA_Node* DataMerge_CopyContainer(CXFA_Node* pTemplateNode, CXFA_Node* pFormNode, CXFA_Node* pDataScope, - FX_BOOL bOneInstance, - FX_BOOL bDataMerge, - FX_BOOL bUpLevel); + bool bOneInstance, + bool bDataMerge, + bool bUpLevel); void DataMerge_UpdateBindingRelations(CXFA_Node* pFormUpdateRoot); void ClearLayoutData(); diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index ea38b3eec9..fe3cb933aa 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -10,7 +10,7 @@ #include "xfa/fxfa/parser/cxfa_document.h" CXFA_DocumentParser::CXFA_DocumentParser(CXFA_FFNotify* pNotify) - : m_nodeParser(nullptr, TRUE), m_pNotify(pNotify) {} + : m_nodeParser(nullptr, true), m_pNotify(pNotify) {} CXFA_DocumentParser::~CXFA_DocumentParser() { } diff --git a/xfa/fxfa/parser/cxfa_exdata.cpp b/xfa/fxfa/parser/cxfa_exdata.cpp index 358cc3d611..bf1e930330 100644 --- a/xfa/fxfa/parser/cxfa_exdata.cpp +++ b/xfa/fxfa/parser/cxfa_exdata.cpp @@ -10,6 +10,6 @@ CXFA_ExData::CXFA_ExData(CXFA_Node* pNode) : CXFA_Data(pNode) {} -FX_BOOL CXFA_ExData::SetContentType(const CFX_WideString& wsContentType) { +bool CXFA_ExData::SetContentType(const CFX_WideString& wsContentType) { return m_pNode->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); } diff --git a/xfa/fxfa/parser/cxfa_exdata.h b/xfa/fxfa/parser/cxfa_exdata.h index c5eddbf14c..c92bacd3f2 100644 --- a/xfa/fxfa/parser/cxfa_exdata.h +++ b/xfa/fxfa/parser/cxfa_exdata.h @@ -16,7 +16,7 @@ class CXFA_ExData : public CXFA_Data { public: explicit CXFA_ExData(CXFA_Node* pNode); - FX_BOOL SetContentType(const CFX_WideString& wsContentType); + bool SetContentType(const CFX_WideString& wsContentType); }; #endif // XFA_FXFA_PARSER_CXFA_EXDATA_H_ diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp index 0c4a6f547d..63949c193d 100644 --- a/xfa/fxfa/parser/cxfa_fill.cpp +++ b/xfa/fxfa/parser/cxfa_fill.cpp @@ -25,10 +25,10 @@ void CXFA_Fill::SetColor(FX_ARGB color) { pNode->SetCData(XFA_ATTRIBUTE_Value, wsColor); } -FX_ARGB CXFA_Fill::GetColor(FX_BOOL bText) { +FX_ARGB CXFA_Fill::GetColor(bool bText) { if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Color)) { CFX_WideStringC wsColor; - if (pNode->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE)) + if (pNode->TryCData(XFA_ATTRIBUTE_Value, wsColor, false)) return CXFA_Data::ToColor(wsColor); } if (bText) @@ -52,7 +52,7 @@ int32_t CXFA_Fill::GetPattern(FX_ARGB& foreColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Pattern); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { CFX_WideStringC wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE); + pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); foreColor = CXFA_Data::ToColor(wsColor); } else { foreColor = 0xFF000000; @@ -66,7 +66,7 @@ int32_t CXFA_Fill::GetStipple(FX_ARGB& stippleColor) { pNode->TryInteger(XFA_ATTRIBUTE_Rate, eAttr); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { CFX_WideStringC wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE); + pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); stippleColor = CXFA_Data::ToColor(wsColor); } else { stippleColor = 0xFF000000; @@ -80,7 +80,7 @@ int32_t CXFA_Fill::GetLinear(FX_ARGB& endColor) { pNode->TryEnum(XFA_ATTRIBUTE_Type, eAttr); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { CFX_WideStringC wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE); + pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); endColor = CXFA_Data::ToColor(wsColor); } else { endColor = 0xFF000000; @@ -94,7 +94,7 @@ int32_t CXFA_Fill::GetRadial(FX_ARGB& endColor) { pNode->TryEnum(XFA_ATTRIBUTE_Type, eAttr); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { CFX_WideStringC wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE); + pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); endColor = CXFA_Data::ToColor(wsColor); } else { endColor = 0xFF000000; diff --git a/xfa/fxfa/parser/cxfa_fill.h b/xfa/fxfa/parser/cxfa_fill.h index 2a5f673aa0..4b13565765 100644 --- a/xfa/fxfa/parser/cxfa_fill.h +++ b/xfa/fxfa/parser/cxfa_fill.h @@ -19,7 +19,7 @@ class CXFA_Fill : public CXFA_Data { ~CXFA_Fill(); int32_t GetPresence(); - FX_ARGB GetColor(FX_BOOL bText = FALSE); + FX_ARGB GetColor(bool bText = false); XFA_Element GetFillType(); int32_t GetPattern(FX_ARGB& foreColor); int32_t GetStipple(FX_ARGB& stippleColor); diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp index 2dcb405141..cedfda6294 100644 --- a/xfa/fxfa/parser/cxfa_font.cpp +++ b/xfa/fxfa/parser/cxfa_font.cpp @@ -70,13 +70,13 @@ void CXFA_Font::GetTypeface(CFX_WideStringC& wsTypeFace) { m_pNode->TryCData(XFA_ATTRIBUTE_Typeface, wsTypeFace); } -FX_BOOL CXFA_Font::IsBold() { +bool CXFA_Font::IsBold() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Normal; m_pNode->TryEnum(XFA_ATTRIBUTE_Weight, eAttr); return eAttr == XFA_ATTRIBUTEENUM_Bold; } -FX_BOOL CXFA_Font::IsItalic() { +bool CXFA_Font::IsItalic() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Normal; m_pNode->TryEnum(XFA_ATTRIBUTE_Posture, eAttr); return eAttr == XFA_ATTRIBUTEENUM_Italic; @@ -89,5 +89,5 @@ void CXFA_Font::SetColor(FX_ARGB color) { FX_ARGB CXFA_Font::GetColor() { CXFA_Fill fill(m_pNode->GetChild(0, XFA_Element::Fill)); - return fill ? fill.GetColor(TRUE) : 0xFF000000; + return fill ? fill.GetColor(true) : 0xFF000000; } diff --git a/xfa/fxfa/parser/cxfa_font.h b/xfa/fxfa/parser/cxfa_font.h index 0151dfbe5f..0342f68b27 100644 --- a/xfa/fxfa/parser/cxfa_font.h +++ b/xfa/fxfa/parser/cxfa_font.h @@ -26,8 +26,8 @@ class CXFA_Font : public CXFA_Data { FX_FLOAT GetFontSize(); void GetTypeface(CFX_WideStringC& wsTypeFace); - FX_BOOL IsBold(); - FX_BOOL IsItalic(); + bool IsBold(); + bool IsItalic(); FX_ARGB GetColor(); void SetColor(FX_ARGB color); diff --git a/xfa/fxfa/parser/cxfa_image.cpp b/xfa/fxfa/parser/cxfa_image.cpp index bcc7466dce..8061018470 100644 --- a/xfa/fxfa/parser/cxfa_image.cpp +++ b/xfa/fxfa/parser/cxfa_image.cpp @@ -8,18 +8,18 @@ #include "xfa/fxfa/parser/xfa_object.h" -CXFA_Image::CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue) +CXFA_Image::CXFA_Image(CXFA_Node* pNode, bool bDefValue) : CXFA_Data(pNode), m_bDefValue(bDefValue) {} int32_t CXFA_Image::GetAspect() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Aspect); } -FX_BOOL CXFA_Image::GetContentType(CFX_WideString& wsContentType) { +bool CXFA_Image::GetContentType(CFX_WideString& wsContentType) { return m_pNode->TryCData(XFA_ATTRIBUTE_ContentType, wsContentType); } -FX_BOOL CXFA_Image::GetHref(CFX_WideString& wsHref) { +bool CXFA_Image::GetHref(CFX_WideString& wsHref) { if (m_bDefValue) return m_pNode->TryCData(XFA_ATTRIBUTE_Href, wsHref); return m_pNode->GetAttribute(FX_WSTRC(L"href"), wsHref); @@ -31,24 +31,24 @@ int32_t CXFA_Image::GetTransferEncoding() { return XFA_ATTRIBUTEENUM_Base64; } -FX_BOOL CXFA_Image::GetContent(CFX_WideString& wsText) { +bool CXFA_Image::GetContent(CFX_WideString& wsText) { return m_pNode->TryContent(wsText); } -FX_BOOL CXFA_Image::SetContentType(const CFX_WideString& wsContentType) { +bool CXFA_Image::SetContentType(const CFX_WideString& wsContentType) { return m_pNode->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); } -FX_BOOL CXFA_Image::SetHref(const CFX_WideString& wsHref) { +bool CXFA_Image::SetHref(const CFX_WideString& wsHref) { if (m_bDefValue) return m_pNode->SetCData(XFA_ATTRIBUTE_Href, wsHref); return m_pNode->SetAttribute(XFA_ATTRIBUTE_Href, wsHref.AsStringC()); } -FX_BOOL CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding) { +bool CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding) { if (m_bDefValue) { return m_pNode->SetEnum(XFA_ATTRIBUTE_TransferEncoding, (XFA_ATTRIBUTEENUM)iTransferEncoding); } - return TRUE; + return true; } diff --git a/xfa/fxfa/parser/cxfa_image.h b/xfa/fxfa/parser/cxfa_image.h index 4b088c8f90..bf69897693 100644 --- a/xfa/fxfa/parser/cxfa_image.h +++ b/xfa/fxfa/parser/cxfa_image.h @@ -15,19 +15,19 @@ class CXFA_Node; class CXFA_Image : public CXFA_Data { public: - CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue); + CXFA_Image(CXFA_Node* pNode, bool bDefValue); int32_t GetAspect(); - FX_BOOL GetContentType(CFX_WideString& wsContentType); - FX_BOOL GetHref(CFX_WideString& wsHref); + bool GetContentType(CFX_WideString& wsContentType); + bool GetHref(CFX_WideString& wsHref); int32_t GetTransferEncoding(); - FX_BOOL GetContent(CFX_WideString& wsText); - FX_BOOL SetContentType(const CFX_WideString& wsContentType); - FX_BOOL SetHref(const CFX_WideString& wsHref); - FX_BOOL SetTransferEncoding(int32_t iTransferEncoding); + bool GetContent(CFX_WideString& wsText); + bool SetContentType(const CFX_WideString& wsContentType); + bool SetHref(const CFX_WideString& wsHref); + bool SetTransferEncoding(int32_t iTransferEncoding); protected: - FX_BOOL m_bDefValue; + bool m_bDefValue; }; #endif // XFA_FXFA_PARSER_CXFA_IMAGE_H_ diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp index ebe33b650f..264fe4e1b6 100644 --- a/xfa/fxfa/parser/cxfa_layoutitem.cpp +++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp @@ -32,7 +32,7 @@ void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) { delete pLayoutItem; } -CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem) +CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, bool bIsContentLayoutItem) : m_pFormNode(pNode), m_pParent(nullptr), m_pNextSibling(nullptr), diff --git a/xfa/fxfa/parser/cxfa_layoutitem.h b/xfa/fxfa/parser/cxfa_layoutitem.h index bacb2b8682..5991cd6f3e 100644 --- a/xfa/fxfa/parser/cxfa_layoutitem.h +++ b/xfa/fxfa/parser/cxfa_layoutitem.h @@ -19,14 +19,14 @@ class CXFA_LayoutItem { public: virtual ~CXFA_LayoutItem(); - FX_BOOL IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; } - FX_BOOL IsContentLayoutItem() const { return m_bIsContentLayoutItem; } + bool IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; } + bool IsContentLayoutItem() const { return m_bIsContentLayoutItem; } CXFA_ContainerLayoutItem* AsContainerLayoutItem(); CXFA_ContentLayoutItem* AsContentLayoutItem(); CXFA_ContainerLayoutItem* GetPage() const; CXFA_Node* GetFormNode() const; - void GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative = FALSE) const; + void GetRect(CFX_RectF& rtLayout, bool bRelative = false) const; int32_t GetIndex() const; int32_t GetCount() const; CXFA_LayoutItem* GetParent() const; @@ -48,9 +48,9 @@ class CXFA_LayoutItem { CXFA_LayoutItem* m_pFirstChild; protected: - CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem); + CXFA_LayoutItem(CXFA_Node* pNode, bool bIsContentLayoutItem); - FX_BOOL m_bIsContentLayoutItem; + bool m_bIsContentLayoutItem; }; #endif // XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp index 48a9c78ffe..1be6d27129 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp @@ -85,9 +85,9 @@ void SyncContainer(CXFA_FFNotify* pNotify, CXFA_LayoutProcessor* pDocLayout, CXFA_LayoutItem* pContainerItem, uint32_t dwRelevant, - FX_BOOL bVisible, + bool bVisible, int32_t nPageIndex) { - FX_BOOL bVisibleItem = FALSE; + bool bVisibleItem = false; uint32_t dwStatus = 0; uint32_t dwRelevantContainer = 0; if (bVisible) { @@ -95,7 +95,7 @@ void SyncContainer(CXFA_FFNotify* pNotify, pContainerItem->m_pFormNode->GetEnum(XFA_ATTRIBUTE_Presence); if (eAttributeValue == XFA_ATTRIBUTEENUM_Visible || eAttributeValue == XFA_ATTRIBUTEENUM_Unknown) { - bVisibleItem = TRUE; + bVisibleItem = true; } dwRelevantContainer = GetRelevant(pContainerItem->m_pFormNode, dwRelevant); dwStatus = @@ -131,7 +131,7 @@ void RemoveLayoutItem(CXFA_ContainerLayoutItem* pLayoutItem) { } CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot, - FX_BOOL bNewExprStyle, + bool bNewExprStyle, CFX_WideStringC& wsTargetExpr) { CXFA_Document* pDocument = pPageSetRoot->GetDocument(); if (wsTargetExpr.IsEmpty()) @@ -141,7 +141,7 @@ CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot, wsTargetAll.TrimLeft(); wsTargetAll.TrimRight(); int32_t iSpliteIndex = 0; - FX_BOOL bTargetAllFind = TRUE; + bool bTargetAllFind = true; while (iSpliteIndex != -1) { CFX_WideString wsExpr; int32_t iSpliteNextIndex = 0; @@ -154,7 +154,7 @@ CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot, if (wsExpr.IsEmpty()) return nullptr; - bTargetAllFind = FALSE; + bTargetAllFind = false; if (wsExpr.GetAt(0) == '#') { CXFA_Node* pNode = pDocument->GetNodeByID( ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Template)), @@ -186,7 +186,7 @@ void SetLayoutGeneratedNodeFlag(CXFA_Node* pNode) { pNode->ClearFlag(XFA_NodeFlag_UnusedNode); } -FX_BOOL CheckContentAreaNotUsed( +bool CheckContentAreaNotUsed( CXFA_ContainerLayoutItem* pPageAreaLayoutItem, CXFA_Node* pContentArea, CXFA_ContainerLayoutItem*& pContentAreaLayoutItem) { @@ -198,12 +198,12 @@ FX_BOOL CheckContentAreaNotUsed( if (pLayoutItem->m_pFormNode == pContentArea) { if (!pLayoutItem->m_pFirstChild) { pContentAreaLayoutItem = pLayoutItem; - return TRUE; + return true; } - return FALSE; + return false; } } - return TRUE; + return true; } void SyncRemoveLayoutItem(CXFA_LayoutItem* pParentLayoutItem, @@ -248,7 +248,7 @@ CXFA_LayoutPageMgr::CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor) m_nAvailPages(0), m_nCurPageCount(0), m_ePageSetMode(XFA_ATTRIBUTEENUM_OrderedOccurrence), - m_bCreateOverFlowPage(FALSE) {} + m_bCreateOverFlowPage(false) {} CXFA_LayoutPageMgr::~CXFA_LayoutPageMgr() { ClearData(); @@ -260,11 +260,11 @@ CXFA_LayoutPageMgr::~CXFA_LayoutPageMgr() { } } -FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { +bool CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { PrepareLayout(); CXFA_Node* pTemplateNode = pFormNode->GetTemplateNode(); if (!pTemplateNode) - return FALSE; + return false; m_pTemplatePageSetRoot = pTemplateNode->GetProperty(0, XFA_Element::PageSet); ASSERT(m_pTemplatePageSetRoot); @@ -294,11 +294,11 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { if (pPageArea->GetElementType() == XFA_Element::PageArea) { iCount++; if (pPageArea->GetFirstChildByClass(XFA_Element::ContentArea)) - return TRUE; + return true; } } if (iCount > 0) - return FALSE; + return false; CXFA_Document* pDocument = pTemplateNode->GetDocument(); pPageArea = m_pTemplatePageSetRoot->GetChild(0, XFA_Element::PageArea); @@ -306,7 +306,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { pPageArea = pDocument->CreateNode(m_pTemplatePageSetRoot->GetPacketID(), XFA_Element::PageArea); if (!pPageArea) - return FALSE; + return false; m_pTemplatePageSetRoot->InsertChild(pPageArea, nullptr); pPageArea->SetFlag(XFA_NodeFlag_Initialized, true); @@ -316,7 +316,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { pContentArea = pDocument->CreateNode(pPageArea->GetPacketID(), XFA_Element::ContentArea); if (!pContentArea) - return FALSE; + return false; pPageArea->InsertChild(pContentArea, nullptr); pContentArea->SetFlag(XFA_NodeFlag_Initialized, true); @@ -334,7 +334,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { pMedium = pDocument->CreateNode(pPageArea->GetPacketID(), XFA_Element::Medium); if (!pContentArea) - return FALSE; + return false; pPageArea->InsertChild(pMedium, nullptr); pMedium->SetFlag(XFA_NodeFlag_Initialized, true); @@ -343,11 +343,11 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { pMedium->SetMeasure(XFA_ATTRIBUTE_Long, CXFA_Measurement(11.0f, XFA_UNIT_In)); } - return TRUE; + return true; } -FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { - FX_BOOL bProBreakBefore = FALSE; +bool CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { + bool bProBreakBefore = false; CXFA_Node* pBreakBeforeNode = nullptr; while (pRootSubform) { for (CXFA_Node* pBreakNode = @@ -359,7 +359,7 @@ FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { (eType == XFA_Element::Break && pBreakNode->GetEnum(XFA_ATTRIBUTE_Before) != XFA_ATTRIBUTEENUM_Auto)) { - bProBreakBefore = TRUE; + bProBreakBefore = true; pBreakBeforeNode = pBreakNode; break; } @@ -367,7 +367,7 @@ FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { if (bProBreakBefore) break; - bProBreakBefore = TRUE; + bProBreakBefore = true; pRootSubform = pRootSubform->GetFirstChildByClass(XFA_Element::Subform); while (pRootSubform && !XFA_ItemLayoutProcessor_IsTakingSpace(pRootSubform)) { @@ -377,21 +377,21 @@ FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { } CXFA_Node *pLeader, *pTrailer; if (pBreakBeforeNode && - ExecuteBreakBeforeOrAfter(pBreakBeforeNode, TRUE, pLeader, pTrailer)) { + ExecuteBreakBeforeOrAfter(pBreakBeforeNode, true, pLeader, pTrailer)) { m_pCurrentContainerRecord = m_rgProposedContainerRecord.GetHeadPosition(); - return TRUE; + return true; } - return AppendNewPage(TRUE); + return AppendNewPage(true); } -FX_BOOL CXFA_LayoutPageMgr::AppendNewPage(FX_BOOL bFirstTemPage) { +bool CXFA_LayoutPageMgr::AppendNewPage(bool bFirstTemPage) { if (m_pCurrentContainerRecord != m_rgProposedContainerRecord.GetTailPosition()) { - return TRUE; + return true; } CXFA_Node* pPageNode = GetNextAvailPageArea(nullptr); if (!pPageNode) - return FALSE; + return false; if (bFirstTemPage && !m_pCurrentContainerRecord) m_pCurrentContainerRecord = m_rgProposedContainerRecord.GetHeadPosition(); return !bFirstTemPage || m_pCurrentContainerRecord; @@ -439,7 +439,7 @@ void CXFA_LayoutPageMgr::SubmitContentItem( XFA_ItemLayoutProcessorResult eStatus) { if (pContentLayoutItem) { GetCurrentContainerRecord()->pCurContentArea->AddChild(pContentLayoutItem); - m_bCreateOverFlowPage = FALSE; + m_bCreateOverFlowPage = false; } if (eStatus != XFA_ItemLayoutProcessorResult_Done) { @@ -470,11 +470,11 @@ FX_FLOAT CXFA_LayoutPageMgr::GetAvailHeight() { return XFA_LAYOUT_FLOAT_MAX; } -FX_BOOL XFA_LayoutPageMgr_RunBreakTestScript(CXFA_Node* pTestScript) { +bool XFA_LayoutPageMgr_RunBreakTestScript(CXFA_Node* pTestScript) { CFX_WideString wsExpression; pTestScript->TryContent(wsExpression); if (wsExpression.IsEmpty()) - return TRUE; + return true; return pTestScript->GetDocument()->GetNotify()->RunScript( pTestScript, pTestScript->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode)); @@ -482,7 +482,7 @@ FX_BOOL XFA_LayoutPageMgr_RunBreakTestScript(CXFA_Node* pTestScript) { CXFA_ContainerRecord* CXFA_LayoutPageMgr::CreateContainerRecord( CXFA_Node* pPageNode, - FX_BOOL bCreateNew) { + bool bCreateNew) { CXFA_ContainerRecord* pNewRecord = new CXFA_ContainerRecord(); if (m_pCurrentContainerRecord) { if (!IsPageSetRootOrderedOccurrence() || !pPageNode) { @@ -622,12 +622,12 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { if (!FindPageAreaFromPageSet_SimplexDuplex( pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr, - TRUE, TRUE, nPageAreaCount == 1 ? XFA_ATTRIBUTEENUM_Only + true, true, nPageAreaCount == 1 ? XFA_ATTRIBUTEENUM_Only : XFA_ATTRIBUTEENUM_Last) && (nPageAreaCount == 1 && !FindPageAreaFromPageSet_SimplexDuplex( pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr, - TRUE, TRUE, XFA_ATTRIBUTEENUM_Last))) { + true, true, XFA_ATTRIBUTEENUM_Last))) { break; } CXFA_Node* pNode = m_pCurPageArea; @@ -647,7 +647,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { break; } } - FX_BOOL bUsable = TRUE; + bool bUsable = true; CFX_ArrayTemplate<FX_FLOAT> rgUsedHeights; for (CXFA_LayoutItem* pChildLayoutItem = pLastPageAreaLayoutItem->m_pFirstChild; @@ -685,7 +685,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { pContentAreaNode->GetMeasure(XFA_ATTRIBUTE_H) .ToUnit(XFA_UNIT_Pt) + XFA_LAYOUT_FLOAT_PERCISION) { - bUsable = FALSE; + bUsable = false; break; } } @@ -739,11 +739,11 @@ int32_t CXFA_LayoutPageMgr::GetPageIndex( return m_PageArray.Find(const_cast<CXFA_ContainerLayoutItem*>(pPage)); } -FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, - XFA_ATTRIBUTEENUM eTargetType, - CXFA_Node* pTarget, - FX_BOOL bStartNew) { - FX_BOOL bRet = FALSE; +bool CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, + XFA_ATTRIBUTEENUM eTargetType, + CXFA_Node* pTarget, + bool bStartNew) { + bool bRet = false; switch (eTargetType) { case XFA_ATTRIBUTEENUM_ContentArea: if (pTarget && pTarget->GetElementType() != XFA_Element::ContentArea) @@ -766,7 +766,7 @@ FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, if (!pTarget || !m_pCurrentContainerRecord || pTarget != GetCurrentContainerRecord()->pCurPageArea->m_pFormNode || bStartNew) { - CXFA_Node* pPageArea = GetNextAvailPageArea(pTarget, nullptr, TRUE); + CXFA_Node* pPageArea = GetNextAvailPageArea(pTarget, nullptr, true); bRet = !!pPageArea; } break; @@ -785,9 +785,9 @@ FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, return bRet; } -FX_BOOL CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter( +bool CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter( CXFA_Node* pCurNode, - FX_BOOL bBefore, + bool bBefore, CXFA_Node*& pBreakLeaderTemplate, CXFA_Node*& pBreakTrailerTemplate) { XFA_Element eType = pCurNode->GetElementType(); @@ -798,23 +798,23 @@ FX_BOOL CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter( CXFA_Node* pFormNode = pCurNode->GetNodeItem( XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); CXFA_Node* pContainer = pFormNode->GetTemplateNode(); - FX_BOOL bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0; + bool bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0; CXFA_Node* pScript = pCurNode->GetFirstChildByClass(XFA_Element::Script); if (pScript && !XFA_LayoutPageMgr_RunBreakTestScript(pScript)) - return FALSE; + return false; CFX_WideStringC wsTarget = pCurNode->GetCData(XFA_ATTRIBUTE_Target); CXFA_Node* pTarget = - ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsTarget); + ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsTarget); wsBreakTrailer = pCurNode->GetCData(XFA_ATTRIBUTE_Trailer); wsBreakLeader = pCurNode->GetCData(XFA_ATTRIBUTE_Leader); pBreakLeaderTemplate = - ResolveBreakTarget(pContainer, TRUE, wsBreakLeader); + ResolveBreakTarget(pContainer, true, wsBreakLeader); pBreakTrailerTemplate = - ResolveBreakTarget(pContainer, TRUE, wsBreakTrailer); + ResolveBreakTarget(pContainer, true, wsBreakTrailer); if (RunBreak(eType, pCurNode->GetEnum(XFA_ATTRIBUTE_TargetType), pTarget, bStartNew)) { - return TRUE; + return true; } if (m_rgProposedContainerRecord.GetCount() > 0 && m_pCurrentContainerRecord == @@ -833,36 +833,36 @@ FX_BOOL CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter( pParentNode->GetElementType() != XFA_Element::Form) { break; } - return TRUE; + return true; } break; } case XFA_Element::Break: { - FX_BOOL bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0; + bool bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0; CFX_WideStringC wsTarget = pCurNode->GetCData( bBefore ? XFA_ATTRIBUTE_BeforeTarget : XFA_ATTRIBUTE_AfterTarget); CXFA_Node* pTarget = - ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsTarget); + ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsTarget); if (RunBreak(bBefore ? XFA_Element::BreakBefore : XFA_Element::BreakAfter, pCurNode->GetEnum(bBefore ? XFA_ATTRIBUTE_Before : XFA_ATTRIBUTE_After), pTarget, bStartNew)) { - return TRUE; + return true; } break; } default: break; } - return FALSE; + return false; } -FX_BOOL CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter( +bool CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter( CXFA_Node* pBreakNode, - FX_BOOL bBefore, + bool bBefore, CXFA_Node*& pBreakLeaderNode, CXFA_Node*& pBreakTrailerNode, - FX_BOOL& bCreatePage) { + bool& bCreatePage) { CXFA_Node* pLeaderTemplate = nullptr; CXFA_Node* pTrailerTemplate = nullptr; CXFA_Node* pFormNode = pBreakNode->GetNodeItem(XFA_NODEITEM_Parent, @@ -879,7 +879,7 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter( pDataScope = XFA_DataMerge_FindDataScope(pFormNode); pBreakLeaderNode = pDocument->DataMerge_CopyContainer( - pLeaderTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE); + pLeaderTemplate, pFormNode, pDataScope, true, true, true); pDocument->DataMerge_UpdateBindingRelations(pBreakLeaderNode); SetLayoutGeneratedNodeFlag(pBreakLeaderNode); } @@ -888,18 +888,18 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter( pDataScope = XFA_DataMerge_FindDataScope(pFormNode); pBreakTrailerNode = pDocument->DataMerge_CopyContainer( - pTrailerTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE); + pTrailerTemplate, pFormNode, pDataScope, true, true, true); pDocument->DataMerge_UpdateBindingRelations(pBreakTrailerNode); SetLayoutGeneratedNodeFlag(pBreakTrailerNode); } - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_LayoutPageMgr::ProcessBookendLeaderOrTrailer( +bool CXFA_LayoutPageMgr::ProcessBookendLeaderOrTrailer( CXFA_Node* pBookendNode, - FX_BOOL bLeader, + bool bLeader, CXFA_Node*& pBookendAppendNode) { CXFA_Node* pLeaderTemplate = nullptr; CXFA_Node* pFormNode = pBookendNode->GetNodeItem( @@ -912,19 +912,19 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBookendLeaderOrTrailer( pDataScope = XFA_DataMerge_FindDataScope(pFormNode); pBookendAppendNode = pDocument->DataMerge_CopyContainer( - pLeaderTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE); + pLeaderTemplate, pFormNode, pDataScope, true, true, true); pDocument->DataMerge_UpdateBindingRelations(pBookendAppendNode); SetLayoutGeneratedNodeFlag(pBookendAppendNode); - return TRUE; + return true; } } - return FALSE; + return false; } CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, CXFA_Node*& pLeaderTemplate, CXFA_Node*& pTrailerTemplate, - FX_BOOL bCreatePage) { + bool bCreatePage) { CXFA_Node* pContainer = pOverflowNode ->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode) @@ -941,17 +941,17 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, if (!wsOverflowTarget.IsEmpty() && bCreatePage && !m_bCreateOverFlowPage) { CXFA_Node* pTarget = - ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsOverflowTarget); + ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsOverflowTarget); if (pTarget) { - m_bCreateOverFlowPage = TRUE; + m_bCreateOverFlowPage = true; switch (pTarget->GetElementType()) { case XFA_Element::PageArea: RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea, - pTarget, TRUE); + pTarget, true); break; case XFA_Element::ContentArea: RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea, - pTarget, TRUE); + pTarget, true); break; default: break; @@ -960,9 +960,9 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, } if (!bCreatePage) { pLeaderTemplate = - ResolveBreakTarget(pContainer, TRUE, wsOverflowLeader); + ResolveBreakTarget(pContainer, true, wsOverflowLeader); pTrailerTemplate = - ResolveBreakTarget(pContainer, TRUE, wsOverflowTrailer); + ResolveBreakTarget(pContainer, true, wsOverflowTrailer); } return pOverflowNode; } @@ -980,17 +980,17 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, pOverflowNode->TryCData(XFA_ATTRIBUTE_Target, wsOverflowTarget); if (!wsOverflowTarget.IsEmpty() && bCreatePage && !m_bCreateOverFlowPage) { CXFA_Node* pTarget = - ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsOverflowTarget); + ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsOverflowTarget); if (pTarget) { - m_bCreateOverFlowPage = TRUE; + m_bCreateOverFlowPage = true; switch (pTarget->GetElementType()) { case XFA_Element::PageArea: RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea, pTarget, - TRUE); + true); break; case XFA_Element::ContentArea: RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea, - pTarget, TRUE); + pTarget, true); break; default: break; @@ -998,26 +998,26 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, } } if (!bCreatePage) { - pLeaderTemplate = ResolveBreakTarget(pContainer, TRUE, wsOverflowLeader); - pTrailerTemplate = ResolveBreakTarget(pContainer, TRUE, wsOverflowTrailer); + pLeaderTemplate = ResolveBreakTarget(pContainer, true, wsOverflowLeader); + pTrailerTemplate = ResolveBreakTarget(pContainer, true, wsOverflowTrailer); } return pOverflowNode; } -FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode, - CXFA_Node*& pLeaderNode, - CXFA_Node*& pTrailerNode, - FX_BOOL bDataMerge, - FX_BOOL bCreatePage) { +bool CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode, + CXFA_Node*& pLeaderNode, + CXFA_Node*& pTrailerNode, + bool bDataMerge, + bool bCreatePage) { if (!pFormNode) - return FALSE; + return false; CXFA_Node* pLeaderTemplate = nullptr; CXFA_Node* pTrailerTemplate = nullptr; - FX_BOOL bIsOverflowNode = FALSE; + bool bIsOverflowNode = false; if (pFormNode->GetElementType() == XFA_Element::Overflow || pFormNode->GetElementType() == XFA_Element::Break) { - bIsOverflowNode = TRUE; + bIsOverflowNode = true; } for (CXFA_Node* pCurNode = bIsOverflowNode ? pFormNode @@ -1035,7 +1035,7 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode, pDataScope = XFA_DataMerge_FindDataScope(pFormNode); pLeaderNode = pDocument->DataMerge_CopyContainer( - pLeaderTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE); + pLeaderTemplate, pFormNode, pDataScope, true, true, true); pDocument->DataMerge_UpdateBindingRelations(pLeaderNode); SetLayoutGeneratedNodeFlag(pLeaderNode); } @@ -1044,22 +1044,22 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode, pDataScope = XFA_DataMerge_FindDataScope(pFormNode); pTrailerNode = pDocument->DataMerge_CopyContainer( - pTrailerTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE); + pTrailerTemplate, pFormNode, pDataScope, true, true, true); pDocument->DataMerge_UpdateBindingRelations(pTrailerNode); SetLayoutGeneratedNodeFlag(pTrailerNode); } - return TRUE; + return true; } if (bIsOverflowNode) { break; } } - return FALSE; + return false; } -FX_BOOL CXFA_LayoutPageMgr::ResolveBookendLeaderOrTrailer( +bool CXFA_LayoutPageMgr::ResolveBookendLeaderOrTrailer( CXFA_Node* pBookendNode, - FX_BOOL bLeader, + bool bLeader, CXFA_Node*& pBookendAppendTemplate) { CFX_WideStringC wsBookendLeader; CXFA_Node* pContainer = @@ -1072,30 +1072,29 @@ FX_BOOL CXFA_LayoutPageMgr::ResolveBookendLeaderOrTrailer( wsBookendLeader); if (!wsBookendLeader.IsEmpty()) { pBookendAppendTemplate = - ResolveBreakTarget(pContainer, FALSE, wsBookendLeader); - return TRUE; + ResolveBreakTarget(pContainer, false, wsBookendLeader); + return true; } - return FALSE; + return false; } else if (pBookendNode->GetElementType() == XFA_Element::Bookend) { pBookendNode->TryCData( bLeader ? XFA_ATTRIBUTE_Leader : XFA_ATTRIBUTE_Trailer, wsBookendLeader); pBookendAppendTemplate = - ResolveBreakTarget(pContainer, TRUE, wsBookendLeader); - return TRUE; + ResolveBreakTarget(pContainer, true, wsBookendLeader); + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet( - CXFA_Node* pPageSet, - CXFA_Node* pStartChild, - CXFA_Node* pTargetPageArea, - CXFA_Node* pTargetContentArea, - FX_BOOL bNewPage, - FX_BOOL bQuery) { +bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet(CXFA_Node* pPageSet, + CXFA_Node* pStartChild, + CXFA_Node* pTargetPageArea, + CXFA_Node* pTargetContentArea, + bool bNewPage, + bool bQuery) { if (!pPageSet && !pStartChild) - return FALSE; + return false; if (IsPageSetRootOrderedOccurrence()) { return FindPageAreaFromPageSet_Ordered(pPageSet, pStartChild, @@ -1110,25 +1109,25 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet( bQuery, ePreferredPosition); } -FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered( +bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered( CXFA_Node* pPageSet, CXFA_Node* pStartChild, CXFA_Node* pTargetPageArea, CXFA_Node* pTargetContentArea, - FX_BOOL bNewPage, - FX_BOOL bQuery) { + bool bNewPage, + bool bQuery) { int32_t iPageSetCount = 0; if (!pStartChild && !bQuery) { m_pPageSetMap.Lookup(pPageSet, iPageSetCount); int32_t iMax = -1; CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_Element::Occur); if (pOccurNode) - pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); + pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false); if (iMax >= 0 && iMax <= iPageSetCount) - return FALSE; + return false; } - FX_BOOL bRes = FALSE; + bool bRes = false; CXFA_Node* pCurrentNode = pStartChild ? pStartChild->GetNodeItem(XFA_NODEITEM_NextSibling) : pPageSet->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -1138,7 +1137,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered( if ((pTargetPageArea == pCurrentNode || !pTargetPageArea)) { if (!pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea)) { if (pTargetPageArea == pCurrentNode) { - CreateMinPageRecord(pCurrentNode, TRUE); + CreateMinPageRecord(pCurrentNode, true); pTargetPageArea = nullptr; } continue; @@ -1155,20 +1154,20 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered( } m_pCurPageArea = pCurrentNode; m_nCurPageCount = 1; - bRes = TRUE; + bRes = true; break; } if (!bQuery) - CreateMinPageRecord(pCurrentNode, FALSE); + CreateMinPageRecord(pCurrentNode, false); } else if (pCurrentNode->GetElementType() == XFA_Element::PageSet) { if (FindPageAreaFromPageSet_Ordered(pCurrentNode, nullptr, pTargetPageArea, pTargetContentArea, bNewPage, bQuery)) { - bRes = TRUE; + bRes = true; break; } if (!bQuery) - CreateMinPageSetRecord(pCurrentNode, TRUE); + CreateMinPageSetRecord(pCurrentNode, true); } } if (!pStartChild && bRes && !bQuery) @@ -1176,13 +1175,13 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered( return bRes; } -FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( +bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( CXFA_Node* pPageSet, CXFA_Node* pStartChild, CXFA_Node* pTargetPageArea, CXFA_Node* pTargetContentArea, - FX_BOOL bNewPage, - FX_BOOL bQuery, + bool bNewPage, + bool bQuery, XFA_ATTRIBUTEENUM ePreferredPosition) { const XFA_ATTRIBUTEENUM eFallbackPosition = XFA_ATTRIBUTEENUM_Any; CXFA_Node* pPreferredPageArea = nullptr; @@ -1196,7 +1195,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( for (; pCurrentNode; pCurrentNode = pCurrentNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pCurrentNode->GetElementType() == XFA_Element::PageArea) { - if (!MatchPageAreaOddOrEven(pCurrentNode, FALSE)) + if (!MatchPageAreaOddOrEven(pCurrentNode, false)) continue; XFA_ATTRIBUTEENUM eCurPagePosition = @@ -1215,7 +1214,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( AddContentAreaLayoutItem(pNewRecord, pCurrentNode->GetFirstChildByClass( XFA_Element::ContentArea)); pPreferredPageArea = pCurrentNode; - return FALSE; + return false; } if (ePreferredPosition == XFA_ATTRIBUTEENUM_Only) { if (eCurPagePosition != ePreferredPosition) @@ -1226,7 +1225,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( pPreferredPageArea = pCurrentNode; break; } - return FALSE; + return false; } if ((pTargetPageArea == pCurrentNode || !pTargetPageArea)) { if (!pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea)) { @@ -1247,7 +1246,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( pFallbackPageArea = pCurrentNode; } } else if (pTargetPageArea && - !MatchPageAreaOddOrEven(pTargetPageArea, FALSE)) { + !MatchPageAreaOddOrEven(pTargetPageArea, false)) { CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(); AddPageAreaLayoutItem(pNewRecord, pCurrentNode); AddContentAreaLayoutItem(pNewRecord, pCurrentNode->GetFirstChildByClass( @@ -1269,7 +1268,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( pCurPageArea = pFallbackPageArea; if (!pCurPageArea) - return FALSE; + return false; if (!bQuery) { CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(); @@ -1281,13 +1280,13 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( AddContentAreaLayoutItem(pNewRecord, pTargetContentArea); } m_pCurPageArea = pCurPageArea; - return TRUE; + return true; } -FX_BOOL CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea, - FX_BOOL bLastMatch) { +bool CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea, + bool bLastMatch) { if (m_ePageSetMode != XFA_ATTRIBUTEENUM_DuplexPaginated) - return TRUE; + return true; XFA_ATTRIBUTEENUM eOddOrEven = XFA_ATTRIBUTEENUM_Any; pPageArea->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven); @@ -1300,14 +1299,14 @@ FX_BOOL CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea, return eOddOrEven == XFA_ATTRIBUTEENUM_Odd ? iPageCount % 2 == 0 : iPageCount % 2 == 1; } - return TRUE; + return true; } CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( CXFA_Node* pTargetPageArea, CXFA_Node* pTargetContentArea, - FX_BOOL bNewPage, - FX_BOOL bQuery) { + bool bNewPage, + bool bQuery) { if (!m_pCurPageArea) { FindPageAreaFromPageSet(m_pTemplatePageSetRoot, nullptr, pTargetPageArea, pTargetContentArea, bNewPage, bQuery); @@ -1324,7 +1323,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( CXFA_Node* pOccurNode = m_pCurPageArea->GetFirstChildByClass(XFA_Element::Occur); if (pOccurNode) - pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); + pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false); if ((iMax < 0 || m_nCurPageCount < iMax)) { if (!bQuery) { CXFA_ContainerRecord* pNewRecord = @@ -1343,7 +1342,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( } if (!bQuery && IsPageSetRootOrderedOccurrence()) - CreateMinPageRecord(m_pCurPageArea, FALSE, TRUE); + CreateMinPageRecord(m_pCurPageArea, false, true); if (FindPageAreaFromPageSet(m_pCurPageArea->GetNodeItem(XFA_NODEITEM_Parent), m_pCurPageArea, pTargetPageArea, pTargetContentArea, bNewPage, bQuery)) { @@ -1351,7 +1350,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( } CXFA_Node* pPageSet = m_pCurPageArea->GetNodeItem(XFA_NODEITEM_Parent); - while (TRUE) { + while (true) { if (FindPageAreaFromPageSet(pPageSet, nullptr, pTargetPageArea, pTargetContentArea, bNewPage, bQuery)) { return m_pCurPageArea; @@ -1370,36 +1369,36 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( return nullptr; } -FX_BOOL CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) { +bool CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) { CXFA_Node* pCurContentNode = GetCurrentContainerRecord()->pCurContentArea->m_pFormNode; if (!pContentArea) { pContentArea = pCurContentNode->GetNextSameClassSibling(XFA_Element::ContentArea); if (!pContentArea) - return FALSE; + return false; } else { if (pContentArea->GetNodeItem(XFA_NODEITEM_Parent) != m_pCurPageArea) - return FALSE; + return false; CXFA_ContainerLayoutItem* pContentAreaLayout = nullptr; if (!CheckContentAreaNotUsed(GetCurrentContainerRecord()->pCurPageArea, pContentArea, pContentAreaLayout)) { - return FALSE; + return false; } if (pContentAreaLayout) { if (pContentAreaLayout->m_pFormNode != pCurContentNode) { CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(); pNewRecord->pCurContentArea = pContentAreaLayout; - return TRUE; + return true; } - return FALSE; + return false; } } CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(); AddContentAreaLayoutItem(pNewRecord, pContentArea); - return TRUE; + return true; } void CXFA_LayoutPageMgr::InitPageSetMap() { @@ -1419,14 +1418,14 @@ void CXFA_LayoutPageMgr::InitPageSetMap() { } int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, - FX_BOOL bTargetPageArea, - FX_BOOL bCreateLast) { + bool bTargetPageArea, + bool bCreateLast) { if (!pPageArea) return 0; CXFA_Node* pOccurNode = pPageArea->GetFirstChildByClass(XFA_Element::Occur); int32_t iMin = 0; - if ((pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) || + if ((pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, false)) || bTargetPageArea) { CXFA_Node* pContentArea = pPageArea->GetFirstChildByClass(XFA_Element::ContentArea); @@ -1447,7 +1446,7 @@ int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, } void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, - FX_BOOL bCreateAll) { + bool bCreateAll) { if (!pPageSet) return; @@ -1459,7 +1458,7 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_Element::Occur); int32_t iMin = 0; - if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) { + if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, false)) { if (iCurSetCount < iMin) { for (int32_t i = 0; i < iMin - iCurSetCount; i++) { for (CXFA_Node* pCurrentPageNode = @@ -1467,10 +1466,10 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, pCurrentPageNode; pCurrentPageNode = pCurrentPageNode->GetNodeItem( XFA_NODEITEM_NextSibling)) { if (pCurrentPageNode->GetElementType() == XFA_Element::PageArea) { - CreateMinPageRecord(pCurrentPageNode, FALSE); + CreateMinPageRecord(pCurrentPageNode, false); } else if (pCurrentPageNode->GetElementType() == XFA_Element::PageSet) { - CreateMinPageSetRecord(pCurrentPageNode, TRUE); + CreateMinPageSetRecord(pCurrentPageNode, true); } } } @@ -1488,17 +1487,17 @@ void CXFA_LayoutPageMgr::CreateNextMinRecord(CXFA_Node* pRecordNode) { pCurrentNode; pCurrentNode = pCurrentNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pCurrentNode->GetElementType() == XFA_Element::PageArea) - CreateMinPageRecord(pCurrentNode, FALSE); + CreateMinPageRecord(pCurrentNode, false); else if (pCurrentNode->GetElementType() == XFA_Element::PageSet) - CreateMinPageSetRecord(pCurrentNode, TRUE); + CreateMinPageSetRecord(pCurrentNode, true); } } void CXFA_LayoutPageMgr::ProcessLastPageSet() { - CreateMinPageRecord(m_pCurPageArea, FALSE, TRUE); + CreateMinPageRecord(m_pCurPageArea, false, true); CreateNextMinRecord(m_pCurPageArea); CXFA_Node* pPageSet = m_pCurPageArea->GetNodeItem(XFA_NODEITEM_Parent); - while (TRUE) { + while (true) { CreateMinPageSetRecord(pPageSet); if (pPageSet == m_pTemplatePageSetRoot) break; @@ -1508,11 +1507,11 @@ void CXFA_LayoutPageMgr::ProcessLastPageSet() { } } -FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { +bool CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { CXFA_Node* pCurContentNode = GetCurrentContainerRecord()->pCurContentArea->m_pFormNode; if (!pCurContentNode) - return FALSE; + return false; pCurContentNode = pCurContentNode->GetNextSameClassSibling(XFA_Element::ContentArea); @@ -1525,13 +1524,13 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { CXFA_Node* pPageNode = GetCurrentContainerRecord()->pCurPageArea->m_pFormNode; CXFA_Node* pOccurNode = pPageNode->GetFirstChildByClass(XFA_Element::Occur); int32_t iMax = 0; - if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE)) { + if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false)) { if (m_nCurPageCount == iMax) { CXFA_Node* pSrcPage = m_pCurPageArea; int32_t nSrcPageCount = m_nCurPageCount; FX_POSITION psSrcRecord = m_rgProposedContainerRecord.GetTailPosition(); CXFA_Node* pNextPage = - GetNextAvailPageArea(nullptr, nullptr, FALSE, TRUE); + GetNextAvailPageArea(nullptr, nullptr, false, true); m_pCurPageArea = pSrcPage; m_nCurPageCount = nSrcPageCount; CXFA_ContainerRecord* pPrevRecord = static_cast<CXFA_ContainerRecord*>( @@ -1552,10 +1551,10 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { FX_FLOAT fNextContentHeight = pContentArea->GetMeasure(XFA_ATTRIBUTE_H).ToUnit(XFA_UNIT_Pt); if (fNextContentHeight > fChildHeight) - return TRUE; + return true; } } - return FALSE; + return false; } } @@ -1564,10 +1563,10 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { FX_FLOAT fNextContentHeight = pContentArea->GetMeasure(XFA_ATTRIBUTE_H).ToUnit(XFA_UNIT_Pt); if (fNextContentHeight < XFA_LAYOUT_FLOAT_PERCISION) - return TRUE; + return true; if (fNextContentHeight > fChildHeight) - return TRUE; - return FALSE; + return true; + return false; } void CXFA_LayoutPageMgr::ClearData() { @@ -1590,7 +1589,7 @@ void CXFA_LayoutPageMgr::ClearRecordList() { m_pCurrentContainerRecord = nullptr; m_pCurPageArea = nullptr; m_nCurPageCount = 0; - m_bCreateOverFlowPage = FALSE; + m_bCreateOverFlowPage = false; m_pPageSetMap.RemoveAll(); } @@ -1711,7 +1710,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { if (pRootPageSetContainerItem->m_pFormNode->GetPacketID() == XFA_XDPPACKET_Template) { pPendingPageSet = - pRootPageSetContainerItem->m_pFormNode->CloneTemplateToForm(FALSE); + pRootPageSetContainerItem->m_pFormNode->CloneTemplateToForm(false); } else { pPendingPageSet = pRootPageSetContainerItem->m_pFormNode; } @@ -1733,14 +1732,14 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { case XFA_Element::PageSet: { CXFA_Node* pParentNode = pContainerItem->m_pParent->m_pFormNode; pContainerItem->m_pFormNode = XFA_NodeMerge_CloneOrMergeContainer( - pDocument, pParentNode, pContainerItem->m_pFormNode, TRUE, + pDocument, pParentNode, pContainerItem->m_pFormNode, true, nullptr); break; } case XFA_Element::PageArea: { CXFA_ContainerLayoutItem* pFormLayout = pContainerItem; CXFA_Node* pParentNode = pContainerItem->m_pParent->m_pFormNode; - FX_BOOL bIsExistForm = TRUE; + bool bIsExistForm = true; for (int32_t iLevel = 0; iLevel < 3; iLevel++) { pFormLayout = static_cast<CXFA_ContainerLayoutItem*>( pFormLayout->m_pFirstChild); @@ -1753,7 +1752,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { } } if (!pFormLayout) { - bIsExistForm = FALSE; + bIsExistForm = false; break; } } @@ -1784,8 +1783,8 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { } pContainerItem->m_pFormNode = pDocument->DataMerge_CopyContainer( pContainerItem->m_pFormNode, pParentNode, - ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Record)), TRUE, TRUE, - TRUE); + ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Record)), true, true, + true); break; } case XFA_Element::ContentArea: { @@ -1919,7 +1918,7 @@ void CXFA_LayoutPageMgr::SyncLayoutData() { pChildLayoutItem = iterator.MoveToNext(); continue; } - FX_BOOL bVisible = + bool bVisible = (pContentItem->m_pFormNode->GetEnum(XFA_ATTRIBUTE_Presence) == XFA_ATTRIBUTEENUM_Visible); uint32_t dwRelevantChild = @@ -1982,7 +1981,7 @@ void CXFA_LayoutPageMgr::PrepareLayout() { CXFA_Node* pNextPageSet = pPageSetFormNode->GetNextSameClassSibling(XFA_Element::PageSet); pPageSetFormNode->GetNodeItem(XFA_NODEITEM_Parent) - ->RemoveChild(pPageSetFormNode, FALSE); + ->RemoveChild(pPageSetFormNode, false); pRootLayoutItem->m_pFormNode->GetDocument()->m_pPendingPageSet.Add( pPageSetFormNode); pPageSetFormNode = pNextPageSet; diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.h b/xfa/fxfa/parser/cxfa_layoutpagemgr.h index 0184602de7..dcd798ea1a 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.h +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.h @@ -17,10 +17,10 @@ class CXFA_LayoutPageMgr { CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor); ~CXFA_LayoutPageMgr(); - FX_BOOL InitLayoutPage(CXFA_Node* pFormNode); - FX_BOOL PrepareFirstPage(CXFA_Node* pRootSubform); + bool InitLayoutPage(CXFA_Node* pFormNode); + bool PrepareFirstPage(CXFA_Node* pRootSubform); FX_FLOAT GetAvailHeight(); - FX_BOOL GetNextAvailContentHeight(FX_FLOAT fChildHeight); + bool GetNextAvailContentHeight(FX_FLOAT fChildHeight); void SubmitContentItem(CXFA_ContentLayoutItem* pContentLayoutItem, XFA_ItemLayoutProcessorResult eStatus); void FinishPaginatedPageSets(); @@ -31,25 +31,25 @@ class CXFA_LayoutPageMgr { inline CXFA_ContainerLayoutItem* GetRootLayoutItem() const { return m_pPageSetLayoutItemRoot; } - FX_BOOL ProcessBreakBeforeOrAfter(CXFA_Node* pBreakNode, - FX_BOOL bBefore, - CXFA_Node*& pBreakLeaderNode, - CXFA_Node*& pBreakTrailerNode, - FX_BOOL& bCreatePage); - FX_BOOL ProcessOverflow(CXFA_Node* pFormNode, - CXFA_Node*& pLeaderNode, - CXFA_Node*& pTrailerNode, - FX_BOOL bDataMerge = FALSE, - FX_BOOL bCreatePage = TRUE); + bool ProcessBreakBeforeOrAfter(CXFA_Node* pBreakNode, + bool bBefore, + CXFA_Node*& pBreakLeaderNode, + CXFA_Node*& pBreakTrailerNode, + bool& bCreatePage); + bool ProcessOverflow(CXFA_Node* pFormNode, + CXFA_Node*& pLeaderNode, + CXFA_Node*& pTrailerNode, + bool bDataMerge = false, + bool bCreatePage = true); CXFA_Node* QueryOverflow(CXFA_Node* pFormNode, CXFA_LayoutContext* pLayoutContext = nullptr); - FX_BOOL ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode, - FX_BOOL bLeader, - CXFA_Node*& pBookendAppendNode); + bool ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode, + bool bLeader, + CXFA_Node*& pBookendAppendNode); CXFA_LayoutItem* FindOrCreateLayoutItem(CXFA_Node* pFormNode); protected: - FX_BOOL AppendNewPage(FX_BOOL bFirstTemPage = FALSE); + bool AppendNewPage(bool bFirstTemPage = false); void ReorderPendingLayoutRecordToTail(CXFA_ContainerRecord* pNewRecord, CXFA_ContainerRecord* pPrevRecord); void RemoveLayoutRecord(CXFA_ContainerRecord* pNewRecord, @@ -62,62 +62,61 @@ class CXFA_LayoutPageMgr { return result; } CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode = nullptr, - FX_BOOL bCreateNew = FALSE); + bool bCreateNew = false); void AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, CXFA_Node* pNewPageArea); void AddContentAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, CXFA_Node* pContentArea); - FX_BOOL RunBreak(XFA_Element eBreakType, - XFA_ATTRIBUTEENUM eTargetType, - CXFA_Node* pTarget, - FX_BOOL bStartNew); + bool RunBreak(XFA_Element eBreakType, + XFA_ATTRIBUTEENUM eTargetType, + CXFA_Node* pTarget, + bool bStartNew); CXFA_Node* BreakOverflow(CXFA_Node* pOverflowNode, CXFA_Node*& pLeaderTemplate, CXFA_Node*& pTrailerTemplate, - FX_BOOL bCreatePage = TRUE); - FX_BOOL ResolveBookendLeaderOrTrailer(CXFA_Node* pBookendNode, - FX_BOOL bLeader, - CXFA_Node*& pBookendAppendTemplate); - FX_BOOL ExecuteBreakBeforeOrAfter(CXFA_Node* pCurNode, - FX_BOOL bBefore, - CXFA_Node*& pBreakLeaderTemplate, - CXFA_Node*& pBreakTrailerTemplate); + bool bCreatePage = true); + bool ResolveBookendLeaderOrTrailer(CXFA_Node* pBookendNode, + bool bLeader, + CXFA_Node*& pBookendAppendTemplate); + bool ExecuteBreakBeforeOrAfter(CXFA_Node* pCurNode, + bool bBefore, + CXFA_Node*& pBreakLeaderTemplate, + CXFA_Node*& pBreakTrailerTemplate); int32_t CreateMinPageRecord(CXFA_Node* pPageArea, - FX_BOOL bTargetPageArea, - FX_BOOL bCreateLast = FALSE); - void CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCreateAll = FALSE); + bool bTargetPageArea, + bool bCreateLast = false); + void CreateMinPageSetRecord(CXFA_Node* pPageSet, bool bCreateAll = false); void CreateNextMinRecord(CXFA_Node* pRecordNode); - FX_BOOL FindPageAreaFromPageSet(CXFA_Node* pPageSet, - CXFA_Node* pStartChild, - CXFA_Node* pTargetPageArea = nullptr, - CXFA_Node* pTargetContentArea = nullptr, - FX_BOOL bNewPage = FALSE, - FX_BOOL bQuery = FALSE); - FX_BOOL FindPageAreaFromPageSet_Ordered( - CXFA_Node* pPageSet, - CXFA_Node* pStartChild, - CXFA_Node* pTargetPageArea = nullptr, - CXFA_Node* pTargetContentArea = nullptr, - FX_BOOL bNewPage = FALSE, - FX_BOOL bQuery = FALSE); - FX_BOOL FindPageAreaFromPageSet_SimplexDuplex( + bool FindPageAreaFromPageSet(CXFA_Node* pPageSet, + CXFA_Node* pStartChild, + CXFA_Node* pTargetPageArea = nullptr, + CXFA_Node* pTargetContentArea = nullptr, + bool bNewPage = false, + bool bQuery = false); + bool FindPageAreaFromPageSet_Ordered(CXFA_Node* pPageSet, + CXFA_Node* pStartChild, + CXFA_Node* pTargetPageArea = nullptr, + CXFA_Node* pTargetContentArea = nullptr, + bool bNewPage = false, + bool bQuery = false); + bool FindPageAreaFromPageSet_SimplexDuplex( CXFA_Node* pPageSet, CXFA_Node* pStartChild, CXFA_Node* pTargetPageArea = nullptr, CXFA_Node* pTargetContentArea = nullptr, - FX_BOOL bNewPage = FALSE, - FX_BOOL bQuery = FALSE, + bool bNewPage = false, + bool bQuery = false, XFA_ATTRIBUTEENUM ePreferredPosition = XFA_ATTRIBUTEENUM_First); - FX_BOOL MatchPageAreaOddOrEven(CXFA_Node* pPageArea, FX_BOOL bLastMatch); + bool MatchPageAreaOddOrEven(CXFA_Node* pPageArea, bool bLastMatch); CXFA_Node* GetNextAvailPageArea(CXFA_Node* pTargetPageArea, CXFA_Node* pTargetContentArea = nullptr, - FX_BOOL bNewPage = FALSE, - FX_BOOL bQuery = FALSE); - FX_BOOL GetNextContentArea(CXFA_Node* pTargetContentArea); + bool bNewPage = false, + bool bQuery = false); + bool GetNextContentArea(CXFA_Node* pTargetContentArea); void InitPageSetMap(); void ProcessLastPageSet(); - inline FX_BOOL IsPageSetRootOrderedOccurrence() { + inline bool IsPageSetRootOrderedOccurrence() { return m_ePageSetMode == XFA_ATTRIBUTEENUM_OrderedOccurrence; } void ClearData(); @@ -136,7 +135,7 @@ class CXFA_LayoutPageMgr { int32_t m_nAvailPages; int32_t m_nCurPageCount; XFA_ATTRIBUTEENUM m_ePageSetMode; - FX_BOOL m_bCreateOverFlowPage; + bool m_bCreateOverFlowPage; CFX_MapPtrTemplate<CXFA_Node*, int32_t> m_pPageSetMap; CFX_ArrayTemplate<CXFA_ContainerLayoutItem*> m_PageArray; }; diff --git a/xfa/fxfa/parser/cxfa_layoutprocessor.cpp b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp index 1f3bc880eb..ad1c2a936a 100644 --- a/xfa/fxfa/parser/cxfa_layoutprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp @@ -33,7 +33,7 @@ CXFA_LayoutProcessor::CXFA_LayoutProcessor(CXFA_Document* pDocument) m_pRootItemLayoutProcessor(nullptr), m_pLayoutPageMgr(nullptr), m_nProgressCounter(0), - m_bNeeLayout(TRUE) {} + m_bNeeLayout(true) {} CXFA_LayoutProcessor::~CXFA_LayoutProcessor() { ClearLayoutData(); @@ -43,7 +43,7 @@ CXFA_Document* CXFA_LayoutProcessor::GetDocument() const { return m_pDocument; } -int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) { +int32_t CXFA_LayoutProcessor::StartLayout(bool bForceRestart) { if (!bForceRestart && !IsNeedLayout()) return 100; @@ -82,7 +82,7 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { do { FX_FLOAT fAvailHeight = m_pLayoutPageMgr->GetAvailHeight(); eStatus = - m_pRootItemLayoutProcessor->DoLayout(TRUE, fAvailHeight, fAvailHeight); + m_pRootItemLayoutProcessor->DoLayout(true, fAvailHeight, fAvailHeight); if (eStatus != XFA_ItemLayoutProcessorResult_Done) m_nProgressCounter++; @@ -98,7 +98,7 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { if (eStatus == XFA_ItemLayoutProcessorResult_Done) { m_pLayoutPageMgr->FinishPaginatedPageSets(); m_pLayoutPageMgr->SyncLayoutData(); - m_bNeeLayout = FALSE; + m_bNeeLayout = false; m_rgChangedContainers.RemoveAll(); } return 100 * (eStatus == XFA_ItemLayoutProcessorResult_Done @@ -107,9 +107,9 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { m_nProgressCounter; } -FX_BOOL CXFA_LayoutProcessor::IncrementLayout() { +bool CXFA_LayoutProcessor::IncrementLayout() { if (m_bNeeLayout) { - StartLayout(TRUE); + StartLayout(true); return DoLayout(nullptr) == 100; } @@ -118,14 +118,14 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() { CXFA_Node* pParentNode = pNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); if (!pParentNode) - return FALSE; + return false; if (!CXFA_ItemLayoutProcessor::IncrementRelayoutNode(this, pNode, pParentNode)) { - return FALSE; + return false; } } m_rgChangedContainers.RemoveAll(); - return TRUE; + return true; } int32_t CXFA_LayoutProcessor::CountPages() const { @@ -158,6 +158,6 @@ void CXFA_LayoutProcessor::ClearLayoutData() { m_nProgressCounter = 0; } -FX_BOOL CXFA_LayoutProcessor::IsNeedLayout() { +bool CXFA_LayoutProcessor::IsNeedLayout() { return m_bNeeLayout || m_rgChangedContainers.GetSize() > 0; } diff --git a/xfa/fxfa/parser/cxfa_layoutprocessor.h b/xfa/fxfa/parser/cxfa_layoutprocessor.h index 365c5f2965..d735b385bd 100644 --- a/xfa/fxfa/parser/cxfa_layoutprocessor.h +++ b/xfa/fxfa/parser/cxfa_layoutprocessor.h @@ -24,15 +24,15 @@ class CXFA_LayoutProcessor { ~CXFA_LayoutProcessor(); CXFA_Document* GetDocument() const; - int32_t StartLayout(FX_BOOL bForceRestart = FALSE); + int32_t StartLayout(bool bForceRestart = false); int32_t DoLayout(IFX_Pause* pPause = nullptr); - FX_BOOL IncrementLayout(); + bool IncrementLayout(); int32_t CountPages() const; CXFA_ContainerLayoutItem* GetPage(int32_t index) const; CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); void AddChangedContainer(CXFA_Node* pContainer); - void SetForceReLayout(FX_BOOL bForceRestart) { m_bNeeLayout = bForceRestart; } + void SetForceReLayout(bool bForceRestart) { m_bNeeLayout = bForceRestart; } CXFA_ContainerLayoutItem* GetRootLayoutItem() const; CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() { return m_pRootItemLayoutProcessor; @@ -42,14 +42,14 @@ class CXFA_LayoutProcessor { private: void ClearLayoutData(); - FX_BOOL IsNeedLayout(); + bool IsNeedLayout(); CXFA_Document* m_pDocument; CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor; CXFA_LayoutPageMgr* m_pLayoutPageMgr; CXFA_NodeArray m_rgChangedContainers; uint32_t m_nProgressCounter; - FX_BOOL m_bNeeLayout; + bool m_bNeeLayout; }; #endif // XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ diff --git a/xfa/fxfa/parser/cxfa_line.cpp b/xfa/fxfa/parser/cxfa_line.cpp index b35aa4146d..f0d9a0bbfd 100644 --- a/xfa/fxfa/parser/cxfa_line.cpp +++ b/xfa/fxfa/parser/cxfa_line.cpp @@ -12,7 +12,7 @@ int32_t CXFA_Line::GetHand() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Hand); } -FX_BOOL CXFA_Line::GetSlop() { +bool CXFA_Line::GetSlop() { XFA_ATTRIBUTEENUM eSlop = m_pNode->GetEnum(XFA_ATTRIBUTE_Slope); return eSlop == XFA_ATTRIBUTEENUM_Slash; } diff --git a/xfa/fxfa/parser/cxfa_line.h b/xfa/fxfa/parser/cxfa_line.h index 1d91a5970b..bf180295da 100644 --- a/xfa/fxfa/parser/cxfa_line.h +++ b/xfa/fxfa/parser/cxfa_line.h @@ -18,7 +18,7 @@ class CXFA_Line : public CXFA_Data { explicit CXFA_Line(CXFA_Node* pNode) : CXFA_Data(pNode) {} int32_t GetHand(); - FX_BOOL GetSlop(); + bool GetSlop(); CXFA_Edge GetEdge(); }; diff --git a/xfa/fxfa/parser/cxfa_margin.cpp b/xfa/fxfa/parser/cxfa_margin.cpp index c3ced3df93..38f9626a88 100644 --- a/xfa/fxfa/parser/cxfa_margin.cpp +++ b/xfa/fxfa/parser/cxfa_margin.cpp @@ -10,23 +10,22 @@ CXFA_Margin::CXFA_Margin(CXFA_Node* pNode) : CXFA_Data(pNode) {} -FX_BOOL CXFA_Margin::GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { +bool CXFA_Margin::GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { fInset = fDefInset; return TryMeasure(XFA_ATTRIBUTE_LeftInset, fInset); } -FX_BOOL CXFA_Margin::GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { +bool CXFA_Margin::GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { fInset = fDefInset; return TryMeasure(XFA_ATTRIBUTE_TopInset, fInset); } -FX_BOOL CXFA_Margin::GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { +bool CXFA_Margin::GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { fInset = fDefInset; return TryMeasure(XFA_ATTRIBUTE_RightInset, fInset); } -FX_BOOL CXFA_Margin::GetBottomInset(FX_FLOAT& fInset, - FX_FLOAT fDefInset) const { +bool CXFA_Margin::GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { fInset = fDefInset; return TryMeasure(XFA_ATTRIBUTE_BottomInset, fInset); } diff --git a/xfa/fxfa/parser/cxfa_margin.h b/xfa/fxfa/parser/cxfa_margin.h index 780f9b2b68..d1c1955194 100644 --- a/xfa/fxfa/parser/cxfa_margin.h +++ b/xfa/fxfa/parser/cxfa_margin.h @@ -16,10 +16,10 @@ class CXFA_Margin : public CXFA_Data { public: explicit CXFA_Margin(CXFA_Node* pNode); - FX_BOOL GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; - FX_BOOL GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; - FX_BOOL GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; - FX_BOOL GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; + bool GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; + bool GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; + bool GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; + bool GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const; }; #endif // XFA_FXFA_PARSER_CXFA_MARGIN_H_ diff --git a/xfa/fxfa/parser/cxfa_measurement.cpp b/xfa/fxfa/parser/cxfa_measurement.cpp index cd34f8af25..b1843a8b49 100644 --- a/xfa/fxfa/parser/cxfa_measurement.cpp +++ b/xfa/fxfa/parser/cxfa_measurement.cpp @@ -34,43 +34,43 @@ void CXFA_Measurement::Set(const CFX_WideStringC& wsMeasure) { Set(fValue, eUnit); } -FX_BOOL CXFA_Measurement::ToString(CFX_WideString& wsMeasure) const { +bool CXFA_Measurement::ToString(CFX_WideString& wsMeasure) const { switch (GetUnit()) { case XFA_UNIT_Mm: wsMeasure.Format(L"%.8gmm", GetValue()); - return TRUE; + return true; case XFA_UNIT_Pt: wsMeasure.Format(L"%.8gpt", GetValue()); - return TRUE; + return true; case XFA_UNIT_In: wsMeasure.Format(L"%.8gin", GetValue()); - return TRUE; + return true; case XFA_UNIT_Cm: wsMeasure.Format(L"%.8gcm", GetValue()); - return TRUE; + return true; case XFA_UNIT_Mp: wsMeasure.Format(L"%.8gmp", GetValue()); - return TRUE; + return true; case XFA_UNIT_Pc: wsMeasure.Format(L"%.8gpc", GetValue()); - return TRUE; + return true; case XFA_UNIT_Em: wsMeasure.Format(L"%.8gem", GetValue()); - return TRUE; + return true; case XFA_UNIT_Percent: wsMeasure.Format(L"%.8g%%", GetValue()); - return TRUE; + return true; default: wsMeasure.Format(L"%.8g", GetValue()); - return FALSE; + return false; } } -FX_BOOL CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const { +bool CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const { fValue = GetValue(); XFA_UNIT eFrom = GetUnit(); if (eFrom == eUnit) - return TRUE; + return true; switch (eFrom) { case XFA_UNIT_Pt: @@ -92,29 +92,29 @@ FX_BOOL CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const { break; default: fValue = 0; - return FALSE; + return false; } switch (eUnit) { case XFA_UNIT_Pt: - return TRUE; + return true; case XFA_UNIT_Mm: fValue /= 72 / 2.54f / 10; - return TRUE; + return true; case XFA_UNIT_In: fValue /= 72; - return TRUE; + return true; case XFA_UNIT_Cm: fValue /= 72 / 2.54f; - return TRUE; + return true; case XFA_UNIT_Mp: fValue /= 0.001f; - return TRUE; + return true; case XFA_UNIT_Pc: fValue /= 12.0f; - return TRUE; + return true; default: fValue = 0; - return FALSE; + return false; } } diff --git a/xfa/fxfa/parser/cxfa_measurement.h b/xfa/fxfa/parser/cxfa_measurement.h index cf43f7625a..40f71a7fab 100644 --- a/xfa/fxfa/parser/cxfa_measurement.h +++ b/xfa/fxfa/parser/cxfa_measurement.h @@ -27,8 +27,8 @@ class CXFA_Measurement { XFA_UNIT GetUnit() const { return m_eUnit; } FX_FLOAT GetValue() const { return m_fValue; } - FX_BOOL ToString(CFX_WideString& wsMeasure) const; - FX_BOOL ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const; + bool ToString(CFX_WideString& wsMeasure) const; + bool ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const; FX_FLOAT ToUnit(XFA_UNIT eUnit) const { FX_FLOAT f; return ToUnit(eUnit, f) ? f : 0; diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 402ab0e37e..1d0f4333f5 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -127,7 +127,7 @@ CXFA_NodeSetPair* NodeSetPairForNode(CXFA_Node* pNode, void ReorderDataNodes(const CXFA_NodeSet& sSet1, const CXFA_NodeSet& sSet2, - FX_BOOL bInsertBefore) { + bool bInsertBefore) { CXFA_NodeSetPairMapMap rgMap; for (CXFA_Node* pNode : sSet1) { CXFA_NodeSetPair* pNodeSetPair = NodeSetPairForNode(pNode, &rgMap); @@ -218,7 +218,7 @@ void InsertItem(CXFA_Node* pInstMgrNode, CXFA_Node* pNewInstance, int32_t iPos, int32_t iCount = -1, - FX_BOOL bMoveDataBindingNodes = TRUE) { + bool bMoveDataBindingNodes = true) { if (iCount < 0) iCount = GetCount(pInstMgrNode); if (iPos < 0) @@ -256,7 +256,7 @@ void InsertItem(CXFA_Node* pInstMgrNode, sAfter.insert(pDataNode); } - ReorderDataNodes(sNew, sAfter, FALSE); + ReorderDataNodes(sNew, sAfter, false); } } else { CXFA_Node* pBeforeInstance = GetItem(pInstMgrNode, iPos); @@ -287,14 +287,14 @@ void InsertItem(CXFA_Node* pInstMgrNode, sBefore.insert(pDataNode); } - ReorderDataNodes(sNew, sBefore, TRUE); + ReorderDataNodes(sNew, sBefore, true); } } } void RemoveItem(CXFA_Node* pInstMgrNode, CXFA_Node* pRemoveInstance, - FX_BOOL bRemoveDataBinding = TRUE) { + bool bRemoveDataBinding = true) { pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pRemoveInstance); if (!bRemoveDataBinding) return; @@ -317,7 +317,7 @@ void RemoveItem(CXFA_Node* pInstMgrNode, } } -CXFA_Node* CreateInstance(CXFA_Node* pInstMgrNode, FX_BOOL bDataMerge) { +CXFA_Node* CreateInstance(CXFA_Node* pInstMgrNode, bool bDataMerge) { CXFA_Document* pDocument = pInstMgrNode->GetDocument(); CXFA_Node* pTemplateNode = pInstMgrNode->GetTemplateNode(); CXFA_Node* pFormParent = pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent); @@ -334,7 +334,7 @@ CXFA_Node* CreateInstance(CXFA_Node* pInstMgrNode, FX_BOOL bDataMerge) { ASSERT(pDataScope); } CXFA_Node* pInstance = pDocument->DataMerge_CopyContainer( - pTemplateNode, pFormParent, pDataScope, TRUE, bDataMerge, TRUE); + pTemplateNode, pFormParent, pDataScope, true, bDataMerge, true); if (pInstance) { pDocument->DataMerge_UpdateBindingRelations(pInstance); pFormParent->RemoveChild(pInstance); @@ -511,7 +511,7 @@ CXFA_Node::~CXFA_Node() { m_pXMLNode->Release(); } -CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { +CXFA_Node* CXFA_Node::Clone(bool bRecursive) { CXFA_Node* pClone = m_pDocument->CreateNode(m_ePacket, m_elementType); if (!pClone) return nullptr; @@ -522,7 +522,7 @@ CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { CFDE_XMLNode* pCloneXML = nullptr; if (IsAttributeInXML()) { CFX_WideString wsName; - GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE); + GetAttribute(XFA_ATTRIBUTE_Name, wsName, false); CFDE_XMLElement* pCloneXMLElement = new CFDE_XMLElement(wsName); CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value); if (!wsValue.IsEmpty()) { @@ -532,7 +532,7 @@ CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { pCloneXMLElement = nullptr; pClone->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_Unknown); } else { - pCloneXML = m_pXMLNode->Clone(FALSE); + pCloneXML = m_pXMLNode->Clone(false); } pClone->SetXMLMappingNode(pCloneXML); pClone->SetFlag(XFA_NodeFlag_OwnXMLNode, false); @@ -693,7 +693,7 @@ CXFA_Node* CXFA_Node::CreateSamePacketNode(XFA_Element eType, return pNode; } -CXFA_Node* CXFA_Node::CloneTemplateToForm(FX_BOOL bRecursive) { +CXFA_Node* CXFA_Node::CloneTemplateToForm(bool bRecursive) { ASSERT(m_ePacket == XFA_XDPPACKET_Template); CXFA_Node* pClone = m_pDocument->CreateNode(XFA_XDPPACKET_Form, m_elementType); @@ -796,7 +796,7 @@ int32_t CXFA_Node::RemoveBindItem(CXFA_Node* pFormNode) { return pOldFormItem ? 1 : 0; } -FX_BOOL CXFA_Node::HasBindItem() { +bool CXFA_Node::HasBindItem() { return GetPacketID() == XFA_XDPPACKET_Datasets && GetObject(XFA_ATTRIBUTE_BindingNode); } @@ -869,34 +869,34 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() { : nullptr; } -FX_BOOL CXFA_Node::GetLocaleName(CFX_WideString& wsLocaleName) { +bool CXFA_Node::GetLocaleName(CFX_WideString& wsLocaleName) { CXFA_Node* pForm = GetDocument()->GetXFAObject(XFA_HASHCODE_Form)->AsNode(); CXFA_Node* pTopSubform = pForm->GetFirstChildByClass(XFA_Element::Subform); ASSERT(pTopSubform); CXFA_Node* pLocaleNode = this; - FX_BOOL bLocale = FALSE; + bool bLocale = false; do { - bLocale = pLocaleNode->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, FALSE); + bLocale = pLocaleNode->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, false); if (!bLocale) { pLocaleNode = pLocaleNode->GetNodeItem(XFA_NODEITEM_Parent); } } while (pLocaleNode && pLocaleNode != pTopSubform && !bLocale); if (bLocale) - return TRUE; + return true; CXFA_Node* pConfig = ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Config)); wsLocaleName = GetDocument()->GetLocalMgr()->GetConfigLocaleName(pConfig); if (!wsLocaleName.IsEmpty()) - return TRUE; + return true; if (pTopSubform && - pTopSubform->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, FALSE)) { - return TRUE; + pTopSubform->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, false)) { + return true; } IFX_Locale* pLocale = GetDocument()->GetLocalMgr()->GetDefLocale(); if (pLocale) { wsLocaleName = pLocale->GetName(); - return TRUE; + return true; } - return FALSE; + return false; } XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { @@ -904,7 +904,7 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { XFA_ATTRIBUTEENUM eLayoutType = GetEnum(XFA_ATTRIBUTE_Layout); if (pKeep) { XFA_ATTRIBUTEENUM eIntact; - if (pKeep->TryEnum(XFA_ATTRIBUTE_Intact, eIntact, FALSE)) { + if (pKeep->TryEnum(XFA_ATTRIBUTE_Intact, eIntact, false)) { if (eIntact == XFA_ATTRIBUTEENUM_None && eLayoutType == XFA_ATTRIBUTEENUM_Row && m_pDocument->GetCurVersionMode() < XFA_VERSION_208) { @@ -914,14 +914,14 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { pPreviewRow->GetEnum(XFA_ATTRIBUTE_Layout) == XFA_ATTRIBUTEENUM_Row) { XFA_ATTRIBUTEENUM eValue; - if (pKeep->TryEnum(XFA_ATTRIBUTE_Previous, eValue, FALSE) && + if (pKeep->TryEnum(XFA_ATTRIBUTE_Previous, eValue, false) && (eValue == XFA_ATTRIBUTEENUM_ContentArea || eValue == XFA_ATTRIBUTEENUM_PageArea)) { return XFA_ATTRIBUTEENUM_ContentArea; } CXFA_Node* pNode = pPreviewRow->GetFirstChildByClass(XFA_Element::Keep); - if (pNode && pNode->TryEnum(XFA_ATTRIBUTE_Next, eValue, FALSE) && + if (pNode && pNode->TryEnum(XFA_ATTRIBUTE_Next, eValue, false) && (eValue == XFA_ATTRIBUTEENUM_ContentArea || eValue == XFA_ATTRIBUTEENUM_PageArea)) { return XFA_ATTRIBUTEENUM_ContentArea; @@ -962,7 +962,7 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { XFA_VERSION version = m_pDocument->GetCurVersionMode(); if (eParLayout == XFA_ATTRIBUTEENUM_Tb && version < XFA_VERSION_208) { CXFA_Measurement measureH; - if (TryMeasure(XFA_ATTRIBUTE_H, measureH, FALSE)) + if (TryMeasure(XFA_ATTRIBUTE_H, measureH, false)) return XFA_ATTRIBUTEENUM_ContentArea; } return XFA_ATTRIBUTEENUM_None; @@ -1023,7 +1023,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { std::unique_ptr<CFXJSE_Value> pValue( new CFXJSE_Value(pScriptContext->GetRuntime())); (resoveNodeRS.nodes[0]->*(lpAttributeInfo->lpfnCallback))( - pValue.get(), FALSE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); + pValue.get(), false, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); pArguments->GetReturnValue()->Assign(pValue.get()); } else { pArguments->GetReturnValue()->SetNull(); @@ -1084,7 +1084,7 @@ void CXFA_Node::Script_Som_ResolveNodeList(CFXJSE_Value* pValue, } void CXFA_Node::Script_TreeClass_All(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1098,7 +1098,7 @@ void CXFA_Node::Script_TreeClass_All(CFXJSE_Value* pValue, } void CXFA_Node::Script_TreeClass_Nodes(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) @@ -1117,7 +1117,7 @@ void CXFA_Node::Script_TreeClass_Nodes(CFXJSE_Value* pValue, } void CXFA_Node::Script_TreeClass_ClassAll(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1130,7 +1130,7 @@ void CXFA_Node::Script_TreeClass_ClassAll(CFXJSE_Value* pValue, } void CXFA_Node::Script_TreeClass_Parent(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1146,7 +1146,7 @@ void CXFA_Node::Script_TreeClass_Parent(CFXJSE_Value* pValue, } void CXFA_Node::Script_TreeClass_Index(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1155,7 +1155,7 @@ void CXFA_Node::Script_TreeClass_Index(CFXJSE_Value* pValue, } void CXFA_Node::Script_TreeClass_ClassIndex(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1164,7 +1164,7 @@ void CXFA_Node::Script_TreeClass_ClassIndex(CFXJSE_Value* pValue, } void CXFA_Node::Script_TreeClass_SomExpression(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1273,7 +1273,7 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified( bParent = !!pArguments->GetInt32(1); if (iLength >= 3) iIndex = pArguments->GetInt32(2); - FX_BOOL bHas = FALSE; + bool bHas = false; const XFA_ATTRIBUTEINFO* pAttributeInfo = XFA_GetAttributeByName(wsExpression.AsStringC()); CFX_WideString wsValue; @@ -1325,7 +1325,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { XFA_RecognizeRichText(static_cast<CFDE_XMLElement*>(pXMLNode)))) { bIgnoreRoot = false; } - CXFA_Node* pFakeRoot = Clone(FALSE); + CXFA_Node* pFakeRoot = Clone(false); CFX_WideStringC wsContentType = GetCData(XFA_ATTRIBUTE_ContentType); if (!wsContentType.IsEmpty()) { pFakeRoot->SetCData(XFA_ATTRIBUTE_ContentType, @@ -1334,7 +1334,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { CFDE_XMLNode* pFakeXMLRoot = pFakeRoot->GetXMLMappingNode(); if (!pFakeXMLRoot) { CFDE_XMLNode* pThisXMLRoot = GetXMLMappingNode(); - pFakeXMLRoot = pThisXMLRoot ? pThisXMLRoot->Clone(FALSE) : nullptr; + pFakeXMLRoot = pThisXMLRoot ? pThisXMLRoot->Clone(false) : nullptr; } if (!pFakeXMLRoot) pFakeXMLRoot = new CFDE_XMLElement(CFX_WideString(GetClassName())); @@ -1386,7 +1386,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { pFakeXMLRoot = nullptr; } } - MoveBufferMapData(pFakeRoot, this, XFA_CalcData, TRUE); + MoveBufferMapData(pFakeRoot, this, XFA_CalcData, true); } else { CXFA_Node* pChild = pFakeRoot->GetNodeItem(XFA_NODEITEM_FirstChild); while (pChild) { @@ -1441,7 +1441,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) { XFA_DataExporter_DealWithDataGroupNode(this); } std::unique_ptr<IFX_MemoryStream, ReleaseDeleter<IFX_MemoryStream>> - pMemoryStream(FX_CreateMemoryStream(TRUE)); + pMemoryStream(FX_CreateMemoryStream(true)); std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> pStream( IFX_Stream::CreateStream( static_cast<IFX_SeekableWriteStream*>(pMemoryStream.get()), @@ -1454,7 +1454,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) { pStream->SetCodePage(FX_CODEPAGE_UTF8); pStream->WriteData(bsXMLHeader.raw_str(), bsXMLHeader.GetLength()); if (GetPacketID() == XFA_XDPPACKET_Form) - XFA_DataExporter_RegenerateFormFile(this, pStream.get(), nullptr, TRUE); + XFA_DataExporter_RegenerateFormFile(this, pStream.get(), nullptr, true); else pElement->SaveXMLNode(pStream.get()); // TODO(weili): Check whether we need to save pretty print XML, pdfium:501. @@ -1498,7 +1498,7 @@ void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_NodeClass_Ns(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1510,7 +1510,7 @@ void CXFA_Node::Script_NodeClass_Ns(CFXJSE_Value* pValue, } void CXFA_Node::Script_NodeClass_Model(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1521,7 +1521,7 @@ void CXFA_Node::Script_NodeClass_Model(CFXJSE_Value* pValue, } void CXFA_Node::Script_NodeClass_IsContainer(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1530,13 +1530,13 @@ void CXFA_Node::Script_NodeClass_IsContainer(CFXJSE_Value* pValue, } void CXFA_Node::Script_NodeClass_IsNull(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); } else { if (GetElementType() == XFA_Element::Subform) { - pValue->SetBoolean(FALSE); + pValue->SetBoolean(false); return; } CFX_WideString strValue; @@ -1545,7 +1545,7 @@ void CXFA_Node::Script_NodeClass_IsNull(CFXJSE_Value* pValue, } void CXFA_Node::Script_NodeClass_OneOfChild(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1592,15 +1592,15 @@ void CXFA_Node::Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_ModelClass_Context(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_ModelClass_AliasNode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_Attribute_Integer(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { SetInteger(eAttribute, pValue->ToInteger(), true); @@ -1610,7 +1610,7 @@ void CXFA_Node::Script_Attribute_Integer(CFXJSE_Value* pValue, } void CXFA_Node::Script_Attribute_IntegerRead(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { pValue->SetInteger(GetInteger(eAttribute)); @@ -1620,7 +1620,7 @@ void CXFA_Node::Script_Attribute_IntegerRead(CFXJSE_Value* pValue, } void CXFA_Node::Script_Attribute_BOOL(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { SetBoolean(eAttribute, pValue->ToBoolean(), true); @@ -1630,7 +1630,7 @@ void CXFA_Node::Script_Attribute_BOOL(CFXJSE_Value* pValue, } void CXFA_Node::Script_Attribute_BOOLRead(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { pValue->SetString(GetBoolean(eAttribute) ? "1" : "0"); @@ -1641,7 +1641,7 @@ void CXFA_Node::Script_Attribute_BOOLRead(CFXJSE_Value* pValue, void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( XFA_ATTRIBUTE eAttribute, - FX_BOOL bScriptModify) { + bool bScriptModify) { CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); if (!pLayoutPro) return; @@ -1793,7 +1793,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( } void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { CFX_WideString wsValue = pValue->ToWideString(); @@ -1838,7 +1838,7 @@ void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue, RemoveChild(pHeadChild); pHeadChild = pSibling; } - CXFA_Node* pProtoForm = pProtoNode->CloneTemplateToForm(TRUE); + CXFA_Node* pProtoForm = pProtoNode->CloneTemplateToForm(true); pHeadChild = pProtoForm->GetNodeItem(XFA_NODEITEM_FirstChild); while (pHeadChild) { CXFA_Node* pSibling = @@ -1860,7 +1860,7 @@ void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue, } void CXFA_Node::Script_Attribute_StringRead(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { CFX_WideString wsValue; @@ -1875,7 +1875,7 @@ void CXFA_Node::Script_Attribute_StringRead(CFXJSE_Value* pValue, void CXFA_Node::Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if ((argc == 0) || (argc == 1)) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execute"); } @@ -1890,29 +1890,29 @@ void CXFA_Node::Script_Delta_Restore(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_Delta_CurrentValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_Delta_SavedValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_Delta_Target(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_Som_Message(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_SOM_MESSAGETYPE iMessageType) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { return; } - FX_BOOL bNew = FALSE; + bool bNew = false; CXFA_Validate validate = pWidgetData->GetValidate(); if (!validate) { - validate = pWidgetData->GetValidate(TRUE); - bNew = TRUE; + validate = pWidgetData->GetValidate(true); + bNew = true; } if (bSetting) { switch (iMessageType) { @@ -1955,13 +1955,13 @@ void CXFA_Node::Script_Som_Message(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_ValidationMessage(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Script_Som_Message(pValue, bSetting, XFA_SOM_ValidationMessage); } void CXFA_Node::Script_Field_Length(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -1971,12 +1971,12 @@ void CXFA_Node::Script_Field_Length(CFXJSE_Value* pValue, pValue->SetInteger(0); return; } - pValue->SetInteger(pWidgetData->CountChoiceListItems(TRUE)); + pValue->SetInteger(pWidgetData->CountChoiceListItems(true)); } } void CXFA_Node::Script_Som_DefaultValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { XFA_Element eType = GetElementType(); if (eType == XFA_Element::Field) { @@ -2023,9 +2023,9 @@ void CXFA_Node::Script_Som_DefaultValue(CFXJSE_Value* pValue, if (pContainerWidgetData) { pContainerWidgetData->GetFormatDataValue(wsNewValue, wsFormatValue); } - SetScriptContent(wsNewValue, wsFormatValue, true, TRUE); + SetScriptContent(wsNewValue, wsFormatValue, true, true); } else { - CFX_WideString content = GetScriptContent(TRUE); + CFX_WideString content = GetScriptContent(true); if (content.IsEmpty() && eType != XFA_Element::Text && eType != XFA_Element::SubmitUrl) { pValue->SetNull(); @@ -2042,13 +2042,13 @@ void CXFA_Node::Script_Som_DefaultValue(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_DefaultValue_Read(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); return; } - CFX_WideString content = GetScriptContent(TRUE); + CFX_WideString content = GetScriptContent(true); if (content.IsEmpty()) { pValue->SetNull(); } else { @@ -2058,7 +2058,7 @@ void CXFA_Node::Script_Som_DefaultValue_Read(CFXJSE_Value* pValue, } void CXFA_Node::Script_Boolean_Value(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { CFX_ByteString newValue; @@ -2072,21 +2072,21 @@ void CXFA_Node::Script_Boolean_Value(CFXJSE_Value* pValue, if (pContainerWidgetData) { pContainerWidgetData->GetFormatDataValue(wsNewValue, wsFormatValue); } - SetScriptContent(wsNewValue, wsFormatValue, true, TRUE); + SetScriptContent(wsNewValue, wsFormatValue, true, true); } else { - CFX_WideString wsValue = GetScriptContent(TRUE); + CFX_WideString wsValue = GetScriptContent(true); pValue->SetBoolean(wsValue == FX_WSTRC(L"1")); } } void CXFA_Node::Script_Som_BorderColor(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { return; } - CXFA_Border border = pWidgetData->GetBorder(TRUE); + CXFA_Border border = pWidgetData->GetBorder(true); int32_t iSize = border.CountEdges(); if (bSetting) { int32_t r = 0; @@ -2110,13 +2110,13 @@ void CXFA_Node::Script_Som_BorderColor(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { return; } - CXFA_Border border = pWidgetData->GetBorder(TRUE); + CXFA_Border border = pWidgetData->GetBorder(true); int32_t iSize = border.CountEdges(); CFX_WideString wsThickness; if (bSetting) { @@ -2135,14 +2135,14 @@ void CXFA_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_FillColor(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { return; } - CXFA_Border border = pWidgetData->GetBorder(TRUE); - CXFA_Fill borderfill = border.GetFill(TRUE); + CXFA_Border border = pWidgetData->GetBorder(true); + CXFA_Fill borderfill = border.GetFill(true); CXFA_Node* pNode = borderfill.GetNode(); if (!pNode) { return; @@ -2168,7 +2168,7 @@ void CXFA_Node::Script_Som_FillColor(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_DataNode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { CXFA_Node* pDataNode = GetBindData(); @@ -2184,7 +2184,7 @@ void CXFA_Node::Script_Som_DataNode(CFXJSE_Value* pValue, } void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { if (pValue && pValue->IsString()) { @@ -2194,11 +2194,11 @@ void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue, if (uiType == XFA_Element::Text) { CFX_WideString wsNewValue = pValue->ToWideString(); CFX_WideString wsFormatValue(wsNewValue); - SetScriptContent(wsNewValue, wsFormatValue, true, TRUE); + SetScriptContent(wsNewValue, wsFormatValue, true, true); } } } else { - CFX_WideString content = GetScriptContent(TRUE); + CFX_WideString content = GetScriptContent(true); if (content.IsEmpty()) { pValue->SetNull(); } else { @@ -2209,7 +2209,7 @@ void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue, } void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2218,10 +2218,10 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue, if (bSetting) { if (pValue && pValue->IsNull()) { pWidgetData->m_bPreNull = pWidgetData->m_bIsNull; - pWidgetData->m_bIsNull = TRUE; + pWidgetData->m_bIsNull = true; } else { pWidgetData->m_bPreNull = pWidgetData->m_bIsNull; - pWidgetData->m_bIsNull = FALSE; + pWidgetData->m_bIsNull = false; } CFX_WideString wsNewText; if (!(pValue && (pValue->IsNull() || pValue->IsUndefined()))) @@ -2241,9 +2241,9 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue, if (pContainerWidgetData) { pContainerWidgetData->GetFormatDataValue(wsNewText, wsFormatText); } - SetScriptContent(wsNewText, wsFormatText, true, TRUE); + SetScriptContent(wsNewText, wsFormatText, true, true); } else { - CFX_WideString content = GetScriptContent(TRUE); + CFX_WideString content = GetScriptContent(true); if (content.IsEmpty()) { pValue->SetNull(); } else { @@ -2262,7 +2262,7 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue, } else if (pNode && pNode->GetElementType() == XFA_Element::Integer) { pValue->SetInteger(FXSYS_wtoi(content.c_str())); } else if (pNode && pNode->GetElementType() == XFA_Element::Boolean) { - pValue->SetBoolean(FXSYS_wtoi(content.c_str()) == 0 ? FALSE : TRUE); + pValue->SetBoolean(FXSYS_wtoi(content.c_str()) == 0 ? false : true); } else if (pNode && pNode->GetElementType() == XFA_Element::Float) { CFX_Decimal decimal(content.AsStringC()); pValue->SetFloat((FX_FLOAT)(double)decimal); @@ -2275,7 +2275,7 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue, } void CXFA_Node::Script_Field_EditValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2291,13 +2291,13 @@ void CXFA_Node::Script_Field_EditValue(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_FontColor(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { return; } - CXFA_Font font = pWidgetData->GetFont(TRUE); + CXFA_Font font = pWidgetData->GetFont(true); CXFA_Node* pNode = font.GetNode(); if (!pNode) { return; @@ -2323,13 +2323,13 @@ void CXFA_Node::Script_Som_FontColor(CFXJSE_Value* pValue, } void CXFA_Node::Script_Field_FormatMessage(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Script_Som_Message(pValue, bSetting, XFA_SOM_FormatMessage); } void CXFA_Node::Script_Field_FormattedValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2345,13 +2345,13 @@ void CXFA_Node::Script_Field_FormattedValue(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_Mandatory(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { return; } - CXFA_Validate validate = pWidgetData->GetValidate(TRUE); + CXFA_Validate validate = pWidgetData->GetValidate(true); if (bSetting) { validate.SetNullTest(pValue->ToWideString()); } else { @@ -2366,13 +2366,13 @@ void CXFA_Node::Script_Som_Mandatory(CFXJSE_Value* pValue, } void CXFA_Node::Script_Som_MandatoryMessage(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { Script_Som_Message(pValue, bSetting, XFA_SOM_MandatoryMessage); } void CXFA_Node::Script_Field_ParentSubform(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -2382,7 +2382,7 @@ void CXFA_Node::Script_Field_ParentSubform(CFXJSE_Value* pValue, } void CXFA_Node::Script_Field_SelectedIndex(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2394,7 +2394,7 @@ void CXFA_Node::Script_Field_SelectedIndex(CFXJSE_Value* pValue, pWidgetData->ClearAllSelections(); return; } - pWidgetData->SetItemState(iIndex, TRUE, true, TRUE, TRUE); + pWidgetData->SetItemState(iIndex, true, true, true, true); } else { pValue->SetInteger(pWidgetData->GetSelectedItem()); } @@ -2405,7 +2405,7 @@ void CXFA_Node::Script_Field_ClearItems(CFXJSE_Arguments* pArguments) { if (!pWidgetData) { return; } - pWidgetData->DeleteItem(-1, TRUE); + pWidgetData->DeleteItem(-1, true); } void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) { @@ -2417,7 +2417,7 @@ void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) { XFA_Element::Field); if (eventString == "validate") { pArguments->GetReturnValue()->SetBoolean( - (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE); + (iRet == XFA_EVENTERROR_Error) ? false : true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent"); @@ -2431,7 +2431,7 @@ void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) { if (!pNotify) { return; } - pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize, FALSE, FALSE); + pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize, false, false); } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execInitialize"); } @@ -2448,7 +2448,7 @@ void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) { return; } int32_t iIndex = pArguments->GetInt32(0); - FX_BOOL bValue = pWidgetData->DeleteItem(iIndex, TRUE, TRUE); + bool bValue = pWidgetData->DeleteItem(iIndex, true, true); CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) pValue->SetBoolean(bValue); @@ -2471,7 +2471,7 @@ void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) { return; } CFX_WideString wsValue; - FX_BOOL bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, TRUE); + bool bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, true); if (bHasItem) { pArguments->GetReturnValue()->SetString( FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC()); @@ -2510,7 +2510,7 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) { return; } int32_t iIndex = pArguments->GetInt32(0); - FX_BOOL bValue = pWidgetData->GetItemState(iIndex); + bool bValue = pWidgetData->GetItemState(iIndex); CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) pValue->SetBoolean(bValue); @@ -2523,7 +2523,7 @@ void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments) { if (!pNotify) { return; } - pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate, FALSE, FALSE); + pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate, false, false); } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execCalculate"); } @@ -2548,7 +2548,7 @@ void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) { return; } CFX_WideString wsValue; - FX_BOOL bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, FALSE); + bool bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, false); if (bHasItem) { pArguments->GetReturnValue()->SetString( FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC()); @@ -2569,10 +2569,10 @@ void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) { int32_t iIndex = pArguments->GetInt32(0); if (pArguments->GetInt32(1) != 0) { - pWidgetData->SetItemState(iIndex, TRUE, true, TRUE, TRUE); + pWidgetData->SetItemState(iIndex, true, true, true, true); } else { if (pWidgetData->GetItemState(iIndex)) - pWidgetData->SetItemState(iIndex, FALSE, true, TRUE, TRUE); + pWidgetData->SetItemState(iIndex, false, true, true, true); } } @@ -2596,7 +2596,7 @@ void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) { CFX_ByteString bsValue = pArguments->GetUTF8String(1); wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); } - pWidgetData->InsertItem(wsLabel, wsValue, -1, TRUE); + pWidgetData->InsertItem(wsLabel, wsValue, -1, true); } void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) { @@ -2604,12 +2604,12 @@ void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { int32_t iRet = - pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE); + pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, false, false); pArguments->GetReturnValue()->SetBoolean( - (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE); + (iRet == XFA_EVENTERROR_Error) ? false : true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); @@ -2617,7 +2617,7 @@ void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_ExclGroup_ErrorText(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { } else { @@ -2626,7 +2626,7 @@ void CXFA_Node::Script_ExclGroup_ErrorText(CFXJSE_Value* pValue, } void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2634,9 +2634,9 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, } if (bSetting) { pWidgetData->SetSelectedMemberByValue(pValue->ToWideString().AsStringC(), - true, TRUE, TRUE); + true, true, true); } else { - CFX_WideString wsValue = GetScriptContent(TRUE); + CFX_WideString wsValue = GetScriptContent(true); XFA_VERSION curVersion = GetDocument()->GetCurVersionMode(); if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) { pValue->SetNull(); @@ -2647,7 +2647,7 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, } void CXFA_Node::Script_ExclGroup_Transient(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) { @@ -2723,11 +2723,11 @@ void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); pArguments->GetReturnValue()->SetBoolean( - (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE); + (iRet == XFA_EVENTERROR_Error) ? false : true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); @@ -2735,7 +2735,7 @@ void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_Som_InstanceIndex(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { int32_t iTo = pValue->ToInteger(); @@ -2771,7 +2771,7 @@ void CXFA_Node::Script_Som_InstanceIndex(CFXJSE_Value* pValue, } void CXFA_Node::Script_Subform_InstanceManager(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { CFX_WideStringC wsName = GetCData(XFA_ATTRIBUTE_Name); @@ -2799,10 +2799,10 @@ void CXFA_Node::Script_Subform_InstanceManager(CFXJSE_Value* pValue, } void CXFA_Node::Script_Subform_Locale(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { - SetCData(XFA_ATTRIBUTE_Locale, pValue->ToWideString(), true, TRUE); + SetCData(XFA_ATTRIBUTE_Locale, pValue->ToWideString(), true, true); } else { CFX_WideString wsLocaleName; GetLocaleName(wsLocaleName); @@ -2855,11 +2855,11 @@ void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); pArguments->GetReturnValue()->SetBoolean( - (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE); + (iRet == XFA_EVENTERROR_Error) ? false : true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); @@ -2891,7 +2891,7 @@ int32_t CXFA_Node::Subform_and_SubformSet_InstanceIndex() { void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 1) { - pArguments->GetReturnValue()->SetBoolean(TRUE); + pArguments->GetReturnValue()->SetBoolean(true); } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"formNodes"); } @@ -2900,7 +2900,7 @@ void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Template_Remerge(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - m_pDocument->DoDataRemerge(TRUE); + m_pDocument->DoDataRemerge(true); } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"remerge"); } @@ -2911,9 +2911,9 @@ void CXFA_Node::Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { - pArguments->GetReturnValue()->SetBoolean(TRUE); + pArguments->GetReturnValue()->SetBoolean(true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execInitialize"); @@ -2966,7 +2966,7 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Template_Recalculate(CFXJSE_Arguments* pArguments) { if (pArguments->GetLength() == 1) { - pArguments->GetReturnValue()->SetBoolean(TRUE); + pArguments->GetReturnValue()->SetBoolean(true); } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"recalculate"); } @@ -2977,9 +2977,9 @@ void CXFA_Node::Script_Template_ExecCalculate(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { - pArguments->GetReturnValue()->SetBoolean(TRUE); + pArguments->GetReturnValue()->SetBoolean(true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execCalculate"); @@ -2991,9 +2991,9 @@ void CXFA_Node::Script_Template_ExecValidate(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { - pArguments->GetReturnValue()->SetBoolean(TRUE); + pArguments->GetReturnValue()->SetBoolean(true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); @@ -3005,9 +3005,9 @@ void CXFA_Node::Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { - pArguments->GetReturnValue()->SetBoolean(TRUE); + pArguments->GetReturnValue()->SetBoolean(true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"evaluate"); @@ -3015,7 +3015,7 @@ void CXFA_Node::Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_InstanceManager_Max(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -3026,7 +3026,7 @@ void CXFA_Node::Script_InstanceManager_Max(CFXJSE_Value* pValue, } void CXFA_Node::Script_InstanceManager_Min(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -3037,7 +3037,7 @@ void CXFA_Node::Script_InstanceManager_Min(CFXJSE_Value* pValue, } void CXFA_Node::Script_InstanceManager_Count(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { int32_t iDesired = pValue->ToInteger(); @@ -3129,9 +3129,9 @@ void CXFA_Node::Script_InstanceManager_AddInstance( ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addInstance"); return; } - FX_BOOL fFlags = TRUE; + bool fFlags = true; if (argc == 1) { - fFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE; + fFlags = pArguments->GetInt32(0) == 0 ? false : true; } int32_t iCount = GetCount(this); CXFA_Occur nodeOccur(GetOccurNode()); @@ -3141,7 +3141,7 @@ void CXFA_Node::Script_InstanceManager_AddInstance( return; } CXFA_Node* pNewInstance = CreateInstance(this, fFlags); - InsertItem(this, pNewInstance, iCount, iCount, FALSE); + InsertItem(this, pNewInstance, iCount, iCount, false); pArguments->GetReturnValue()->Assign( m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); @@ -3165,9 +3165,9 @@ void CXFA_Node::Script_InstanceManager_InsertInstance( return; } int32_t iIndex = pArguments->GetInt32(0); - FX_BOOL bBind = FALSE; + bool bBind = false; if (argc == 2) { - bBind = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; + bBind = pArguments->GetInt32(1) == 0 ? false : true; } CXFA_Occur nodeOccur(GetOccurNode()); int32_t iCount = GetCount(this); @@ -3181,7 +3181,7 @@ void CXFA_Node::Script_InstanceManager_InsertInstance( return; } CXFA_Node* pNewInstance = CreateInstance(this, bBind); - InsertItem(this, pNewInstance, iIndex, iCount, TRUE); + InsertItem(this, pNewInstance, iIndex, iCount, true); pArguments->GetReturnValue()->Assign( m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); @@ -3230,7 +3230,7 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) { continue; } if (pRemoveInstance->GetElementType() == XFA_Element::InstanceManager) { - ASSERT(FALSE); + ASSERT(false); break; } if (pRemoveInstance->GetNameHash() == dInstanceNameHash) { @@ -3240,8 +3240,8 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) { } } else if (iDesired > iCount) { while (iCount < iDesired) { - CXFA_Node* pNewInstance = CreateInstance(this, TRUE); - InsertItem(this, pNewInstance, iCount, iCount, FALSE); + CXFA_Node* pNewInstance = CreateInstance(this, true); + InsertItem(this, pNewInstance, iCount, iCount, false); iCount++; CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { @@ -3268,8 +3268,8 @@ int32_t CXFA_Node::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom) { return 0; } CXFA_Node* pMoveInstance = GetItem(this, iFrom); - RemoveItem(this, pMoveInstance, FALSE); - InsertItem(this, pMoveInstance, iTo, iCount - 1, TRUE); + RemoveItem(this, pMoveInstance, false); + InsertItem(this, pMoveInstance, iTo, iCount - 1, true); CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); if (pLayoutPro) { pLayoutPro->AddChangedContainer( @@ -3279,7 +3279,7 @@ int32_t CXFA_Node::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom) { } void CXFA_Node::Script_Occur_Max(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_Occur occur(this); if (bSetting) { @@ -3291,7 +3291,7 @@ void CXFA_Node::Script_Occur_Max(CFXJSE_Value* pValue, } void CXFA_Node::Script_Occur_Min(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { CXFA_Occur occur(this); if (bSetting) { @@ -3332,7 +3332,7 @@ void CXFA_Node::Script_Form_FormNodes(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Form_Remerge(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - m_pDocument->DoDataRemerge(TRUE); + m_pDocument->DoDataRemerge(true); } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"remerge"); } @@ -3368,7 +3368,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) { if (bScriptFlags) { pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); - pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Ready, TRUE); + pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Ready, true); } else { } } else { @@ -3394,11 +3394,11 @@ void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) { if (argc == 0) { CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { - pArguments->GetReturnValue()->SetBoolean(FALSE); + pArguments->GetReturnValue()->SetBoolean(false); } else { int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); pArguments->GetReturnValue()->SetBoolean( - (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE); + (iRet == XFA_EVENTERROR_Error) ? false : true); } } else { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); @@ -3406,13 +3406,13 @@ void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_Form_Checksum(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { SetAttribute(XFA_ATTRIBUTE_Checksum, pValue->ToWideString().AsStringC()); } else { CFX_WideString wsChecksum; - GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE); + GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, false); pValue->SetString( FX_UTF8Encode(wsChecksum.c_str(), wsChecksum.GetLength()).AsStringC()); } @@ -3473,7 +3473,7 @@ void CXFA_Node::Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_Packet_Content(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); @@ -3630,11 +3630,11 @@ void CXFA_Node::Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments) { } void CXFA_Node::Script_Source_Db(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_Xfa_This(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { CXFA_Object* pThis = m_pDocument->GetScriptContext()->GetThisObject(); @@ -3644,19 +3644,19 @@ void CXFA_Node::Script_Xfa_This(CFXJSE_Value* pValue, } void CXFA_Node::Script_Handler_Version(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_SubmitFormat_Mode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_Extras_Type(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} void CXFA_Node::Script_Script_Stateless(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); @@ -3666,20 +3666,20 @@ void CXFA_Node::Script_Script_Stateless(CFXJSE_Value* pValue, } void CXFA_Node::Script_Encrypt_Format(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) {} -FX_BOOL CXFA_Node::HasAttribute(XFA_ATTRIBUTE eAttr, FX_BOOL bCanInherit) { +bool CXFA_Node::HasAttribute(XFA_ATTRIBUTE eAttr, bool bCanInherit) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); return HasMapModuleKey(pKey, bCanInherit); } -FX_BOOL CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr, - const CFX_WideStringC& wsValue, - bool bNotify) { +bool CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr, + const CFX_WideStringC& wsValue, + bool bNotify) { const XFA_ATTRIBUTEINFO* pAttr = XFA_GetAttributeByID(eAttr); if (!pAttr) - return FALSE; + return false; XFA_ATTRIBUTETYPE eType = pAttr->eType; if (eType == XFA_ATTRIBUTETYPE_NOTSURE) { @@ -3709,15 +3709,15 @@ FX_BOOL CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr, default: break; } - return FALSE; + return false; } -FX_BOOL CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr, - CFX_WideString& wsValue, - FX_BOOL bUseDefault) { +bool CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr, + CFX_WideString& wsValue, + bool bUseDefault) { const XFA_ATTRIBUTEINFO* pAttr = XFA_GetAttributeByID(eAttr); if (!pAttr) { - return FALSE; + return false; } XFA_ATTRIBUTETYPE eType = pAttr->eType; if (eType == XFA_ATTRIBUTETYPE_NOTSURE) { @@ -3729,64 +3729,64 @@ FX_BOOL CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr, case XFA_ATTRIBUTETYPE_Enum: { XFA_ATTRIBUTEENUM eValue; if (!TryEnum(pAttr->eName, eValue, bUseDefault)) { - return FALSE; + return false; } wsValue = GetAttributeEnumByID(eValue)->pName; - return TRUE; + return true; } break; case XFA_ATTRIBUTETYPE_Cdata: { CFX_WideStringC wsValueC; if (!TryCData(pAttr->eName, wsValueC, bUseDefault)) { - return FALSE; + return false; } wsValue = wsValueC; - return TRUE; + return true; } break; case XFA_ATTRIBUTETYPE_Boolean: { - FX_BOOL bValue; + bool bValue; if (!TryBoolean(pAttr->eName, bValue, bUseDefault)) { - return FALSE; + return false; } wsValue = bValue ? FX_WSTRC(L"1") : FX_WSTRC(L"0"); - return TRUE; + return true; } break; case XFA_ATTRIBUTETYPE_Integer: { int32_t iValue; if (!TryInteger(pAttr->eName, iValue, bUseDefault)) { - return FALSE; + return false; } wsValue.Format(L"%d", iValue); - return TRUE; + return true; } break; case XFA_ATTRIBUTETYPE_Measure: { CXFA_Measurement mValue; if (!TryMeasure(pAttr->eName, mValue, bUseDefault)) { - return FALSE; + return false; } mValue.ToString(wsValue); - return TRUE; + return true; } break; default: break; } - return FALSE; + return false; } -FX_BOOL CXFA_Node::SetAttribute(const CFX_WideStringC& wsAttr, - const CFX_WideStringC& wsValue, - bool bNotify) { +bool CXFA_Node::SetAttribute(const CFX_WideStringC& wsAttr, + const CFX_WideStringC& wsValue, + bool bNotify) { const XFA_ATTRIBUTEINFO* pAttributeInfo = XFA_GetAttributeByName(wsValue); if (pAttributeInfo) { return SetAttribute(pAttributeInfo->eName, wsValue, bNotify); } void* pKey = GetMapKey_Custom(wsAttr); SetMapModuleString(pKey, wsValue); - return TRUE; + return true; } -FX_BOOL CXFA_Node::GetAttribute(const CFX_WideStringC& wsAttr, - CFX_WideString& wsValue, - FX_BOOL bUseDefault) { +bool CXFA_Node::GetAttribute(const CFX_WideStringC& wsAttr, + CFX_WideString& wsValue, + bool bUseDefault) { const XFA_ATTRIBUTEINFO* pAttributeInfo = XFA_GetAttributeByName(wsAttr); if (pAttributeInfo) { return GetAttribute(pAttributeInfo->eName, wsValue, bUseDefault); @@ -3796,83 +3796,83 @@ FX_BOOL CXFA_Node::GetAttribute(const CFX_WideStringC& wsAttr, if (GetMapModuleString(pKey, wsValueC)) { wsValue = wsValueC; } - return TRUE; + return true; } -FX_BOOL CXFA_Node::RemoveAttribute(const CFX_WideStringC& wsAttr) { +bool CXFA_Node::RemoveAttribute(const CFX_WideStringC& wsAttr) { void* pKey = GetMapKey_Custom(wsAttr); RemoveMapModuleKey(pKey); - return TRUE; + return true; } -FX_BOOL CXFA_Node::TryBoolean(XFA_ATTRIBUTE eAttr, - FX_BOOL& bValue, - FX_BOOL bUseDefault) { +bool CXFA_Node::TryBoolean(XFA_ATTRIBUTE eAttr, + bool& bValue, + bool bUseDefault) { void* pValue = nullptr; if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, bUseDefault, pValue)) - return FALSE; + return false; bValue = !!pValue; - return TRUE; + return true; } -FX_BOOL CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr, - int32_t& iValue, - FX_BOOL bUseDefault) { +bool CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr, + int32_t& iValue, + bool bUseDefault) { void* pValue = nullptr; if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, bUseDefault, pValue)) - return FALSE; + return false; iValue = (int32_t)(uintptr_t)pValue; - return TRUE; + return true; } -FX_BOOL CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr, - XFA_ATTRIBUTEENUM& eValue, - FX_BOOL bUseDefault) { +bool CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr, + XFA_ATTRIBUTEENUM& eValue, + bool bUseDefault) { void* pValue = nullptr; if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, bUseDefault, pValue)) - return FALSE; + return false; eValue = (XFA_ATTRIBUTEENUM)(uintptr_t)pValue; - return TRUE; + return true; } -FX_BOOL CXFA_Node::SetMeasure(XFA_ATTRIBUTE eAttr, - CXFA_Measurement mValue, - bool bNotify) { +bool CXFA_Node::SetMeasure(XFA_ATTRIBUTE eAttr, + CXFA_Measurement mValue, + bool bNotify) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); OnChanging(eAttr, bNotify); SetMapModuleBuffer(pKey, &mValue, sizeof(CXFA_Measurement)); - OnChanged(eAttr, bNotify, FALSE); - return TRUE; + OnChanged(eAttr, bNotify, false); + return true; } -FX_BOOL CXFA_Node::TryMeasure(XFA_ATTRIBUTE eAttr, - CXFA_Measurement& mValue, - FX_BOOL bUseDefault) const { +bool CXFA_Node::TryMeasure(XFA_ATTRIBUTE eAttr, + CXFA_Measurement& mValue, + bool bUseDefault) const { void* pKey = GetMapKey_Element(GetElementType(), eAttr); void* pValue; int32_t iBytes; if (GetMapModuleBuffer(pKey, pValue, iBytes) && iBytes == sizeof(mValue)) { FXSYS_memcpy(&mValue, pValue, sizeof(mValue)); - return TRUE; + return true; } if (bUseDefault && XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr, XFA_ATTRIBUTETYPE_Measure, m_ePacket)) { FXSYS_memcpy(&mValue, pValue, sizeof(mValue)); - return TRUE; + return true; } - return FALSE; + return false; } CXFA_Measurement CXFA_Node::GetMeasure(XFA_ATTRIBUTE eAttr) const { CXFA_Measurement mValue; - return TryMeasure(eAttr, mValue, TRUE) ? mValue : CXFA_Measurement(); + return TryMeasure(eAttr, mValue, true) ? mValue : CXFA_Measurement(); } -FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, - const CFX_WideString& wsValue, - bool bNotify, - FX_BOOL bScriptModify) { +bool CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, + const CFX_WideString& wsValue, + bool bNotify, + bool bScriptModify) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); OnChanging(eAttr, bNotify); if (eAttr == XFA_ATTRIBUTE_Value) { @@ -3887,13 +3887,13 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, if (!IsNeedSavingXMLNode() || eAttr == XFA_ATTRIBUTE_QualifiedName || eAttr == XFA_ATTRIBUTE_BindingNode) { - return TRUE; + return true; } if (eAttr == XFA_ATTRIBUTE_Name && (m_elementType == XFA_Element::DataValue || m_elementType == XFA_Element::DataGroup)) { - return TRUE; + return true; } if (eAttr == XFA_ATTRIBUTE_Value) { @@ -3905,7 +3905,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, ->SetString(CFX_WideString(GetCData(XFA_ATTRIBUTE_QualifiedName)), wsValue); } else { - FX_BOOL bDeleteChildren = TRUE; + bool bDeleteChildren = true; if (GetPacketID() == XFA_XDPPACKET_Datasets) { for (CXFA_Node* pChildDataNode = GetNodeItem(XFA_NODEITEM_FirstChild); @@ -3913,7 +3913,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, XFA_NODEITEM_NextSibling)) { CXFA_NodeArray formNodes; if (pChildDataNode->GetBindItems(formNodes) > 0) { - bDeleteChildren = FALSE; + bDeleteChildren = false; break; } } @@ -3930,7 +3930,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, default: ASSERT(0); } - return TRUE; + return true; } const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttr); @@ -3942,13 +3942,13 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, } static_cast<CFDE_XMLElement*>(m_pXMLNode)->SetString(wsAttrName, wsValue); } - return TRUE; + return true; } -FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, - const CFX_WideString& wsXMLValue, - bool bNotify, - FX_BOOL bScriptModify) { +bool CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, + const CFX_WideString& wsXMLValue, + bool bNotify, + bool bScriptModify) { void* pKey = GetMapKey_Element(GetElementType(), XFA_ATTRIBUTE_Value); OnChanging(XFA_ATTRIBUTE_Value, bNotify); CFX_WideString* pClone = new CFX_WideString(wsValue); @@ -3963,7 +3963,7 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, ->SetString(CFX_WideString(GetCData(XFA_ATTRIBUTE_QualifiedName)), wsXMLValue); } else { - FX_BOOL bDeleteChildren = TRUE; + bool bDeleteChildren = true; if (GetPacketID() == XFA_XDPPACKET_Datasets) { for (CXFA_Node* pChildDataNode = GetNodeItem(XFA_NODEITEM_FirstChild); @@ -3971,7 +3971,7 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, XFA_NODEITEM_NextSibling)) { CXFA_NodeArray formNodes; if (pChildDataNode->GetBindItems(formNodes) > 0) { - bDeleteChildren = FALSE; + bDeleteChildren = false; break; } } @@ -3989,88 +3989,88 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, ASSERT(0); } } - return TRUE; + return true; } -FX_BOOL CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr, - CFX_WideString& wsValue, - FX_BOOL bUseDefault, - FX_BOOL bProto) { +bool CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr, + CFX_WideString& wsValue, + bool bUseDefault, + bool bProto) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); if (eAttr == XFA_ATTRIBUTE_Value) { CFX_WideString* pStr = (CFX_WideString*)GetUserData(pKey, bProto); if (pStr) { wsValue = *pStr; - return TRUE; + return true; } } else { CFX_WideStringC wsValueC; if (GetMapModuleString(pKey, wsValueC)) { wsValue = wsValueC; - return TRUE; + return true; } } if (!bUseDefault) { - return FALSE; + return false; } void* pValue = nullptr; if (XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr, XFA_ATTRIBUTETYPE_Cdata, m_ePacket)) { wsValue = (const FX_WCHAR*)pValue; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr, - CFX_WideStringC& wsValue, - FX_BOOL bUseDefault, - FX_BOOL bProto) { +bool CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr, + CFX_WideStringC& wsValue, + bool bUseDefault, + bool bProto) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); if (eAttr == XFA_ATTRIBUTE_Value) { CFX_WideString* pStr = (CFX_WideString*)GetUserData(pKey, bProto); if (pStr) { wsValue = pStr->AsStringC(); - return TRUE; + return true; } } else { if (GetMapModuleString(pKey, wsValue)) { - return TRUE; + return true; } } if (!bUseDefault) { - return FALSE; + return false; } void* pValue = nullptr; if (XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr, XFA_ATTRIBUTETYPE_Cdata, m_ePacket)) { wsValue = (CFX_WideStringC)(const FX_WCHAR*)pValue; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_Node::SetObject(XFA_ATTRIBUTE eAttr, - void* pData, - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { +bool CXFA_Node::SetObject(XFA_ATTRIBUTE eAttr, + void* pData, + XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); return SetUserData(pKey, pData, pCallbackInfo); } -FX_BOOL CXFA_Node::TryObject(XFA_ATTRIBUTE eAttr, void*& pData) { +bool CXFA_Node::TryObject(XFA_ATTRIBUTE eAttr, void*& pData) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); pData = GetUserData(pKey); return !!pData; } -FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, - XFA_ATTRIBUTETYPE eType, - void* pValue, - bool bNotify) { +bool CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, + XFA_ATTRIBUTETYPE eType, + void* pValue, + bool bNotify) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); OnChanging(eAttr, bNotify); SetMapModuleValue(pKey, pValue); - OnChanged(eAttr, bNotify, FALSE); + OnChanged(eAttr, bNotify, false); if (IsNeedSavingXMLNode()) { ASSERT(m_pXMLNode->GetType() == FDE_XMLNODE_Element); const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttr); @@ -4096,45 +4096,45 @@ FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, } } } - return TRUE; + return true; } -FX_BOOL CXFA_Node::GetValue(XFA_ATTRIBUTE eAttr, - XFA_ATTRIBUTETYPE eType, - FX_BOOL bUseDefault, - void*& pValue) { +bool CXFA_Node::GetValue(XFA_ATTRIBUTE eAttr, + XFA_ATTRIBUTETYPE eType, + bool bUseDefault, + void*& pValue) { void* pKey = GetMapKey_Element(GetElementType(), eAttr); if (GetMapModuleValue(pKey, pValue)) { - return TRUE; + return true; } if (!bUseDefault) { - return FALSE; + return false; } return XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr, eType, m_ePacket); } -FX_BOOL CXFA_Node::SetUserData(void* pKey, - void* pData, - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { +bool CXFA_Node::SetUserData(void* pKey, + void* pData, + XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { SetMapModuleBuffer(pKey, &pData, sizeof(void*), pCallbackInfo ? pCallbackInfo : &gs_XFADefaultFreeData); - return TRUE; + return true; } -FX_BOOL CXFA_Node::TryUserData(void* pKey, void*& pData, FX_BOOL bProtoAlso) { +bool CXFA_Node::TryUserData(void* pKey, void*& pData, bool bProtoAlso) { int32_t iBytes = 0; if (!GetMapModuleBuffer(pKey, pData, iBytes, bProtoAlso)) { - return FALSE; + return false; } return iBytes == sizeof(void*) && FXSYS_memcpy(&pData, pData, iBytes); } -FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, - const CFX_WideString& wsXMLValue, - bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData) { +bool CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, + const CFX_WideString& wsXMLValue, + bool bNotify, + bool bScriptModify, + bool bSyncData) { CXFA_Node* pNode = nullptr; CXFA_Node* pBindNode = nullptr; switch (GetObjectType()) { @@ -4145,7 +4145,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, ASSERT(pChildValue); pChildValue->SetCData(XFA_ATTRIBUTE_ContentType, L"text/xml"); pChildValue->SetScriptContent(wsContent, wsContent, bNotify, - bScriptModify, FALSE); + bScriptModify, false); CXFA_Node* pBind = GetBindData(); if (bSyncData && pBind) { CFX_WideStringArray wsSaveTextArray; @@ -4200,7 +4200,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, pValueNode; pValueNode = pValueNode->GetNodeItem( XFA_NODEITEM_NextSibling)) { pValueNode->SetAttributeValue(wsSaveTextArray[i], - wsSaveTextArray[i], FALSE); + wsSaveTextArray[i], false); i++; } } @@ -4209,7 +4209,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, for (int32_t i = 0; i < nodeArray.GetSize(); i++) { if (nodeArray[i] != this) { nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify, - bScriptModify, FALSE); + bScriptModify, false); } } } @@ -4221,18 +4221,18 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, CXFA_Node* pChildValue = pValue->GetNodeItem(XFA_NODEITEM_FirstChild); ASSERT(pChildValue); pChildValue->SetScriptContent(wsContent, wsContent, bNotify, - bScriptModify, FALSE); + bScriptModify, false); } pBindNode = GetBindData(); if (pBindNode && bSyncData) { pBindNode->SetScriptContent(wsContent, wsXMLValue, bNotify, - bScriptModify, FALSE); + bScriptModify, false); CXFA_NodeArray nodeArray; pBindNode->GetBindItems(nodeArray); for (int32_t i = 0; i < nodeArray.GetSize(); i++) { if (nodeArray[i] != this) { nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify, true, - FALSE); + false); } } } @@ -4242,7 +4242,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, case XFA_ObjectType::ContentNode: { CFX_WideString wsContentType; if (GetElementType() == XFA_Element::ExData) { - GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); + GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false); if (wsContentType == FX_WSTRC(L"text/html")) { wsContentType = FX_WSTRC(L""); SetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType.AsStringC()); @@ -4275,7 +4275,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, pBindNode = pParent->GetBindData(); if (pBindNode) { pBindNode->SetScriptContent(wsContent, wsXMLValue, bNotify, - bScriptModify, FALSE); + bScriptModify, false); } } } @@ -4295,24 +4295,24 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, pBindNode->GetBindItems(nodeArray); for (int32_t i = 0; i < nodeArray.GetSize(); i++) { nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify, - bScriptModify, FALSE); + bScriptModify, false); } } - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_Node::SetContent(const CFX_WideString& wsContent, - const CFX_WideString& wsXMLValue, - bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData) { +bool CXFA_Node::SetContent(const CFX_WideString& wsContent, + const CFX_WideString& wsXMLValue, + bool bNotify, + bool bScriptModify, + bool bSyncData) { return SetScriptContent(wsContent, wsXMLValue, bNotify, bScriptModify, bSyncData); } -CFX_WideString CXFA_Node::GetScriptContent(FX_BOOL bScriptModify) { +CFX_WideString CXFA_Node::GetScriptContent(bool bScriptModify) { CFX_WideString wsContent; return TryContent(wsContent, bScriptModify) ? wsContent : CFX_WideString(); } @@ -4321,9 +4321,9 @@ CFX_WideString CXFA_Node::GetContent() { return GetScriptContent(); } -FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent, - FX_BOOL bScriptModify, - FX_BOOL bProto) { +bool CXFA_Node::TryContent(CFX_WideString& wsContent, + bool bScriptModify, + bool bProto) { CXFA_Node* pNode = nullptr; switch (GetObjectType()) { case XFA_ObjectType::ContainerNode: @@ -4332,7 +4332,7 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent, } else { CXFA_Node* pValue = GetChild(0, XFA_Element::Value); if (!pValue) { - return FALSE; + return false; } CXFA_Node* pChildValue = pValue->GetNodeItem(XFA_NODEITEM_FirstChild); if (pChildValue && XFA_FieldIsMultiListBox(this)) { @@ -4341,7 +4341,7 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent, } return pChildValue ? pChildValue->TryContent(wsContent, bScriptModify, bProto) - : FALSE; + : false; } break; case XFA_ObjectType::ContentNode: { @@ -4350,7 +4350,7 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent, XFA_Element element = XFA_Element::Sharptext; if (GetElementType() == XFA_Element::ExData) { CFX_WideString wsContentType; - GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); + GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false); if (wsContentType == FX_WSTRC(L"text/html")) { element = XFA_Element::SharpxHTML; } else if (wsContentType == FX_WSTRC(L"text/xml")) { @@ -4379,9 +4379,9 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent, m_pDocument->GetScriptContext()->AddNodesOfRunScript(this); } } - return TryCData(XFA_ATTRIBUTE_Value, wsContent, FALSE, bProto); + return TryCData(XFA_ATTRIBUTE_Value, wsContent, false, bProto); } - return FALSE; + return false; } CXFA_Node* CXFA_Node::GetModelNode() { @@ -4409,22 +4409,22 @@ CXFA_Node* CXFA_Node::GetModelNode() { } } -FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) { +bool CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) { wsNamespace.clear(); if (IsModelNode() || GetElementType() == XFA_Element::Packet) { CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); if (!pXMLNode || pXMLNode->GetType() != FDE_XMLNODE_Element) { - return FALSE; + return false; } static_cast<CFDE_XMLElement*>(pXMLNode)->GetNamespaceURI(wsNamespace); - return TRUE; + return true; } else if (GetPacketID() == XFA_XDPPACKET_Datasets) { CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); if (!pXMLNode) { - return FALSE; + return false; } if (pXMLNode->GetType() != FDE_XMLNODE_Element) { - return TRUE; + return true; } if (GetElementType() == XFA_Element::DataValue && GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData) { @@ -4433,7 +4433,7 @@ FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) { GetCData(XFA_ATTRIBUTE_QualifiedName), wsNamespace); } static_cast<CFDE_XMLElement*>(pXMLNode)->GetNamespaceURI(wsNamespace); - return TRUE; + return true; } else { CXFA_Node* pModelNode = GetModelNode(); return pModelNode->TryNamespace(wsNamespace); @@ -4442,7 +4442,7 @@ FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) { CXFA_Node* CXFA_Node::GetProperty(int32_t index, XFA_Element eProperty, - FX_BOOL bCreateProperty) { + bool bCreateProperty) { XFA_Element eType = GetElementType(); uint32_t dwPacket = GetPacketID(); const XFA_PROPERTY* pProperty = @@ -4485,7 +4485,7 @@ CXFA_Node* CXFA_Node::GetProperty(int32_t index, return pNewNode; } -int32_t CXFA_Node::CountChildren(XFA_Element eType, FX_BOOL bOnlyChild) { +int32_t CXFA_Node::CountChildren(XFA_Element eType, bool bOnlyChild) { CXFA_Node* pNode = m_pChild; int32_t iCount = 0; for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -4505,7 +4505,7 @@ int32_t CXFA_Node::CountChildren(XFA_Element eType, FX_BOOL bOnlyChild) { CXFA_Node* CXFA_Node::GetChild(int32_t index, XFA_Element eType, - FX_BOOL bOnlyChild) { + bool bOnlyChild) { ASSERT(index > -1); CXFA_Node* pNode = m_pChild; int32_t iCount = 0; @@ -4530,7 +4530,7 @@ CXFA_Node* CXFA_Node::GetChild(int32_t index, int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) { ASSERT(!pNode->m_pNext); pNode->m_pParent = this; - FX_BOOL ret = m_pDocument->RemovePurgeNode(pNode); + bool ret = m_pDocument->RemovePurgeNode(pNode); ASSERT(ret); (void)ret; // Avoid unused variable warning. @@ -4574,13 +4574,13 @@ int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) { return index; } -FX_BOOL CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) { +bool CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) { if (!pNode || pNode->m_pParent || (pBeforeNode && pBeforeNode->m_pParent != this)) { ASSERT(false); - return FALSE; + return false; } - FX_BOOL ret = m_pDocument->RemovePurgeNode(pNode); + bool ret = m_pDocument->RemovePurgeNode(pNode); ASSERT(ret); (void)ret; // Avoid unused variable warning. @@ -4618,7 +4618,7 @@ FX_BOOL CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) { m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, nIndex); pNode->ClearFlag(XFA_NodeFlag_OwnXMLNode); } - return TRUE; + return true; } CXFA_Node* CXFA_Node::Deprecated_GetPrevSibling() { @@ -4634,10 +4634,10 @@ CXFA_Node* CXFA_Node::Deprecated_GetPrevSibling() { return nullptr; } -FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { +bool CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { if (!pNode || pNode->m_pParent != this) { - ASSERT(FALSE); - return FALSE; + ASSERT(false); + return false; } if (m_pChild == pNode) { m_pChild = pNode->m_pNext; @@ -4671,7 +4671,7 @@ FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { pXMLElement->RemoveAttribute(wsAttributeName.c_str()); } CFX_WideString wsName; - pNode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE); + pNode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, false); CFDE_XMLElement* pNewXMLElement = new CFDE_XMLElement(wsName); CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value); if (!wsValue.IsEmpty()) { @@ -4684,7 +4684,7 @@ FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { } pNode->SetFlag(XFA_NodeFlag_OwnXMLNode, false); } - return TRUE; + return true; } CXFA_Node* CXFA_Node::GetFirstChildByName(const CFX_WideStringC& wsName) const { @@ -4814,7 +4814,7 @@ void CXFA_Node::ClearFlag(uint32_t dwFlag) { m_uNodeFlags &= ~dwFlag; } -FX_BOOL CXFA_Node::IsAttributeInXML() { +bool CXFA_Node::IsAttributeInXML() { return GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData; } @@ -4838,7 +4838,7 @@ void CXFA_Node::OnChanging(XFA_ATTRIBUTE eAttr, bool bNotify) { void CXFA_Node::OnChanged(XFA_ATTRIBUTE eAttr, bool bNotify, - FX_BOOL bScriptModify) { + bool bScriptModify) { if (bNotify && IsInitialized()) { Script_Attribute_SendAttributeChangeMessage(eAttr, bScriptModify); } @@ -4859,11 +4859,11 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName, iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType); } else if (validFlags == 2) { iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, - FALSE, FALSE); + false, false); } else if (validFlags == 3) { if (eType == XFA_Element::Subform) { iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, - FALSE, FALSE); + false, false); } } else if (validFlags == 4) { if (eType == XFA_Element::ExclGroup || eType == XFA_Element::Field) { @@ -4871,15 +4871,15 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName, if (pParentNode && pParentNode->GetElementType() == XFA_Element::ExclGroup) { iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, - FALSE, FALSE); + false, false); } iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, - FALSE, FALSE); + false, false); } } else if (validFlags == 5) { if (eType == XFA_Element::Field) { iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, - FALSE, FALSE); + false, false); } } else if (validFlags == 6) { CXFA_WidgetData* pWidgetData = GetWidgetData(); @@ -4887,7 +4887,7 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName, CXFA_Node* pUINode = pWidgetData->GetUIChild(); if (pUINode->m_elementType == XFA_Element::Signature) { iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, - FALSE, FALSE); + false, false); } } } else if (validFlags == 7) { @@ -4897,7 +4897,7 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName, if ((pUINode->m_elementType == XFA_Element::ChoiceList) && (!pWidgetData->IsListBox())) { iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, - FALSE, FALSE); + false, false); } } } @@ -4927,7 +4927,7 @@ CFDE_XMLNode* CXFA_Node::CreateXMLMappingNode() { return m_pXMLNode; } -FX_BOOL CXFA_Node::IsNeedSavingXMLNode() { +bool CXFA_Node::IsNeedSavingXMLNode() { return m_pXMLNode && (GetPacketID() == XFA_XDPPACKET_Datasets || GetElementType() == XFA_Element::Xfa); } @@ -4947,18 +4947,18 @@ void CXFA_Node::SetMapModuleValue(void* pKey, void* pValue) { pModule->m_ValueMap.SetAt(pKey, pValue); } -FX_BOOL CXFA_Node::GetMapModuleValue(void* pKey, void*& pValue) { +bool CXFA_Node::GetMapModuleValue(void* pKey, void*& pValue) { CXFA_Node* pNode = this; while (pNode) { XFA_MAPMODULEDATA* pModule = pNode->GetMapModuleData(); if (pModule && pModule->m_ValueMap.Lookup(pKey, pValue)) { - return TRUE; + return true; } pNode = pNode->GetPacketID() != XFA_XDPPACKET_Datasets ? pNode->GetTemplateNode() : nullptr; } - return FALSE; + return false; } void CXFA_Node::SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue) { @@ -4966,14 +4966,14 @@ void CXFA_Node::SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue) { wsValue.GetLength() * sizeof(FX_WCHAR)); } -FX_BOOL CXFA_Node::GetMapModuleString(void* pKey, CFX_WideStringC& wsValue) { +bool CXFA_Node::GetMapModuleString(void* pKey, CFX_WideStringC& wsValue) { void* pValue; int32_t iBytes; if (!GetMapModuleBuffer(pKey, pValue, iBytes)) { - return FALSE; + return false; } wsValue = CFX_WideStringC((const FX_WCHAR*)pValue, iBytes / sizeof(FX_WCHAR)); - return TRUE; + return true; } void CXFA_Node::SetMapModuleBuffer( @@ -5003,10 +5003,10 @@ void CXFA_Node::SetMapModuleBuffer( FXSYS_memcpy(pBuffer->GetData(), pValue, iBytes); } -FX_BOOL CXFA_Node::GetMapModuleBuffer(void* pKey, - void*& pValue, - int32_t& iBytes, - FX_BOOL bProtoAlso) const { +bool CXFA_Node::GetMapModuleBuffer(void* pKey, + void*& pValue, + int32_t& iBytes, + bool bProtoAlso) const { XFA_MAPDATABLOCK* pBuffer = nullptr; const CXFA_Node* pNode = this; while (pNode) { @@ -5019,14 +5019,14 @@ FX_BOOL CXFA_Node::GetMapModuleBuffer(void* pKey, : nullptr; } if (!pBuffer) { - return FALSE; + return false; } pValue = pBuffer->GetData(); iBytes = pBuffer->iBytes; - return TRUE; + return true; } -FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) { +bool CXFA_Node::HasMapModuleKey(void* pKey, bool bProtoAlso) { CXFA_Node* pNode = this; while (pNode) { void* pVal; @@ -5034,13 +5034,13 @@ FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) { if (pModule && (pModule->m_ValueMap.Lookup(pKey, pVal) || pModule->m_BufferMap.Lookup(pKey, (XFA_MAPDATABLOCK*&)pVal))) { - return TRUE; + return true; } pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets) ? pNode->GetTemplateNode() : nullptr; } - return FALSE; + return false; } void CXFA_Node::RemoveMapModuleKey(void* pKey) { @@ -5077,7 +5077,7 @@ void CXFA_Node::RemoveMapModuleKey(void* pKey) { } } -void CXFA_Node::MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr) { +void CXFA_Node::MergeAllData(void* pDstModule, bool bUseSrcAttr) { XFA_MAPMODULEDATA* pDstModuleData = static_cast<CXFA_Node*>(pDstModule)->CreateMapModuleData(); XFA_MAPMODULEDATA* pSrcModuleData = GetMapModuleData(); @@ -5138,19 +5138,19 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) { if (!pDstModule) { return; } - FX_BOOL bNeedMove = TRUE; + bool bNeedMove = true; if (!pKey) { - bNeedMove = FALSE; + bNeedMove = false; } if (pDstModule->GetElementType() != GetElementType()) { - bNeedMove = FALSE; + bNeedMove = false; } XFA_MAPMODULEDATA* pSrcModuleData = nullptr; XFA_MAPMODULEDATA* pDstModuleData = nullptr; if (bNeedMove) { pSrcModuleData = GetMapModuleData(); if (!pSrcModuleData) { - bNeedMove = FALSE; + bNeedMove = false; } pDstModuleData = pDstModule->CreateMapModuleData(); } @@ -5164,20 +5164,20 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) { } } if (pDstModule->IsNodeV()) { - CFX_WideString wsValue = pDstModule->GetScriptContent(FALSE); + CFX_WideString wsValue = pDstModule->GetScriptContent(false); CFX_WideString wsFormatValue(wsValue); CXFA_WidgetData* pWidgetData = pDstModule->GetContainerWidgetData(); if (pWidgetData) { pWidgetData->GetFormatDataValue(wsValue, wsFormatValue); } - pDstModule->SetScriptContent(wsValue, wsFormatValue, true, TRUE); + pDstModule->SetScriptContent(wsValue, wsFormatValue, true, true); } } void CXFA_Node::MoveBufferMapData(CXFA_Node* pSrcModule, CXFA_Node* pDstModule, void* pKey, - FX_BOOL bRecursive) { + bool bRecursive) { if (!pSrcModule || !pDstModule || !pKey) { return; } @@ -5187,7 +5187,7 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pSrcModule, for (; pSrcChild && pDstChild; pSrcChild = pSrcChild->GetNodeItem(XFA_NODEITEM_NextSibling), pDstChild = pDstChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { - MoveBufferMapData(pSrcChild, pDstChild, pKey, TRUE); + MoveBufferMapData(pSrcChild, pDstChild, pKey, true); } } pSrcModule->MoveBufferMapData(pDstModule, pKey); diff --git a/xfa/fxfa/parser/cxfa_nodehelper.cpp b/xfa/fxfa/parser/cxfa_nodehelper.cpp index 27b8b038aa..18a9594da1 100644 --- a/xfa/fxfa/parser/cxfa_nodehelper.cpp +++ b/xfa/fxfa/parser/cxfa_nodehelper.cpp @@ -26,7 +26,7 @@ CXFA_NodeHelper::~CXFA_NodeHelper() {} CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetOneChild(CXFA_Node* parent, const FX_WCHAR* pwsName, - FX_BOOL bIsClassName) { + bool bIsClassName) { if (!parent) { return nullptr; } @@ -42,7 +42,7 @@ CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetOneChild(CXFA_Node* parent, int32_t CXFA_NodeHelper::CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray* pSiblings, - FX_BOOL bIsClassName) { + bool bIsClassName) { if (!pNode) return 0; CXFA_Node* parent = ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent); @@ -68,7 +68,7 @@ int32_t CXFA_NodeHelper::CountSiblings(CXFA_Node* pNode, int32_t CXFA_NodeHelper::NodeAcc_TraverseAnySiblings(CXFA_Node* parent, uint32_t dNameHash, CXFA_NodeArray* pSiblings, - FX_BOOL bIsClassName) { + bool bIsClassName) { if (!parent || !pSiblings) { return 0; } @@ -129,8 +129,8 @@ int32_t CXFA_NodeHelper::NodeAcc_TraverseSiblings(CXFA_Node* parent, uint32_t dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, - FX_BOOL bIsClassName, - FX_BOOL bIsFindProperty) { + bool bIsClassName, + bool bIsFindProperty) { if (!parent || !pSiblings) { return 0; } @@ -160,7 +160,7 @@ int32_t CXFA_NodeHelper::NodeAcc_TraverseSiblings(CXFA_Node* parent, if (child->IsUnnamed() && child->GetElementType() == XFA_Element::PageSet) { nCount += NodeAcc_TraverseSiblings(child, dNameHash, pSiblings, - eLogicType, bIsClassName, FALSE); + eLogicType, bIsClassName, false); } } if (nCount > 0) { @@ -196,7 +196,7 @@ int32_t CXFA_NodeHelper::NodeAcc_TraverseSiblings(CXFA_Node* parent, if (NodeIsTransparent(child) && child->GetElementType() != XFA_Element::PageSet) { nCount += NodeAcc_TraverseSiblings(child, dNameHash, pSiblings, - eLogicType, bIsClassName, FALSE); + eLogicType, bIsClassName, false); } } return nCount; @@ -212,7 +212,7 @@ CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetParent(CXFA_Node* pNode, } CXFA_Node* parent; CXFA_Node* node = pNode; - while (TRUE) { + while (true) { parent = ResolveNodes_GetParent(node); if (!parent) { break; @@ -229,8 +229,8 @@ CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetParent(CXFA_Node* pNode, int32_t CXFA_NodeHelper::GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, - FX_BOOL bIsProperty, - FX_BOOL bIsClassIndex) { + bool bIsProperty, + bool bIsClassIndex) { CXFA_Node* parent = ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent); if (!parent) { return 0; @@ -259,16 +259,16 @@ int32_t CXFA_NodeHelper::GetIndex(CXFA_Node* pNode, void CXFA_NodeHelper::GetNameExpression(CXFA_Node* refNode, CFX_WideString& wsName, - FX_BOOL bIsAllPath, + bool bIsAllPath, XFA_LOGIC_TYPE eLogicType) { wsName.clear(); if (bIsAllPath) { - GetNameExpression(refNode, wsName, FALSE, eLogicType); + GetNameExpression(refNode, wsName, false, eLogicType); CFX_WideString wsParent; CXFA_Node* parent = ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent); while (parent) { - GetNameExpression(parent, wsParent, FALSE, eLogicType); + GetNameExpression(parent, wsParent, false, eLogicType); wsParent += L"."; wsParent += wsName; wsName = wsParent; @@ -278,40 +278,40 @@ void CXFA_NodeHelper::GetNameExpression(CXFA_Node* refNode, } CFX_WideString ws; - FX_BOOL bIsProperty = NodeIsProperty(refNode); + bool bIsProperty = NodeIsProperty(refNode); if (refNode->IsUnnamed() || (bIsProperty && refNode->GetElementType() != XFA_Element::PageSet)) { ws = refNode->GetClassName(); wsName.Format(L"#%s[%d]", ws.c_str(), - GetIndex(refNode, eLogicType, bIsProperty, TRUE)); + GetIndex(refNode, eLogicType, bIsProperty, true)); return; } ws = refNode->GetCData(XFA_ATTRIBUTE_Name); ws.Replace(L".", L"\\."); wsName.Format(L"%s[%d]", ws.c_str(), - GetIndex(refNode, eLogicType, bIsProperty, FALSE)); + GetIndex(refNode, eLogicType, bIsProperty, false)); } -FX_BOOL CXFA_NodeHelper::NodeIsTransparent(CXFA_Node* refNode) { +bool CXFA_NodeHelper::NodeIsTransparent(CXFA_Node* refNode) { if (!refNode) { - return FALSE; + return false; } XFA_Element refNodeType = refNode->GetElementType(); if ((refNode->IsUnnamed() && refNode->IsContainerNode()) || refNodeType == XFA_Element::SubformSet || refNodeType == XFA_Element::Area || refNodeType == XFA_Element::Proto) { - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) { +bool CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) { int32_t iLen = wsCondition.GetLength(); CFX_WideString wsIndex(L"0"); - FX_BOOL bAll = FALSE; + bool bAll = false; if (iLen == 0) { m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne; - return FALSE; + return false; } if (wsCondition.GetAt(0) == '[') { int32_t i = 1; @@ -323,7 +323,7 @@ FX_BOOL CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) { if (ch == '+' || ch == '-') { break; } else if (ch == '*') { - bAll = TRUE; + bAll = true; break; } else { break; @@ -338,28 +338,28 @@ FX_BOOL CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) { } int32_t iIndex = wsIndex.GetInteger(); m_iCreateCount = iIndex; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode( +bool CXFA_NodeHelper::ResolveNodes_CreateNode( CFX_WideString wsName, CFX_WideString wsCondition, - FX_BOOL bLastNode, + bool bLastNode, CXFA_ScriptContext* pScriptContext) { if (!m_pCreateParent) { - return FALSE; + return false; } - FX_BOOL bIsClassName = FALSE; - FX_BOOL bResult = FALSE; + bool bIsClassName = false; + bool bResult = false; if (wsName.GetAt(0) == '!') { wsName = wsName.Right(wsName.GetLength() - 1); m_pCreateParent = ToNode( pScriptContext->GetDocument()->GetXFAObject(XFA_HASHCODE_Datasets)); } if (wsName.GetAt(0) == '#') { - bIsClassName = TRUE; + bIsClassName = true; wsName = wsName.Right(wsName.GetLength() - 1); } if (m_iCreateCount == 0) { @@ -368,7 +368,7 @@ FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode( if (bIsClassName) { XFA_Element eType = XFA_GetElementTypeForName(wsName.AsStringC()); if (eType == XFA_Element::Unknown) - return FALSE; + return false; for (int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex++) { CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eType); @@ -377,7 +377,7 @@ FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode( if (iIndex == m_iCreateCount - 1) { m_pCreateParent = pNewNode; } - bResult = TRUE; + bResult = true; } } } else { @@ -394,7 +394,7 @@ FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode( if (iIndex == m_iCreateCount - 1) { m_pCreateParent = pNewNode; } - bResult = TRUE; + bResult = true; } } } @@ -419,7 +419,7 @@ void CXFA_NodeHelper::SetCreateNodeType(CXFA_Node* refNode) { } } -FX_BOOL CXFA_NodeHelper::NodeIsProperty(CXFA_Node* refNode) { +bool CXFA_NodeHelper::NodeIsProperty(CXFA_Node* refNode) { CXFA_Node* parent = ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent); return parent && refNode && XFA_GetPropertyOfElement(parent->GetElementType(), diff --git a/xfa/fxfa/parser/cxfa_nodehelper.h b/xfa/fxfa/parser/cxfa_nodehelper.h index a913d5de04..5097feabac 100644 --- a/xfa/fxfa/parser/cxfa_nodehelper.h +++ b/xfa/fxfa/parser/cxfa_nodehelper.h @@ -24,7 +24,7 @@ class CXFA_NodeHelper { CXFA_Node* ResolveNodes_GetOneChild(CXFA_Node* parent, const FX_WCHAR* pwsName, - FX_BOOL bIsClassName = FALSE); + bool bIsClassName = false); CXFA_Node* ResolveNodes_GetParent( CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent); @@ -33,32 +33,32 @@ class CXFA_NodeHelper { uint32_t dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, - FX_BOOL bIsClassName = FALSE, - FX_BOOL bIsFindProperty = TRUE); + bool bIsClassName = false, + bool bIsFindProperty = true); int32_t NodeAcc_TraverseAnySiblings(CXFA_Node* parent, uint32_t dNameHash, CXFA_NodeArray* pSiblings, - FX_BOOL bIsClassName = FALSE); + bool bIsClassName = false); int32_t CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray* pSiblings, - FX_BOOL bIsClassName = FALSE); + bool bIsClassName = false); int32_t GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent, - FX_BOOL bIsProperty = FALSE, - FX_BOOL bIsClassIndex = FALSE); + bool bIsProperty = false, + bool bIsClassIndex = false); void GetNameExpression(CXFA_Node* refNode, CFX_WideString& wsName, - FX_BOOL bIsAllPath, + bool bIsAllPath, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent); - FX_BOOL NodeIsTransparent(CXFA_Node* refNode); - FX_BOOL ResolveNodes_CreateNode(CFX_WideString wsName, - CFX_WideString wsCondition, - FX_BOOL bLastNode, - CXFA_ScriptContext* pScriptContext); - FX_BOOL CreateNode_ForCondition(CFX_WideString& wsCondition); + bool NodeIsTransparent(CXFA_Node* refNode); + bool ResolveNodes_CreateNode(CFX_WideString wsName, + CFX_WideString wsCondition, + bool bLastNode, + CXFA_ScriptContext* pScriptContext); + bool CreateNode_ForCondition(CFX_WideString& wsCondition); void SetCreateNodeType(CXFA_Node* refNode); - FX_BOOL NodeIsProperty(CXFA_Node* refNode); + bool NodeIsProperty(CXFA_Node* refNode); public: XFA_Element m_eLastCreateType; diff --git a/xfa/fxfa/parser/cxfa_nodelist.cpp b/xfa/fxfa/parser/cxfa_nodelist.cpp index df6cd408e4..9eb04c994f 100644 --- a/xfa/fxfa/parser/cxfa_nodelist.cpp +++ b/xfa/fxfa/parser/cxfa_nodelist.cpp @@ -108,7 +108,7 @@ void CXFA_NodeList::Script_TreelistClass_NamedItem( } void CXFA_NodeList::Script_ListClass_Length(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { pValue->SetInteger(GetLength()); diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp index 10e1b822e2..a31060241a 100644 --- a/xfa/fxfa/parser/cxfa_object.cpp +++ b/xfa/fxfa/parser/cxfa_object.cpp @@ -36,7 +36,7 @@ XFA_Element CXFA_Object::GetElementType() const { } void CXFA_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { ThrowException(XFA_IDS_INVAlID_PROP_SET); diff --git a/xfa/fxfa/parser/cxfa_occur.cpp b/xfa/fxfa/parser/cxfa_occur.cpp index 6d105abec6..a8994223f9 100644 --- a/xfa/fxfa/parser/cxfa_occur.cpp +++ b/xfa/fxfa/parser/cxfa_occur.cpp @@ -13,7 +13,7 @@ CXFA_Occur::CXFA_Occur(CXFA_Node* pNode) : CXFA_Data(pNode) {} int32_t CXFA_Occur::GetMax() { int32_t iMax = 1; if (m_pNode) { - if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, TRUE)) + if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, true)) iMax = GetMin(); } return iMax; @@ -22,46 +22,46 @@ int32_t CXFA_Occur::GetMax() { int32_t CXFA_Occur::GetMin() { int32_t iMin = 1; if (m_pNode) { - if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, TRUE) || iMin < 0) + if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, true) || iMin < 0) iMin = 1; } return iMin; } -FX_BOOL CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit) { +bool CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit) { if (!m_pNode) - return FALSE; - if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE) || iMin < 0) + return false; + if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, false) || iMin < 0) iMin = 1; - if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE)) { + if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false)) { if (iMin == 0) iMax = 1; else iMax = iMin; } - if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Initial, iInit, FALSE) || + if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Initial, iInit, false) || iInit < iMin) { iInit = iMin; } - return TRUE; + return true; } void CXFA_Occur::SetMax(int32_t iMax) { iMax = (iMax != -1 && iMax < 1) ? 1 : iMax; - m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); + m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, false); int32_t iMin = GetMin(); if (iMax != -1 && iMax < iMin) { iMin = iMax; - m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE); + m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, false); } } void CXFA_Occur::SetMin(int32_t iMin) { iMin = (iMin < 0) ? 1 : iMin; - m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE); + m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, false); int32_t iMax = GetMax(); if (iMax > 0 && iMax < iMin) { iMax = iMin; - m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); + m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, false); } } diff --git a/xfa/fxfa/parser/cxfa_occur.h b/xfa/fxfa/parser/cxfa_occur.h index 58b44b9135..69db071a11 100644 --- a/xfa/fxfa/parser/cxfa_occur.h +++ b/xfa/fxfa/parser/cxfa_occur.h @@ -18,7 +18,7 @@ class CXFA_Occur : public CXFA_Data { int32_t GetMax(); int32_t GetMin(); - FX_BOOL GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit); + bool GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit); void SetMax(int32_t iMax); void SetMin(int32_t iMin); }; diff --git a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp index 823e884821..271e14be6c 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp @@ -81,9 +81,9 @@ int32_t CXFA_ResolveProcessor::ResolveAnyChild(CXFA_ResolveNodesData& rnd) { CFX_WideString wsCondition = rnd.m_wsCondition; CXFA_Node* findNode = nullptr; CXFA_NodeArray siblings; - FX_BOOL bClassName = FALSE; + bool bClassName = false; if (wsName.GetAt(0) == '#') { - bClassName = TRUE; + bClassName = true; wsName = wsName.Right(wsName.GetLength() - 1); } findNode = m_pNodeHelper->ResolveNodes_GetOneChild( @@ -266,7 +266,7 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) { } } if (dwStyles & XFA_RESOLVENODE_Children) { - FX_BOOL bSetFlag = FALSE; + bool bSetFlag = false; if (pPageSetNode && (dwStyles & XFA_RESOLVENODE_Properties)) { children.Add(pPageSetNode); } @@ -283,7 +283,7 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) { child->GetElementType() != XFA_Element::PageSet) { if (!bSetFlag) { SetStylesForChild(dwStyles, rndFind); - bSetFlag = TRUE; + bSetFlag = true; } rndFind.m_CurNode = child; CFX_WideString wsSaveCondition = rndFind.m_wsCondition; @@ -350,7 +350,7 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) { CXFA_Node* pInstanceManager = curNode->AsNode()->GetInstanceMgrOfSubform(); if (pInstanceManager) { - pProp = pInstanceManager->GetProperty(0, XFA_Element::Occur, TRUE); + pProp = pInstanceManager->GetProperty(0, XFA_Element::Occur, true); } } else { XFA_Element eType = XFA_GetElementTypeForName(wsName.AsStringC()); @@ -417,15 +417,15 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) { const XFA_PROPERTY* pPropert = XFA_GetPropertyOfElement( parentNode->GetElementType(), child->GetElementType(), XFA_XDPPACKET_UNKNOWN); - FX_BOOL bInnerSearch = FALSE; + bool bInnerSearch = false; if (pPropert) { if ((child->GetElementType() == XFA_Element::Variables || child->GetElementType() == XFA_Element::PageSet)) { - bInnerSearch = TRUE; + bInnerSearch = true; } } else { if (m_pNodeHelper->NodeIsTransparent(child)) { - bInnerSearch = TRUE; + bInnerSearch = true; } } if (bInnerSearch) { @@ -524,7 +524,7 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression, int32_t nType = -1; const FX_WCHAR* pSrc = wsExpression.c_str(); FX_WCHAR wPrev = 0, wCur; - FX_BOOL bIsCondition = FALSE; + bool bIsCondition = false; while (nStart < iLength) { wCur = pSrc[nStart++]; if (wCur == '.') { @@ -544,34 +544,34 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression, } } if (wCur == '[' || wCur == '(') { - bIsCondition = TRUE; + bIsCondition = true; } else if (wCur == '.' && nStart < iLength && (pSrc[nStart] == '[' || pSrc[nStart] == '(')) { - bIsCondition = TRUE; + bIsCondition = true; } if (bIsCondition) { pConditionBuf[nConditionCount++] = wCur; } else { pNameBuf[nNameCount++] = wCur; } - FX_BOOL bRecursive = TRUE; + bool bRecursive = true; switch (nType) { case 0: if (wCur == ']') { nType = ResolvePopStack(stack); - bRecursive = FALSE; + bRecursive = false; } break; case 1: if (wCur == ')') { nType = ResolvePopStack(stack); - bRecursive = FALSE; + bRecursive = false; } break; case 2: if (wCur == '"') { nType = ResolvePopStack(stack); - bRecursive = FALSE; + bRecursive = false; } break; } @@ -612,8 +612,8 @@ void CXFA_ResolveProcessor::ConditionArray(int32_t iCurIndex, CXFA_ResolveNodesData& rnd) { CXFA_NodeArray& findNodes = (CXFA_NodeArray&)rnd.m_Nodes; int32_t iLen = wsCondition.GetLength(); - FX_BOOL bRelative = FALSE; - FX_BOOL bAll = FALSE; + bool bRelative = false; + bool bAll = false; int32_t i = 1; for (; i < iLen; ++i) { FX_WCHAR ch = wsCondition[i]; @@ -621,10 +621,10 @@ void CXFA_ResolveProcessor::ConditionArray(int32_t iCurIndex, continue; } if (ch == '+' || ch == '-') { - bRelative = TRUE; + bRelative = true; break; } else if (ch == '*') { - bAll = TRUE; + bAll = true; break; } else { break; @@ -694,7 +694,7 @@ void CXFA_ResolveProcessor::DoPredicateFilter(int32_t iCurIndex, wsExpression = wsCondition.Mid(2, wsCondition.GetLength() - 3); for (int32_t i = iFoundCount - 1; i >= 0; i--) { CXFA_Object* node = findNodes[i]; - FX_BOOL bRet = FALSE; + bool bRet = false; std::unique_ptr<CFXJSE_Value> pRetValue( new CFXJSE_Value(rnd.m_pSC->GetRuntime())); bRet = pContext->RunScript(eLangType, wsExpression.AsStringC(), @@ -712,14 +712,14 @@ void CXFA_ResolveProcessor::FilterCondition(CXFA_ResolveNodesData& rnd, int32_t iSize = array.GetSize(); if (iSize) { CXFA_Node* curNode = array[iSize - 1]; - FX_BOOL bIsProperty = m_pNodeHelper->NodeIsProperty(curNode); + bool bIsProperty = m_pNodeHelper->NodeIsProperty(curNode); if (curNode->IsUnnamed() || (bIsProperty && curNode->GetElementType() != XFA_Element::PageSet)) { iCurrIndex = m_pNodeHelper->GetIndex(curNode, XFA_LOGIC_Transparent, - bIsProperty, TRUE); + bIsProperty, true); } else { iCurrIndex = m_pNodeHelper->GetIndex(curNode, XFA_LOGIC_Transparent, - bIsProperty, FALSE); + bIsProperty, false); } } int32_t iFoundCount = findNodes.GetSize(); diff --git a/xfa/fxfa/parser/cxfa_script.cpp b/xfa/fxfa/parser/cxfa_script.cpp index b99d8a3945..42911e0f12 100644 --- a/xfa/fxfa/parser/cxfa_script.cpp +++ b/xfa/fxfa/parser/cxfa_script.cpp @@ -12,7 +12,7 @@ CXFA_Script::CXFA_Script(CXFA_Node* pNode) : CXFA_Data(pNode) {} XFA_SCRIPTTYPE CXFA_Script::GetContentType() { CFX_WideStringC cData; - if (m_pNode->TryCData(XFA_ATTRIBUTE_ContentType, cData, FALSE)) { + if (m_pNode->TryCData(XFA_ATTRIBUTE_ContentType, cData, false)) { if (cData == FX_WSTRC(L"application/x-javascript")) return XFA_SCRIPTTYPE_Javascript; if (cData == FX_WSTRC(L"application/x-formcalc")) diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.cpp b/xfa/fxfa/parser/cxfa_scriptcontext.cpp index af2f99a55c..80395149a3 100644 --- a/xfa/fxfa/parser/cxfa_scriptcontext.cpp +++ b/xfa/fxfa/parser/cxfa_scriptcontext.cpp @@ -142,10 +142,10 @@ void CXFA_ScriptContext::Initialize(v8::Isolate* pIsolate) { DefineJsClass(); m_ResolveProcessor.reset(new CXFA_ResolveProcessor); } -FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, - const CFX_WideStringC& wsScript, - CFXJSE_Value* hRetValue, - CXFA_Object* pThisObject) { +bool CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, + const CFX_WideStringC& wsScript, + CFXJSE_Value* hRetValue, + CXFA_Object* pThisObject) { CFX_ByteString btScript; XFA_SCRIPTLANGTYPE eSaveType = m_eScriptType; m_eScriptType = eScriptType; @@ -160,7 +160,7 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, CXFA_FM2JSContext::Translate(wsScript, wsJavaScript, wsErrorInfo); if (iFlags) { hRetValue->SetUndefined(); - return FALSE; + return false; } btScript = FX_UTF8Encode(wsJavaScript.GetBuffer(), wsJavaScript.GetLength()); @@ -170,8 +170,7 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, CXFA_Object* pOriginalObject = m_pThisObject; m_pThisObject = pThisObject; CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : nullptr; - FX_BOOL bRet = - m_JsContext->ExecuteScript(btScript.c_str(), hRetValue, pValue); + bool bRet = m_JsContext->ExecuteScript(btScript.c_str(), hRetValue, pValue); m_pThisObject = pOriginalObject; m_eScriptType = eSaveType; return bRet; @@ -191,7 +190,7 @@ void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject, if (lpOrginalNode->IsVariablesThis()) pRefNode = ToNode(lpCurNode); if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue, - dwFlag, TRUE)) { + dwFlag, true)) { return; } if (lpOrginalNode->IsVariablesThis()) { @@ -207,11 +206,11 @@ void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject, pNotify->GetDocEnvironment()->SetGlobalProperty(pNotify->GetHDOC(), szPropName, pValue); } -FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, - const CFX_WideStringC& propname, - CFXJSE_Value* pValue, - uint32_t dwFlag, - FX_BOOL bSetting) { +bool CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, + const CFX_WideStringC& propname, + CFXJSE_Value* pValue, + uint32_t dwFlag, + bool bSetting) { if (!refNode) return false; XFA_RESOLVENODE_RS resolveRs; @@ -261,19 +260,19 @@ void CXFA_ScriptContext::GlobalPropertyGetter(CFXJSE_Value* pObject, pRefNode = ToNode(lpCurNode); } if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue, - dwFlag, FALSE)) { + dwFlag, false)) { return; } dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue, - dwFlag, FALSE)) { + dwFlag, false)) { return; } CXFA_Object* pScriptObject = - lpScriptContext->GetVariablesThis(pOriginalObject, TRUE); + lpScriptContext->GetVariablesThis(pOriginalObject, true); if (pScriptObject && lpScriptContext->QueryVariableValue(pScriptObject->AsNode(), szPropName, - pValue, TRUE)) { + pValue, true)) { return; } CXFA_FFNotify* pNotify = pDoc->GetNotify(); @@ -303,8 +302,8 @@ void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue, } uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes; - FX_BOOL bRet = lpScriptContext->QueryNodeByFlag( - ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE); + bool bRet = lpScriptContext->QueryNodeByFlag( + ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, false); if (bRet) { return; } @@ -313,16 +312,16 @@ void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue, !lpScriptContext->IsStrictScopeInJavaScript())) { dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; bRet = lpScriptContext->QueryNodeByFlag( - ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE); + ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, false); } if (bRet) { return; } CXFA_Object* pScriptObject = - lpScriptContext->GetVariablesThis(pOriginalObject, TRUE); + lpScriptContext->GetVariablesThis(pOriginalObject, true); if (pScriptObject) { bRet = lpScriptContext->QueryVariableValue(ToNode(pScriptObject), - szPropName, pReturnValue, TRUE); + szPropName, pReturnValue, true); } if (!bRet) { pReturnValue->SetUndefined(); @@ -343,7 +342,7 @@ void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, pObject->GetElementType(), wsPropName.AsStringC()); if (lpAttributeInfo) { (pObject->*(lpAttributeInfo->lpfnCallback))( - pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); + pReturnValue, true, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); } else { if (pObject->IsNode()) { if (wsPropName.GetAt(0) == '#') { @@ -364,23 +363,23 @@ void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, wsDefaultName.AsStringC()); if (lpAttrInfo) { (pPropOrChild->*(lpAttrInfo->lpfnCallback))( - pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttrInfo->eAttribute); + pReturnValue, true, (XFA_ATTRIBUTE)lpAttrInfo->eAttribute); return; } } } CXFA_Object* pScriptObject = - lpScriptContext->GetVariablesThis(pOriginalObject, TRUE); + lpScriptContext->GetVariablesThis(pOriginalObject, true); if (pScriptObject) { lpScriptContext->QueryVariableValue(ToNode(pScriptObject), szPropName, - pReturnValue, FALSE); + pReturnValue, false); } } } int32_t CXFA_ScriptContext::NormalPropTypeGetter( CFXJSE_Value* pOriginalValue, const CFX_ByteStringC& szPropName, - FX_BOOL bQueryIn) { + bool bQueryIn) { CXFA_Object* pObject = ToObject(pOriginalValue, nullptr); if (!pObject) return FXJSE_ClassPropType_None; @@ -402,7 +401,7 @@ int32_t CXFA_ScriptContext::NormalPropTypeGetter( int32_t CXFA_ScriptContext::GlobalPropTypeGetter( CFXJSE_Value* pOriginalValue, const CFX_ByteStringC& szPropName, - FX_BOOL bQueryIn) { + bool bQueryIn) { CXFA_Object* pObject = ToObject(pOriginalValue, nullptr); if (!pObject) return FXJSE_ClassPropType_None; @@ -435,7 +434,7 @@ void CXFA_ScriptContext::NormalMethodCall(CFXJSE_Value* pThis, (pObject->*(lpMethodInfo->lpfnCallback))(&args); } -FX_BOOL CXFA_ScriptContext::IsStrictScopeInJavaScript() { +bool CXFA_ScriptContext::IsStrictScopeInJavaScript() { return m_pDocument->HasFlag(XFA_DOCFLAG_StrictScoping); } XFA_SCRIPTLANGTYPE CXFA_ScriptContext::GetType() { @@ -462,7 +461,7 @@ CFXJSE_Context* CXFA_ScriptContext::CreateVariablesContext( return pVariablesContext; } CXFA_Object* CXFA_ScriptContext::GetVariablesThis(CXFA_Object* pObject, - FX_BOOL bScriptNode) { + bool bScriptNode) { if (!pObject->IsVariablesThis()) return pObject; @@ -470,27 +469,27 @@ CXFA_Object* CXFA_ScriptContext::GetVariablesThis(CXFA_Object* pObject, return bScriptNode ? pProxy->GetScriptNode() : pProxy->GetThisNode(); } -FX_BOOL CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) { +bool CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) { if (!pScriptNode) - return FALSE; + return false; if (pScriptNode->GetElementType() != XFA_Element::Script) - return TRUE; + return true; CXFA_Node* pParent = pScriptNode->GetNodeItem(XFA_NODEITEM_Parent); if (!pParent || pParent->GetElementType() != XFA_Element::Variables) - return FALSE; + return false; if (m_mapVariableToContext.GetValueAt(pScriptNode)) - return TRUE; + return true; CXFA_Node* pTextNode = pScriptNode->GetNodeItem(XFA_NODEITEM_FirstChild); if (!pTextNode) - return FALSE; + return false; CFX_WideStringC wsScript; if (!pTextNode->TryCData(XFA_ATTRIBUTE_Value, wsScript)) - return FALSE; + return false; CFX_ByteString btScript = FX_UTF8Encode(wsScript.c_str(), wsScript.GetLength()); @@ -500,37 +499,36 @@ FX_BOOL CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) { CreateVariablesContext(pScriptNode, pThisObject); CXFA_Object* pOriginalObject = m_pThisObject; m_pThisObject = pThisObject; - FX_BOOL bRet = + bool bRet = pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get()); m_pThisObject = pOriginalObject; return bRet; } -FX_BOOL CXFA_ScriptContext::QueryVariableValue( - CXFA_Node* pScriptNode, - const CFX_ByteStringC& szPropName, - CFXJSE_Value* pValue, - FX_BOOL bGetter) { +bool CXFA_ScriptContext::QueryVariableValue(CXFA_Node* pScriptNode, + const CFX_ByteStringC& szPropName, + CFXJSE_Value* pValue, + bool bGetter) { if (!pScriptNode || pScriptNode->GetElementType() != XFA_Element::Script) - return FALSE; + return false; CXFA_Node* variablesNode = pScriptNode->GetNodeItem(XFA_NODEITEM_Parent); if (!variablesNode || variablesNode->GetElementType() != XFA_Element::Variables) - return FALSE; + return false; void* lpVariables = m_mapVariableToContext.GetValueAt(pScriptNode); if (!lpVariables) - return FALSE; + return false; - FX_BOOL bRes = FALSE; + bool bRes = false; CFXJSE_Context* pVariableContext = static_cast<CFXJSE_Context*>(lpVariables); std::unique_ptr<CFXJSE_Value> pObject = pVariableContext->GetGlobalObject(); std::unique_ptr<CFXJSE_Value> hVariableValue(new CFXJSE_Value(m_pIsolate)); if (!bGetter) { pObject->SetObjectOwnProperty(szPropName, pValue); - bRes = TRUE; - } else if (pObject->HasObjectOwnProperty(szPropName, FALSE)) { + bRes = true; + } else if (pObject->HasObjectOwnProperty(szPropName, false)) { pObject->GetObjectProperty(szPropName, hVariableValue.get()); if (hVariableValue->IsFunction()) pValue->SetFunctionBind(hVariableValue.get(), pObject.get()); @@ -538,7 +536,7 @@ FX_BOOL CXFA_ScriptContext::QueryVariableValue( pValue->Assign(hVariableValue.get()); else hVariableValue.get()->Assign(pValue); - bRes = TRUE; + bRes = true; } return bRes; } @@ -575,7 +573,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, (dwStyles & (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings))) { m_upObjectArray.Add(refNode->AsNode()); } - FX_BOOL bNextCreate = FALSE; + bool bNextCreate = false; if (dwStyles & XFA_RESOLVENODE_CreateNode) { m_ResolveProcessor->GetNodeHelper()->SetCreateNodeType(bindNode); } @@ -589,7 +587,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, CXFA_ObjArray findNodes; findNodes.Add(refNode ? refNode : m_pDocument->GetRoot()); int32_t nNodes = 0; - while (TRUE) { + while (true) { nNodes = findNodes.GetSize(); int32_t i = 0; rndFind.m_dwStyles = dwStyles; @@ -621,7 +619,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, } } if (bNextCreate) { - FX_BOOL bCreate = + bool bCreate = m_ResolveProcessor->GetNodeHelper()->ResolveNodes_CreateNode( rndFind.m_wsName, rndFind.m_wsCondition, nStart == wsExpression.GetLength(), this); @@ -633,14 +631,14 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, } CXFA_ObjArray retNodes; while (i < nNodes) { - FX_BOOL bDataBind = FALSE; + bool bDataBind = false; if (((dwStyles & XFA_RESOLVENODE_Bind) || (dwStyles & XFA_RESOLVENODE_CreateNode)) && nNodes > 1) { CXFA_ResolveNodesData rndBind; m_ResolveProcessor->GetFilter(wsExpression, nStart, rndBind); m_ResolveProcessor->SetIndexDataBind(rndBind.m_wsCondition, i, nNodes); - bDataBind = TRUE; + bDataBind = true; } rndFind.m_CurNode = findNodes[i++]; rndFind.m_nLevel = nLevel; @@ -653,7 +651,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, rndFind.m_pScriptAttribute && nStart < wsExpression.GetLength()) { std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(m_pIsolate)); (rndFind.m_Nodes[0]->*(rndFind.m_pScriptAttribute->lpfnCallback))( - pValue.get(), FALSE, + pValue.get(), false, (XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute); rndFind.m_Nodes.SetAt(0, ToObject(pValue.get(), nullptr)); } @@ -671,13 +669,13 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, nNodes = retNodes.GetSize(); if (nNodes < 1) { if (dwStyles & XFA_RESOLVENODE_CreateNode) { - bNextCreate = TRUE; + bNextCreate = true; if (!m_ResolveProcessor->GetNodeHelper()->m_pCreateParent) { m_ResolveProcessor->GetNodeHelper()->m_pCreateParent = ToNode(rndFind.m_CurNode); m_ResolveProcessor->GetNodeHelper()->m_iCreateCount = 1; } - FX_BOOL bCreate = + bool bCreate = m_ResolveProcessor->GetNodeHelper()->ResolveNodes_CreateNode( rndFind.m_wsName, rndFind.m_wsCondition, nStart == wsExpression.GetLength(), this); @@ -742,17 +740,17 @@ CFXJSE_Value* CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) { int32_t CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode) { CXFA_NodeHelper* lpNodeHelper = m_ResolveProcessor->GetNodeHelper(); return lpNodeHelper->GetIndex(refNode, XFA_LOGIC_Transparent, - lpNodeHelper->NodeIsProperty(refNode), FALSE); + lpNodeHelper->NodeIsProperty(refNode), false); } int32_t CXFA_ScriptContext::GetIndexByClassName(CXFA_Node* refNode) { CXFA_NodeHelper* lpNodeHelper = m_ResolveProcessor->GetNodeHelper(); return lpNodeHelper->GetIndex(refNode, XFA_LOGIC_Transparent, - lpNodeHelper->NodeIsProperty(refNode), TRUE); + lpNodeHelper->NodeIsProperty(refNode), true); } void CXFA_ScriptContext::GetSomExpression(CXFA_Node* refNode, CFX_WideString& wsExpression) { CXFA_NodeHelper* lpNodeHelper = m_ResolveProcessor->GetNodeHelper(); - lpNodeHelper->GetNameExpression(refNode, wsExpression, TRUE, + lpNodeHelper->GetNameExpression(refNode, wsExpression, true, XFA_LOGIC_Transparent); } void CXFA_ScriptContext::SetNodesOfRunScript(CXFA_NodeArray* pArray) { diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.h b/xfa/fxfa/parser/cxfa_scriptcontext.h index 656c51a8c8..664e3315bf 100644 --- a/xfa/fxfa/parser/cxfa_scriptcontext.h +++ b/xfa/fxfa/parser/cxfa_scriptcontext.h @@ -29,10 +29,10 @@ class CXFA_ScriptContext { void Initialize(v8::Isolate* pIsolate); void SetEventParam(CXFA_EventParam param) { m_eventParam = param; } CXFA_EventParam* GetEventParam() { return &m_eventParam; } - FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, - const CFX_WideStringC& wsScript, - CFXJSE_Value* pRetValue, - CXFA_Object* pThisObject = nullptr); + bool RunScript(XFA_SCRIPTLANGTYPE eScriptType, + const CFX_WideStringC& wsScript, + CFXJSE_Value* pRetValue, + CXFA_Object* pThisObject = nullptr); int32_t ResolveObjects(CXFA_Object* refNode, const CFX_WideStringC& wsExpression, @@ -54,18 +54,18 @@ class CXFA_ScriptContext { CFXJSE_Class* GetJseNormalClass(); void SetRunAtType(XFA_ATTRIBUTEENUM eRunAt) { m_eRunAtType = eRunAt; } - FX_BOOL IsRunAtClient() { return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; } - FX_BOOL QueryNodeByFlag(CXFA_Node* refNode, - const CFX_WideStringC& propname, + bool IsRunAtClient() { return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; } + bool QueryNodeByFlag(CXFA_Node* refNode, + const CFX_WideStringC& propname, + CFXJSE_Value* pValue, + uint32_t dwFlag, + bool bSetting); + bool QueryVariableValue(CXFA_Node* pScriptNode, + const CFX_ByteStringC& szPropName, CFXJSE_Value* pValue, - uint32_t dwFlag, - FX_BOOL bSetting); - FX_BOOL QueryVariableValue(CXFA_Node* pScriptNode, - const CFX_ByteStringC& szPropName, - CFXJSE_Value* pValue, - FX_BOOL bGetter); - FX_BOOL QueryBuiltinValue(const CFX_ByteStringC& szPropName, - CFXJSE_Value* pValue); + bool bGetter); + bool QueryBuiltinValue(const CFX_ByteStringC& szPropName, + CFXJSE_Value* pValue); static void GlobalPropertyGetter(CFXJSE_Value* pObject, const CFX_ByteStringC& szPropName, CFXJSE_Value* pValue); @@ -83,14 +83,13 @@ class CXFA_ScriptContext { CFXJSE_Arguments& args); static int32_t NormalPropTypeGetter(CFXJSE_Value* pObject, const CFX_ByteStringC& szPropName, - FX_BOOL bQueryIn); + bool bQueryIn); static int32_t GlobalPropTypeGetter(CFXJSE_Value* pObject, const CFX_ByteStringC& szPropName, - FX_BOOL bQueryIn); - FX_BOOL RunVariablesScript(CXFA_Node* pScriptNode); - CXFA_Object* GetVariablesThis(CXFA_Object* pObject, - FX_BOOL bScriptNode = FALSE); - FX_BOOL IsStrictScopeInJavaScript(); + bool bQueryIn); + bool RunVariablesScript(CXFA_Node* pScriptNode); + CXFA_Object* GetVariablesThis(CXFA_Object* pObject, bool bScriptNode = false); + bool IsStrictScopeInJavaScript(); XFA_SCRIPTLANGTYPE GetType(); CXFA_NodeArray& GetUpObjectArray() { return m_upObjectArray; } CXFA_Document* GetDocument() const { return m_pDocument; } diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp index 997094351e..4599b1c4fc 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.cpp +++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp @@ -19,7 +19,7 @@ namespace { CFDE_XMLNode* GetDocumentNode(CFDE_XMLDoc* pXMLDoc, - FX_BOOL bVerifyWellFormness = FALSE) { + bool bVerifyWellFormness = false) { if (!pXMLDoc) return nullptr; @@ -54,22 +54,22 @@ void GetElementTagNamespaceURI(CFDE_XMLElement* pElement, } } -FX_BOOL MatchNodeName(CFDE_XMLNode* pNode, - const CFX_WideStringC& wsLocalTagName, - const CFX_WideStringC& wsNamespaceURIPrefix, - uint32_t eMatchFlags = XFA_XDPPACKET_FLAGS_NOMATCH) { +bool MatchNodeName(CFDE_XMLNode* pNode, + const CFX_WideStringC& wsLocalTagName, + const CFX_WideStringC& wsNamespaceURIPrefix, + uint32_t eMatchFlags = XFA_XDPPACKET_FLAGS_NOMATCH) { if (!pNode || pNode->GetType() != FDE_XMLNODE_Element) - return FALSE; + return false; CFDE_XMLElement* pElement = reinterpret_cast<CFDE_XMLElement*>(pNode); CFX_WideString wsNodeStr; pElement->GetLocalTagName(wsNodeStr); if (wsNodeStr != wsLocalTagName) - return FALSE; + return false; GetElementTagNamespaceURI(pElement, wsNodeStr); if (eMatchFlags & XFA_XDPPACKET_FLAGS_NOMATCH) - return TRUE; + return true; if (eMatchFlags & XFA_XDPPACKET_FLAGS_PREFIXMATCH) { return wsNodeStr.Left(wsNamespaceURIPrefix.GetLength()) == wsNamespaceURIPrefix; @@ -77,22 +77,22 @@ FX_BOOL MatchNodeName(CFDE_XMLNode* pNode, return wsNodeStr == wsNamespaceURIPrefix; } -FX_BOOL GetAttributeLocalName(const CFX_WideStringC& wsAttributeName, - CFX_WideString& wsLocalAttrName) { +bool GetAttributeLocalName(const CFX_WideStringC& wsAttributeName, + CFX_WideString& wsLocalAttrName) { CFX_WideString wsAttrName(wsAttributeName); FX_STRSIZE iFind = wsAttrName.Find(L':', 0); if (iFind < 0) { wsLocalAttrName = wsAttrName; - return FALSE; + return false; } wsLocalAttrName = wsAttrName.Right(wsAttrName.GetLength() - iFind - 1); - return TRUE; + return true; } -FX_BOOL ResolveAttribute(CFDE_XMLElement* pElement, - const CFX_WideStringC& wsAttributeName, - CFX_WideString& wsLocalAttrName, - CFX_WideString& wsNamespaceURI) { +bool ResolveAttribute(CFDE_XMLElement* pElement, + const CFX_WideStringC& wsAttributeName, + CFX_WideString& wsLocalAttrName, + CFX_WideString& wsNamespaceURI) { CFX_WideString wsAttrName(wsAttributeName); CFX_WideString wsNSPrefix; if (GetAttributeLocalName(wsAttributeName, wsLocalAttrName)) { @@ -101,23 +101,23 @@ FX_BOOL ResolveAttribute(CFDE_XMLElement* pElement, } if (wsLocalAttrName == FX_WSTRC(L"xmlns") || wsNSPrefix == FX_WSTRC(L"xmlns") || wsNSPrefix == FX_WSTRC(L"xml")) { - return FALSE; + return false; } if (!XFA_FDEExtension_ResolveNamespaceQualifier( pElement, wsNSPrefix.AsStringC(), wsNamespaceURI)) { wsNamespaceURI.clear(); - return FALSE; + return false; } - return TRUE; + return true; } -FX_BOOL FindAttributeWithNS(CFDE_XMLElement* pElement, - const CFX_WideStringC& wsLocalAttributeName, - const CFX_WideStringC& wsNamespaceURIPrefix, - CFX_WideString& wsValue, - FX_BOOL bMatchNSAsPrefix = FALSE) { +bool FindAttributeWithNS(CFDE_XMLElement* pElement, + const CFX_WideStringC& wsLocalAttributeName, + const CFX_WideStringC& wsNamespaceURIPrefix, + CFX_WideString& wsValue, + bool bMatchNSAsPrefix = false) { if (!pElement) - return FALSE; + return false; CFX_WideString wsAttrName; CFX_WideString wsAttrValue; @@ -151,9 +151,9 @@ FX_BOOL FindAttributeWithNS(CFDE_XMLElement* pElement, continue; } wsValue = wsAttrValue; - return TRUE; + return true; } - return FALSE; + return false; } CFDE_XMLNode* GetDataSetsFromXDP(CFDE_XMLNode* pXMLDocumentNode) { @@ -184,7 +184,7 @@ CFDE_XMLNode* GetDataSetsFromXDP(CFDE_XMLNode* pXMLDocumentNode) { return nullptr; } -FX_BOOL IsStringAllWhitespace(CFX_WideString wsText) { +bool IsStringAllWhitespace(CFX_WideString wsText) { wsText.TrimRight(L"\x20\x9\xD\xA"); return wsText.IsEmpty(); } @@ -222,7 +222,7 @@ void ConvertXMLToPlainText(CFDE_XMLElement* pRootXMLNode, break; } default: - ASSERT(FALSE); + ASSERT(false); break; } } @@ -250,14 +250,14 @@ const XFA_PACKETINFO* GetPacketByName(const CFX_WideStringC& wsName) { } // namespace -FX_BOOL XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode) { +bool XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode) { if (pRichTextXMLNode) { CFX_WideString wsNamespaceURI; GetElementTagNamespaceURI(pRichTextXMLNode, wsNamespaceURI); if (wsNamespaceURI == FX_WSTRC(L"http://www.w3.org/1999/xhtml")) - return TRUE; + return true; } - return FALSE; + return false; } CXFA_SimpleParser::CXFA_SimpleParser(CXFA_Document* pFactory, @@ -381,13 +381,13 @@ void CXFA_SimpleParser::ConstructXFANode(CXFA_Node* pXFANode, } m_pRootNode = pXFANode; } else { - m_pRootNode = DataLoader(pXFANode, pXMLNode, TRUE); + m_pRootNode = DataLoader(pXFANode, pXMLNode, true); } } else if (pXFANode->IsContentNode()) { ParseContentNode(pXFANode, pXMLNode, ePacketID); m_pRootNode = pXFANode; } else { - m_pRootNode = NormalLoader(pXFANode, pXMLNode, ePacketID, TRUE); + m_pRootNode = NormalLoader(pXFANode, pXMLNode, ePacketID, true); } } @@ -399,19 +399,19 @@ CFDE_XMLDoc* CXFA_SimpleParser::GetXMLDoc() const { return m_pXMLDoc.get(); } -FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( +bool XFA_FDEExtension_ResolveNamespaceQualifier( CFDE_XMLElement* pNode, const CFX_WideStringC& wsQualifier, CFX_WideString& wsNamespaceURI) { if (!pNode) - return FALSE; + return false; CFDE_XMLNode* pFakeRoot = pNode->GetNodeItem(CFDE_XMLNode::Root); CFX_WideString wsNSAttribute; - FX_BOOL bRet = FALSE; + bool bRet = false; if (wsQualifier.IsEmpty()) { wsNSAttribute = FX_WSTRC(L"xmlns"); - bRet = TRUE; + bRet = true; } else { wsNSAttribute = FX_WSTRC(L"xmlns:") + wsQualifier; } @@ -422,7 +422,7 @@ FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( if (pNode->HasAttribute(wsNSAttribute.c_str())) { pNode->GetString(wsNSAttribute.c_str(), wsNamespaceURI); - return TRUE; + return true; } } wsNamespaceURI.clear(); @@ -606,7 +606,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Config( pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_Config)->pName); - if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE)) + if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true)) return nullptr; pNode->SetXMLMappingNode(pXMLDocumentNode); @@ -639,7 +639,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( pNode->GetDocument()->RecognizeXFAVersionNumber(wsNamespaceURI); } - if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE)) + if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true)) return nullptr; } } else if (ePacketID == XFA_XDPPACKET_Form) { @@ -679,11 +679,11 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( pTemplateRoot ? pTemplateRoot->GetFirstChildByClass(XFA_Element::Subform) : nullptr; - FX_BOOL bUseAttribute = TRUE; + bool bUseAttribute = true; if (pTemplateChosen && pTemplateChosen->GetEnum(XFA_ATTRIBUTE_RestoreState) != XFA_ATTRIBUTEENUM_Auto) { - bUseAttribute = FALSE; + bUseAttribute = false; } if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, bUseAttribute)) return nullptr; @@ -707,7 +707,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_Datasets)->pName); - if (!DataLoader(pNode, pDatasetsXMLNode, FALSE)) + if (!DataLoader(pNode, pDatasetsXMLNode, false)) return nullptr; pNode->SetXMLMappingNode(pDatasetsXMLNode); @@ -748,7 +748,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( CFX_WideString wsLocalName; static_cast<CFDE_XMLElement*>(pDataXMLNode)->GetLocalTagName(wsLocalName); pNode->SetCData(XFA_ATTRIBUTE_Name, wsLocalName); - if (!DataLoader(pNode, pDataXMLNode, TRUE)) + if (!DataLoader(pNode, pDataXMLNode, true)) return nullptr; pNode->SetXMLMappingNode(pDataXMLNode); @@ -775,7 +775,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet( pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_LocaleSet)->pName); - if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE)) + if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true)) return nullptr; } } else if (ePacketID == XFA_XDPPACKET_ConnectionSet) { @@ -790,7 +790,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet( pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_ConnectionSet)->pName); - if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE)) + if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true)) return nullptr; } } else if (ePacketID == XFA_XDPPACKET_SourceSet) { @@ -805,7 +805,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet( pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_SourceSet)->pName); - if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE)) + if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true)) return nullptr; } } @@ -859,7 +859,7 @@ CXFA_Node* CXFA_SimpleParser::UserPacketLoader(CXFA_Node* pXFANode, CXFA_Node* CXFA_SimpleParser::DataLoader(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLDoc, - FX_BOOL bDoTransform) { + bool bDoTransform) { ParseDataGroup(pXFANode, pXMLDoc, XFA_XDPPACKET_Datasets); return pXFANode; } @@ -867,8 +867,8 @@ CXFA_Node* CXFA_SimpleParser::DataLoader(CXFA_Node* pXFANode, CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLDoc, XFA_XDPPACKET ePacketID, - FX_BOOL bUseAttribute) { - FX_BOOL bOneOfPropertyFound = FALSE; + bool bUseAttribute) { + bool bOneOfPropertyFound = false; for (CFDE_XMLNode* pXMLChild = pXMLDoc->GetNodeItem(CFDE_XMLNode::FirstChild); pXMLChild; pXMLChild = pXMLChild->GetNodeItem(CFDE_XMLNode::NextSibling)) { @@ -889,7 +889,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, if (bOneOfPropertyFound) break; - bOneOfPropertyFound = TRUE; + bOneOfPropertyFound = true; } CXFA_Node* pXFAChild = m_pFactory->CreateNode(ePacketID, eType); if (!pXFAChild) @@ -897,7 +897,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, if (ePacketID == XFA_XDPPACKET_Config) pXFAChild->SetAttribute(XFA_ATTRIBUTE_Name, wsTagName.AsStringC()); - FX_BOOL IsNeedValue = TRUE; + bool IsNeedValue = true; for (int32_t i = 0, count = pXMLElement->CountAttributes(); i < count; i++) { CFX_WideString wsAttrQualifiedName; @@ -907,7 +907,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, GetAttributeLocalName(wsAttrQualifiedName.AsStringC(), wsAttrName); if (wsAttrName == FX_WSTRC(L"nil") && wsAttrValue == FX_WSTRC(L"true")) { - IsNeedValue = FALSE; + IsNeedValue = false; } const XFA_ATTRIBUTEINFO* lpAttrInfo = XFA_GetAttributeByName(wsAttrName.AsStringC()); @@ -1181,7 +1181,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, XFA_XDPPACKET ePacketID) { CFX_WideTextBuf wsValueTextBuf; CFX_WideTextBuf wsCurValueTextBuf; - FX_BOOL bMarkAsCompound = FALSE; + bool bMarkAsCompound = false; CFDE_XMLNode* pXMLCurValueNode = nullptr; for (CFDE_XMLNode* pXMLChild = pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); @@ -1213,7 +1213,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, wsCurValueTextBuf << wsText; } else { - bMarkAsCompound = TRUE; + bMarkAsCompound = true; if (pXMLCurValueNode) { CFX_WideString wsCurValue = wsCurValueTextBuf.MakeString(); if (!wsCurValue.IsEmpty()) { @@ -1288,7 +1288,7 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode, wsData.clear(); if (pXMLInstruction->GetData(1, wsData) && wsData == FX_WSTRC(L"v2.7-scripting:1")) { - pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_Scripting, TRUE); + pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_Scripting, true); } } } else if (wsTargetName == FX_WSTRC(L"acrobat")) { @@ -1297,7 +1297,7 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode, wsData == FX_WSTRC(L"JavaScript")) { if (pXMLInstruction->GetData(1, wsData) && wsData == FX_WSTRC(L"strictScoping")) { - pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_StrictScoping, TRUE); + pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_StrictScoping, true); } } } diff --git a/xfa/fxfa/parser/cxfa_simple_parser.h b/xfa/fxfa/parser/cxfa_simple_parser.h index 2b1e192e92..db6765f400 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.h +++ b/xfa/fxfa/parser/cxfa_simple_parser.h @@ -57,10 +57,10 @@ class CXFA_SimpleParser { CXFA_Node* NormalLoader(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLDoc, XFA_XDPPACKET ePacketID, - FX_BOOL bUseAttribute); + bool bUseAttribute); CXFA_Node* DataLoader(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLDoc, - FX_BOOL bDoTransform); + bool bDoTransform); CXFA_Node* UserPacketLoader(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLDoc); void ParseContentNode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode, @@ -82,7 +82,7 @@ class CXFA_SimpleParser { CXFA_Document* m_pFactory; CXFA_Node* m_pRootNode; XFA_XDPPACKET m_ePacketID; - FX_BOOL m_bDocumentParser; + bool m_bDocumentParser; }; #endif // XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_ diff --git a/xfa/fxfa/parser/cxfa_stroke.cpp b/xfa/fxfa/parser/cxfa_stroke.cpp index 77549f00ed..602f2f9f1f 100644 --- a/xfa/fxfa/parser/cxfa_stroke.cpp +++ b/xfa/fxfa/parser/cxfa_stroke.cpp @@ -76,8 +76,8 @@ int32_t CXFA_Stroke::GetJoinType() const { : XFA_ATTRIBUTEENUM_Square; } -FX_BOOL CXFA_Stroke::IsInverted() const { - return m_pNode ? m_pNode->GetBoolean(XFA_ATTRIBUTE_Inverted) : FALSE; +bool CXFA_Stroke::IsInverted() const { + return m_pNode ? m_pNode->GetBoolean(XFA_ATTRIBUTE_Inverted) : false; } FX_FLOAT CXFA_Stroke::GetRadius() const { @@ -85,22 +85,22 @@ FX_FLOAT CXFA_Stroke::GetRadius() const { : 0; } -FX_BOOL CXFA_Stroke::SameStyles(CXFA_Stroke stroke, uint32_t dwFlags) const { +bool CXFA_Stroke::SameStyles(CXFA_Stroke stroke, uint32_t dwFlags) const { if (m_pNode == stroke.GetNode()) - return TRUE; + return true; if (FXSYS_fabs(GetThickness() - stroke.GetThickness()) >= 0.01f) - return FALSE; + return false; if ((dwFlags & XFA_STROKE_SAMESTYLE_NoPresence) == 0 && IsVisible() != stroke.IsVisible()) { - return FALSE; + return false; } if (GetStrokeType() != stroke.GetStrokeType()) - return FALSE; + return false; if (GetColor() != stroke.GetColor()) - return FALSE; + return false; if ((dwFlags & XFA_STROKE_SAMESTYLE_Corner) != 0 && FXSYS_fabs(GetRadius() - stroke.GetRadius()) >= 0.01f) { - return FALSE; + return false; } - return TRUE; + return true; } diff --git a/xfa/fxfa/parser/cxfa_stroke.h b/xfa/fxfa/parser/cxfa_stroke.h index d42ece32c8..a3287d2855 100644 --- a/xfa/fxfa/parser/cxfa_stroke.h +++ b/xfa/fxfa/parser/cxfa_stroke.h @@ -35,9 +35,9 @@ class CXFA_Stroke : public CXFA_Data { FX_ARGB GetColor() const; void SetColor(FX_ARGB argb); int32_t GetJoinType() const; - FX_BOOL IsInverted() const; + bool IsInverted() const; FX_FLOAT GetRadius() const; - FX_BOOL SameStyles(CXFA_Stroke stroke, uint32_t dwFlags = 0) const; + bool SameStyles(CXFA_Stroke stroke, uint32_t dwFlags = 0) const; }; typedef CFX_ArrayTemplate<CXFA_Stroke> CXFA_StrokeArray; diff --git a/xfa/fxfa/parser/cxfa_submit.cpp b/xfa/fxfa/parser/cxfa_submit.cpp index 2aa011b0e3..50bef1e811 100644 --- a/xfa/fxfa/parser/cxfa_submit.cpp +++ b/xfa/fxfa/parser/cxfa_submit.cpp @@ -10,7 +10,7 @@ CXFA_Submit::CXFA_Submit(CXFA_Node* pNode) : CXFA_Data(pNode) {} -FX_BOOL CXFA_Submit::IsSubmitEmbedPDF() { +bool CXFA_Submit::IsSubmitEmbedPDF() { return m_pNode->GetBoolean(XFA_ATTRIBUTE_EmbedPDF); } diff --git a/xfa/fxfa/parser/cxfa_submit.h b/xfa/fxfa/parser/cxfa_submit.h index 29cd1cff80..f10435e1f5 100644 --- a/xfa/fxfa/parser/cxfa_submit.h +++ b/xfa/fxfa/parser/cxfa_submit.h @@ -17,7 +17,7 @@ class CXFA_Submit : public CXFA_Data { public: explicit CXFA_Submit(CXFA_Node* pNode); - FX_BOOL IsSubmitEmbedPDF(); + bool IsSubmitEmbedPDF(); int32_t GetSubmitFormat(); void GetSubmitTarget(CFX_WideStringC& wsTarget); void GetSubmitXDPContent(CFX_WideStringC& wsContent); diff --git a/xfa/fxfa/parser/cxfa_tooltip.cpp b/xfa/fxfa/parser/cxfa_tooltip.cpp index 079b365e46..afe0e224af 100644 --- a/xfa/fxfa/parser/cxfa_tooltip.cpp +++ b/xfa/fxfa/parser/cxfa_tooltip.cpp @@ -10,6 +10,6 @@ CXFA_ToolTip::CXFA_ToolTip(CXFA_Node* pNode) : CXFA_Data(pNode) {} -FX_BOOL CXFA_ToolTip::GetTip(CFX_WideString& wsTip) { +bool CXFA_ToolTip::GetTip(CFX_WideString& wsTip) { return m_pNode->TryContent(wsTip); } diff --git a/xfa/fxfa/parser/cxfa_tooltip.h b/xfa/fxfa/parser/cxfa_tooltip.h index 93ba2ba72c..433885d89c 100644 --- a/xfa/fxfa/parser/cxfa_tooltip.h +++ b/xfa/fxfa/parser/cxfa_tooltip.h @@ -16,7 +16,7 @@ class CXFA_ToolTip : public CXFA_Data { public: explicit CXFA_ToolTip(CXFA_Node* pNode); - FX_BOOL GetTip(CFX_WideString& wsTip); + bool GetTip(CFX_WideString& wsTip); }; #endif // XFA_FXFA_PARSER_CXFA_TOOLTIP_H_ diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp index 2309a07799..5706d96aaa 100644 --- a/xfa/fxfa/parser/cxfa_validate.cpp +++ b/xfa/fxfa/parser/cxfa_validate.cpp @@ -14,19 +14,19 @@ int32_t CXFA_Validate::GetFormatTest() { return m_pNode->GetEnum(XFA_ATTRIBUTE_FormatTest); } -FX_BOOL CXFA_Validate::SetTestValue(int32_t iType, - CFX_WideString& wsValue, - XFA_ATTRIBUTEENUM eName) { +bool CXFA_Validate::SetTestValue(int32_t iType, + CFX_WideString& wsValue, + XFA_ATTRIBUTEENUM eName) { const XFA_ATTRIBUTEENUMINFO* pInfo = XFA_GetAttributeEnumByName(wsValue.AsStringC()); if (pInfo) eName = pInfo->eName; - m_pNode->SetEnum((XFA_ATTRIBUTE)iType, eName, FALSE); - return TRUE; + m_pNode->SetEnum((XFA_ATTRIBUTE)iType, eName, false); + return true; } -FX_BOOL CXFA_Validate::SetNullTest(CFX_WideString wsValue) { +bool CXFA_Validate::SetNullTest(CFX_WideString wsValue) { return SetTestValue(XFA_ATTRIBUTE_NullTest, wsValue, XFA_ATTRIBUTEENUM_Disabled); } @@ -41,7 +41,7 @@ int32_t CXFA_Validate::GetScriptTest() { void CXFA_Validate::GetMessageText(CFX_WideString& wsMessage, const CFX_WideString& wsMessageType) { - CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, FALSE); + CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, false); if (!pNode) return; @@ -78,7 +78,7 @@ void CXFA_Validate::GetNullMessageText(CFX_WideString& wsMessage) { void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage, const CFX_WideString& wsMessageType) { - CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, TRUE); + CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, true); if (!pNode) return; @@ -91,14 +91,14 @@ void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage, CFX_WideStringC wsName; pItemNode->TryCData(XFA_ATTRIBUTE_Name, wsName); if (wsName.IsEmpty() || wsName == wsMessageType) { - pItemNode->SetContent(wsMessage, wsMessage, FALSE); + pItemNode->SetContent(wsMessage, wsMessage, false); return; } } CXFA_Node* pTextNode = pNode->CreateSamePacketNode(XFA_Element::Text); pNode->InsertChild(pTextNode); - pTextNode->SetCData(XFA_ATTRIBUTE_Name, wsMessageType, FALSE); - pTextNode->SetContent(wsMessage, wsMessage, FALSE); + pTextNode->SetCData(XFA_ATTRIBUTE_Name, wsMessageType, false); + pTextNode->SetContent(wsMessage, wsMessage, false); } void CXFA_Validate::GetScriptMessageText(CFX_WideString& wsMessage) { diff --git a/xfa/fxfa/parser/cxfa_validate.h b/xfa/fxfa/parser/cxfa_validate.h index da9654a5a0..03bbaddf7b 100644 --- a/xfa/fxfa/parser/cxfa_validate.h +++ b/xfa/fxfa/parser/cxfa_validate.h @@ -20,7 +20,7 @@ class CXFA_Validate : public CXFA_Data { int32_t GetFormatTest(); int32_t GetNullTest(); - FX_BOOL SetNullTest(CFX_WideString wsValue); + bool SetNullTest(CFX_WideString wsValue); int32_t GetScriptTest(); void GetFormatMessageText(CFX_WideString& wsMessage); void SetFormatMessageText(CFX_WideString wsMessage); @@ -36,9 +36,9 @@ class CXFA_Validate : public CXFA_Data { const CFX_WideString& wsMessageType); void SetMessageText(CFX_WideString& wsMessage, const CFX_WideString& wsMessageType); - FX_BOOL SetTestValue(int32_t iType, - CFX_WideString& wsValue, - XFA_ATTRIBUTEENUM eName); + bool SetTestValue(int32_t iType, + CFX_WideString& wsValue, + XFA_ATTRIBUTEENUM eName); }; #endif // XFA_FXFA_PARSER_CXFA_VALIDATE_H_ diff --git a/xfa/fxfa/parser/cxfa_value.cpp b/xfa/fxfa/parser/cxfa_value.cpp index 70b1aba5ab..4d467aee2c 100644 --- a/xfa/fxfa/parser/cxfa_value.cpp +++ b/xfa/fxfa/parser/cxfa_value.cpp @@ -16,12 +16,12 @@ XFA_Element CXFA_Value::GetChildValueClassID() { return XFA_Element::Unknown; } -FX_BOOL CXFA_Value::GetChildValueContent(CFX_WideString& wsContent) { +bool CXFA_Value::GetChildValueContent(CFX_WideString& wsContent) { if (!m_pNode) - return FALSE; + return false; if (CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild)) return pNode->TryContent(wsContent); - return FALSE; + return false; } CXFA_Arc CXFA_Value::GetArc() { @@ -52,5 +52,5 @@ CXFA_ExData CXFA_Value::GetExData() { CXFA_Image CXFA_Value::GetImage() { return CXFA_Image( m_pNode ? (m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild)) : nullptr, - TRUE); + true); } diff --git a/xfa/fxfa/parser/cxfa_value.h b/xfa/fxfa/parser/cxfa_value.h index c3a03950ec..225e1879da 100644 --- a/xfa/fxfa/parser/cxfa_value.h +++ b/xfa/fxfa/parser/cxfa_value.h @@ -23,7 +23,7 @@ class CXFA_Value : public CXFA_Data { explicit CXFA_Value(CXFA_Node* pNode) : CXFA_Data(pNode) {} XFA_Element GetChildValueClassID(); - FX_BOOL GetChildValueContent(CFX_WideString& wsContent); + bool GetChildValueContent(CFX_WideString& wsContent); CXFA_Arc GetArc(); CXFA_Line GetLine(); CXFA_Rectangle GetRectangle(); diff --git a/xfa/fxfa/parser/cxfa_widetextread.cpp b/xfa/fxfa/parser/cxfa_widetextread.cpp index 7c6487db6a..35d4dc1270 100644 --- a/xfa/fxfa/parser/cxfa_widetextread.cpp +++ b/xfa/fxfa/parser/cxfa_widetextread.cpp @@ -50,7 +50,7 @@ int32_t CXFA_WideTextRead::GetPosition() { return m_iPosition * sizeof(FX_WCHAR); } -FX_BOOL CXFA_WideTextRead::IsEOF() const { +bool CXFA_WideTextRead::IsEOF() const { return m_iPosition >= m_wsBuffer.GetLength(); } @@ -60,7 +60,7 @@ int32_t CXFA_WideTextRead::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { int32_t CXFA_WideTextRead::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) { + bool& bEOS) { iMaxLength = std::min(iMaxLength, m_wsBuffer.GetLength() - m_iPosition); if (iMaxLength == 0) return 0; @@ -80,8 +80,8 @@ int32_t CXFA_WideTextRead::WriteString(const FX_WCHAR* pStr, int32_t iLength) { return 0; } -FX_BOOL CXFA_WideTextRead::SetLength(int32_t iLength) { - return FALSE; +bool CXFA_WideTextRead::SetLength(int32_t iLength) { + return false; } int32_t CXFA_WideTextRead::GetBOM(uint8_t bom[4]) const { diff --git a/xfa/fxfa/parser/cxfa_widetextread.h b/xfa/fxfa/parser/cxfa_widetextread.h index 9ee2c4132e..e0f0eac358 100644 --- a/xfa/fxfa/parser/cxfa_widetextread.h +++ b/xfa/fxfa/parser/cxfa_widetextread.h @@ -20,15 +20,13 @@ class CXFA_WideTextRead : public IFX_Stream { int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override; - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override; - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override; + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override; int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override; void Flush() override {} - FX_BOOL SetLength(int32_t iLength) override; + bool SetLength(int32_t iLength) override; int32_t GetBOM(uint8_t bom[4]) const override; uint16_t GetCodePage() const override; uint16_t SetCodePage(uint16_t wCodePage) override; diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index f237ad0a00..c9523383dd 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -18,7 +18,7 @@ namespace { FX_FLOAT GetEdgeThickness(const CXFA_StrokeArray& strokes, - FX_BOOL b3DStyle, + bool b3DStyle, int32_t nIndex) { FX_FLOAT fThickness = 0; @@ -31,20 +31,20 @@ FX_FLOAT GetEdgeThickness(const CXFA_StrokeArray& strokes, return fThickness; } -FX_BOOL SplitDateTime(const CFX_WideString& wsDateTime, - CFX_WideString& wsDate, - CFX_WideString& wsTime) { +bool SplitDateTime(const CFX_WideString& wsDateTime, + CFX_WideString& wsDate, + CFX_WideString& wsTime) { wsDate = L""; wsTime = L""; if (wsDateTime.IsEmpty()) - return FALSE; + return false; int nSplitIndex = -1; nSplitIndex = wsDateTime.Find('T'); if (nSplitIndex < 0) nSplitIndex = wsDateTime.Find(' '); if (nSplitIndex < 0) - return FALSE; + return false; wsDate = wsDateTime.Left(nSplitIndex); if (!wsDate.IsEmpty()) { @@ -55,7 +55,7 @@ FX_BOOL SplitDateTime(const CFX_WideString& wsDateTime, break; } if (i == iCount) - return FALSE; + return false; } wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1); if (!wsTime.IsEmpty()) { @@ -66,9 +66,9 @@ FX_BOOL SplitDateTime(const CFX_WideString& wsDateTime, break; } if (i == iCount) - return FALSE; + return false; } - return TRUE; + return true; } CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { @@ -79,7 +79,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { eWidgetType = XFA_Element::Unknown; XFA_Element eUIType = XFA_Element::Unknown; - CXFA_Value defValue(pNode->GetProperty(0, XFA_Element::Value, TRUE)); + CXFA_Value defValue(pNode->GetProperty(0, XFA_Element::Value, true)); XFA_Element eValueType = defValue.GetChildValueClassID(); switch (eValueType) { case XFA_Element::Boolean: @@ -115,7 +115,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { } CXFA_Node* pUIChild = nullptr; - CXFA_Node* pUI = pNode->GetProperty(0, XFA_Element::Ui, TRUE); + CXFA_Node* pUI = pNode->GetProperty(0, XFA_Element::Ui, true); CXFA_Node* pChild = pUI->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pChild; pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { XFA_Element eChildType = pChild->GetElementType(); @@ -160,9 +160,9 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { if (!pUIChild) { if (eUIType == XFA_Element::Unknown) { eUIType = XFA_Element::TextEdit; - defValue.GetNode()->GetProperty(0, XFA_Element::Text, TRUE); + defValue.GetNode()->GetProperty(0, XFA_Element::Text, true); } - return pUI->GetProperty(0, eUIType, TRUE); + return pUI->GetProperty(0, eUIType, true); } if (eUIType != XFA_Element::Unknown) @@ -202,7 +202,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { eValueType = XFA_Element::Text; break; } - defValue.GetNode()->GetProperty(0, eValueType, TRUE); + defValue.GetNode()->GetProperty(0, eValueType, true); return pUIChild; } @@ -229,23 +229,23 @@ CFX_WideStringC GetAttributeDefaultValue_Cdata(XFA_Element eElement, return nullptr; } -FX_BOOL GetAttributeDefaultValue_Boolean(XFA_Element eElement, - XFA_ATTRIBUTE eAttribute, - uint32_t dwPacket) { +bool GetAttributeDefaultValue_Boolean(XFA_Element eElement, + XFA_ATTRIBUTE eAttribute, + uint32_t dwPacket) { void* pValue; if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute, XFA_ATTRIBUTETYPE_Boolean, dwPacket)) { return !!pValue; } - return FALSE; + return false; } } // namespace CXFA_WidgetData::CXFA_WidgetData(CXFA_Node* pNode) : CXFA_Data(pNode), - m_bIsNull(TRUE), - m_bPreNull(TRUE), + m_bIsNull(true), + m_bPreNull(true), m_pUiChildNode(nullptr), m_eUIType(XFA_Element::Unknown) {} @@ -265,7 +265,7 @@ CFX_WideString CXFA_WidgetData::GetRawValue() { return m_pNode->GetContent(); } -int32_t CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) { +int32_t CXFA_WidgetData::GetAccess(bool bTemplate) { if (bTemplate) { CXFA_Node* pNode = m_pNode->GetTemplateNode(); if (pNode) @@ -286,7 +286,7 @@ int32_t CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) { int32_t CXFA_WidgetData::GetRotate() { CXFA_Measurement ms; - if (!m_pNode->TryMeasure(XFA_ATTRIBUTE_Rotate, ms, FALSE)) + if (!m_pNode->TryMeasure(XFA_ATTRIBUTE_Rotate, ms, false)) return 0; int32_t iRotate = FXSYS_round(ms.GetValue()); @@ -294,23 +294,23 @@ int32_t CXFA_WidgetData::GetRotate() { return iRotate / 90 * 90; } -CXFA_Border CXFA_WidgetData::GetBorder(FX_BOOL bModified) { +CXFA_Border CXFA_WidgetData::GetBorder(bool bModified) { return CXFA_Border(m_pNode->GetProperty(0, XFA_Element::Border, bModified)); } -CXFA_Caption CXFA_WidgetData::GetCaption(FX_BOOL bModified) { +CXFA_Caption CXFA_WidgetData::GetCaption(bool bModified) { return CXFA_Caption(m_pNode->GetProperty(0, XFA_Element::Caption, bModified)); } -CXFA_Font CXFA_WidgetData::GetFont(FX_BOOL bModified) { +CXFA_Font CXFA_WidgetData::GetFont(bool bModified) { return CXFA_Font(m_pNode->GetProperty(0, XFA_Element::Font, bModified)); } -CXFA_Margin CXFA_WidgetData::GetMargin(FX_BOOL bModified) { +CXFA_Margin CXFA_WidgetData::GetMargin(bool bModified) { return CXFA_Margin(m_pNode->GetProperty(0, XFA_Element::Margin, bModified)); } -CXFA_Para CXFA_WidgetData::GetPara(FX_BOOL bModified) { +CXFA_Para CXFA_WidgetData::GetPara(bool bModified) { return CXFA_Para(m_pNode->GetProperty(0, XFA_Element::Para, bModified)); } @@ -320,7 +320,7 @@ void CXFA_WidgetData::GetEventList(CXFA_NodeArray& events) { int32_t CXFA_WidgetData::GetEventByActivity(int32_t iActivity, CXFA_NodeArray& events, - FX_BOOL bIsFormReady) { + bool bIsFormReady) { CXFA_NodeArray allEvents; GetEventList(allEvents); int32_t iCount = allEvents.GetSize(); @@ -345,67 +345,67 @@ int32_t CXFA_WidgetData::GetEventByActivity(int32_t iActivity, return events.GetSize(); } -CXFA_Value CXFA_WidgetData::GetDefaultValue(FX_BOOL bModified) { +CXFA_Value CXFA_WidgetData::GetDefaultValue(bool bModified) { CXFA_Node* pTemNode = m_pNode->GetTemplateNode(); return CXFA_Value( pTemNode ? pTemNode->GetProperty(0, XFA_Element::Value, bModified) : nullptr); } -CXFA_Value CXFA_WidgetData::GetFormValue(FX_BOOL bModified) { +CXFA_Value CXFA_WidgetData::GetFormValue(bool bModified) { return CXFA_Value(m_pNode->GetProperty(0, XFA_Element::Value, bModified)); } -CXFA_Calculate CXFA_WidgetData::GetCalculate(FX_BOOL bModified) { +CXFA_Calculate CXFA_WidgetData::GetCalculate(bool bModified) { return CXFA_Calculate( m_pNode->GetProperty(0, XFA_Element::Calculate, bModified)); } -CXFA_Validate CXFA_WidgetData::GetValidate(FX_BOOL bModified) { +CXFA_Validate CXFA_WidgetData::GetValidate(bool bModified) { return CXFA_Validate( m_pNode->GetProperty(0, XFA_Element::Validate, bModified)); } -CXFA_Bind CXFA_WidgetData::GetBind(FX_BOOL bModified) { +CXFA_Bind CXFA_WidgetData::GetBind(bool bModified) { return CXFA_Bind(m_pNode->GetProperty(0, XFA_Element::Bind, bModified)); } -CXFA_Assist CXFA_WidgetData::GetAssist(FX_BOOL bModified) { +CXFA_Assist CXFA_WidgetData::GetAssist(bool bModified) { return CXFA_Assist(m_pNode->GetProperty(0, XFA_Element::Assist, bModified)); } -FX_BOOL CXFA_WidgetData::GetWidth(FX_FLOAT& fWidth) { +bool CXFA_WidgetData::GetWidth(FX_FLOAT& fWidth) { return TryMeasure(XFA_ATTRIBUTE_W, fWidth); } -FX_BOOL CXFA_WidgetData::GetHeight(FX_FLOAT& fHeight) { +bool CXFA_WidgetData::GetHeight(FX_FLOAT& fHeight) { return TryMeasure(XFA_ATTRIBUTE_H, fHeight); } -FX_BOOL CXFA_WidgetData::GetMinWidth(FX_FLOAT& fMinWidth) { +bool CXFA_WidgetData::GetMinWidth(FX_FLOAT& fMinWidth) { return TryMeasure(XFA_ATTRIBUTE_MinW, fMinWidth); } -FX_BOOL CXFA_WidgetData::GetMinHeight(FX_FLOAT& fMinHeight) { +bool CXFA_WidgetData::GetMinHeight(FX_FLOAT& fMinHeight) { return TryMeasure(XFA_ATTRIBUTE_MinH, fMinHeight); } -FX_BOOL CXFA_WidgetData::GetMaxWidth(FX_FLOAT& fMaxWidth) { +bool CXFA_WidgetData::GetMaxWidth(FX_FLOAT& fMaxWidth) { return TryMeasure(XFA_ATTRIBUTE_MaxW, fMaxWidth); } -FX_BOOL CXFA_WidgetData::GetMaxHeight(FX_FLOAT& fMaxHeight) { +bool CXFA_WidgetData::GetMaxHeight(FX_FLOAT& fMaxHeight) { return TryMeasure(XFA_ATTRIBUTE_MaxH, fMaxHeight); } -CXFA_Border CXFA_WidgetData::GetUIBorder(FX_BOOL bModified) { +CXFA_Border CXFA_WidgetData::GetUIBorder(bool bModified) { CXFA_Node* pUIChild = GetUIChild(); return CXFA_Border( pUIChild ? pUIChild->GetProperty(0, XFA_Element::Border, bModified) : nullptr); } -CXFA_Margin CXFA_WidgetData::GetUIMargin(FX_BOOL bModified) { +CXFA_Margin CXFA_WidgetData::GetUIMargin(bool bModified) { CXFA_Node* pUIChild = GetUIChild(); return CXFA_Margin( pUIChild ? pUIChild->GetProperty(0, XFA_Element::Margin, bModified) @@ -423,12 +423,12 @@ void CXFA_WidgetData::GetUIMargin(CFX_RectF& rtUIMargin) { return; FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset; - FX_BOOL bLeft = mgUI.GetLeftInset(fLeftInset); - FX_BOOL bTop = mgUI.GetTopInset(fTopInset); - FX_BOOL bRight = mgUI.GetRightInset(fRightInset); - FX_BOOL bBottom = mgUI.GetBottomInset(fBottomInset); + bool bLeft = mgUI.GetLeftInset(fLeftInset); + bool bTop = mgUI.GetTopInset(fTopInset); + bool bRight = mgUI.GetRightInset(fRightInset); + bool bBottom = mgUI.GetBottomInset(fBottomInset); if (border) { - FX_BOOL bVisible = FALSE; + bool bVisible = false; FX_FLOAT fThickness = 0; border.Get3DStyle(bVisible, fThickness); if (!bLeft || !bTop || !bRight || !bBottom) { @@ -455,8 +455,8 @@ int32_t CXFA_WidgetData::GetButtonHighlight() { XFA_Element::Button, XFA_ATTRIBUTE_Highlight, XFA_XDPPACKET_Form); } -FX_BOOL CXFA_WidgetData::GetButtonRollover(CFX_WideString& wsRollover, - FX_BOOL& bRichText) { +bool CXFA_WidgetData::GetButtonRollover(CFX_WideString& wsRollover, + bool& bRichText) { if (CXFA_Node* pItems = m_pNode->GetChild(0, XFA_Element::Items)) { CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild); while (pText) { @@ -470,11 +470,10 @@ FX_BOOL CXFA_WidgetData::GetButtonRollover(CFX_WideString& wsRollover, pText = pText->GetNodeItem(XFA_NODEITEM_NextSibling); } } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetButtonDown(CFX_WideString& wsDown, - FX_BOOL& bRichText) { +bool CXFA_WidgetData::GetButtonDown(CFX_WideString& wsDown, bool& bRichText) { if (CXFA_Node* pItems = m_pNode->GetChild(0, XFA_Element::Items)) { CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild); while (pText) { @@ -488,7 +487,7 @@ FX_BOOL CXFA_WidgetData::GetButtonDown(CFX_WideString& wsDown, pText = pText->GetNodeItem(XFA_NODEITEM_NextSibling); } } - return FALSE; + return false; } int32_t CXFA_WidgetData::GetCheckButtonShape() { @@ -507,10 +506,10 @@ int32_t CXFA_WidgetData::GetCheckButtonMark() { XFA_ATTRIBUTE_Mark, XFA_XDPPACKET_Form); } -FX_BOOL CXFA_WidgetData::IsRadioButton() { +bool CXFA_WidgetData::IsRadioButton() { if (CXFA_Node* pParent = m_pNode->GetNodeItem(XFA_NODEITEM_Parent)) return pParent->GetElementType() == XFA_Element::ExclGroup; - return FALSE; + return false; } FX_FLOAT CXFA_WidgetData::GetCheckButtonSize() { @@ -522,7 +521,7 @@ FX_FLOAT CXFA_WidgetData::GetCheckButtonSize() { .ToUnit(XFA_UNIT_Pt); } -FX_BOOL CXFA_WidgetData::IsAllowNeutral() { +bool CXFA_WidgetData::IsAllowNeutral() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) return pUIChild->GetBoolean(XFA_ATTRIBUTE_AllowNeutral); @@ -648,8 +647,8 @@ CXFA_Node* CXFA_WidgetData::SetSelectedMember(const CFX_WideStringC& wsName, void CXFA_WidgetData::SetSelectedMemberByValue(const CFX_WideStringC& wsValue, bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData) { + bool bScriptModify, + bool bSyncData) { CFX_WideString wsExclGroup; for (CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -675,7 +674,7 @@ void CXFA_WidgetData::SetSelectedMemberByValue(const CFX_WideStringC& wsValue, wsExclGroup = wsValue; } pNode->SetContent(wsChildValue, wsChildValue, bNotify, bScriptModify, - FALSE); + false); } if (m_pNode) { m_pNode->SetContent(wsExclGroup, wsExclGroup, bNotify, bScriptModify, @@ -719,7 +718,7 @@ int32_t CXFA_WidgetData::GetChoiceListCommitOn() { XFA_Element::ChoiceList, XFA_ATTRIBUTE_CommitOn, XFA_XDPPACKET_Form); } -FX_BOOL CXFA_WidgetData::IsChoiceListAllowTextEntry() { +bool CXFA_WidgetData::IsChoiceListAllowTextEntry() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) return pUIChild->GetBoolean(XFA_ATTRIBUTE_TextEntry); @@ -735,13 +734,13 @@ int32_t CXFA_WidgetData::GetChoiceListOpen() { XFA_ATTRIBUTE_Open, XFA_XDPPACKET_Form); } -FX_BOOL CXFA_WidgetData::IsListBox() { +bool CXFA_WidgetData::IsListBox() { int32_t iOpenMode = GetChoiceListOpen(); return (iOpenMode == XFA_ATTRIBUTEENUM_Always || iOpenMode == XFA_ATTRIBUTEENUM_MultiSelect); } -int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) { +int32_t CXFA_WidgetData::CountChoiceListItems(bool bSaveValue) { CXFA_NodeArray pItems; CXFA_Node* pItem = nullptr; int32_t iCount = 0; @@ -760,8 +759,8 @@ int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) { pItem = pItems[0]; if (iCount > 1) { - FX_BOOL bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save); - FX_BOOL bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save); + bool bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save); + bool bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save); if (bItemOneHasSave != bItemTwoHasSave && bSaveValue == bItemTwoHasSave) pItem = pItems[1]; } @@ -769,9 +768,9 @@ int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) { return pItem->CountChildren(XFA_Element::Unknown); } -FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText, - int32_t nIndex, - FX_BOOL bSaveValue) { +bool CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText, + int32_t nIndex, + bool bSaveValue) { wsText.clear(); CXFA_NodeArray pItemsArray; CXFA_Node* pItems = nullptr; @@ -787,12 +786,12 @@ FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText, break; } if (iCount == 0) - return FALSE; + return false; pItems = pItemsArray[0]; if (iCount > 1) { - FX_BOOL bItemOneHasSave = pItemsArray[0]->GetBoolean(XFA_ATTRIBUTE_Save); - FX_BOOL bItemTwoHasSave = pItemsArray[1]->GetBoolean(XFA_ATTRIBUTE_Save); + bool bItemOneHasSave = pItemsArray[0]->GetBoolean(XFA_ATTRIBUTE_Save); + bool bItemTwoHasSave = pItemsArray[1]->GetBoolean(XFA_ATTRIBUTE_Save); if (bItemOneHasSave != bItemTwoHasSave && bSaveValue == bItemTwoHasSave) pItems = pItemsArray[1]; } @@ -800,14 +799,14 @@ FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText, CXFA_Node* pItem = pItems->GetChild(nIndex, XFA_Element::Unknown); if (pItem) { pItem->TryContent(wsText); - return TRUE; + return true; } } - return FALSE; + return false; } void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray& wsTextArray, - FX_BOOL bSaveValue) { + bool bSaveValue) { CXFA_NodeArray pItems; CXFA_Node* pItem = nullptr; int32_t iCount = 0; @@ -826,8 +825,8 @@ void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray& wsTextArray, pItem = pItems[0]; if (iCount > 1) { - FX_BOOL bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save); - FX_BOOL bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save); + bool bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save); + bool bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save); if (bItemOneHasSave != bItemTwoHasSave && bSaveValue == bItemTwoHasSave) pItem = pItems[1]; } @@ -845,7 +844,7 @@ int32_t CXFA_WidgetData::CountSelectedItems() { int32_t iSelected = 0; CFX_WideStringArray wsSaveTextArray; - GetChoiceListItems(wsSaveTextArray, TRUE); + GetChoiceListItems(wsSaveTextArray, true); int32_t iValues = wsValueArray.GetSize(); for (int32_t i = 0; i < iValues; i++) { int32_t iSaves = wsSaveTextArray.GetSize(); @@ -863,7 +862,7 @@ int32_t CXFA_WidgetData::GetSelectedItem(int32_t nIndex) { CFX_WideStringArray wsValueArray; GetSelectedItemsValue(wsValueArray); CFX_WideStringArray wsSaveTextArray; - GetChoiceListItems(wsSaveTextArray, TRUE); + GetChoiceListItems(wsSaveTextArray, true); int32_t iSaves = wsSaveTextArray.GetSize(); for (int32_t j = 0; j < iSaves; j++) { if (wsValueArray[nIndex] == wsSaveTextArray[j]) @@ -880,7 +879,7 @@ void CXFA_WidgetData::GetSelectedItems(CFX_Int32Array& iSelArray) { return; CFX_WideStringArray wsSaveTextArray; - GetChoiceListItems(wsSaveTextArray, TRUE); + GetChoiceListItems(wsSaveTextArray, true); int32_t iSaves = wsSaveTextArray.GetSize(); for (int32_t i = 0; i < iValues; i++) { for (int32_t j = 0; j < iSaves; j++) { @@ -917,35 +916,35 @@ void CXFA_WidgetData::GetSelectedItemsValue( } } -FX_BOOL CXFA_WidgetData::GetItemState(int32_t nIndex) { +bool CXFA_WidgetData::GetItemState(int32_t nIndex) { if (nIndex < 0) - return FALSE; + return false; CFX_WideStringArray wsSaveTextArray; - GetChoiceListItems(wsSaveTextArray, TRUE); + GetChoiceListItems(wsSaveTextArray, true); if (wsSaveTextArray.GetSize() <= nIndex) - return FALSE; + return false; CFX_WideStringArray wsValueArray; GetSelectedItemsValue(wsValueArray); int32_t iValues = wsValueArray.GetSize(); for (int32_t j = 0; j < iValues; j++) { if (wsValueArray[j] == wsSaveTextArray[nIndex]) - return TRUE; + return true; } - return FALSE; + return false; } void CXFA_WidgetData::SetItemState(int32_t nIndex, - FX_BOOL bSelected, + bool bSelected, bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData) { + bool bScriptModify, + bool bSyncData) { if (nIndex < 0) return; CFX_WideStringArray wsSaveTextArray; - GetChoiceListItems(wsSaveTextArray, TRUE); + GetChoiceListItems(wsSaveTextArray, true); if (wsSaveTextArray.GetSize() <= nIndex) return; @@ -999,13 +998,13 @@ void CXFA_WidgetData::SetItemState(int32_t nIndex, void CXFA_WidgetData::SetSelectedItems(CFX_Int32Array& iSelArray, bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData) { + bool bScriptModify, + bool bSyncData) { CFX_WideString wsValue; int32_t iSize = iSelArray.GetSize(); if (iSize >= 1) { CFX_WideStringArray wsSaveTextArray; - GetChoiceListItems(wsSaveTextArray, TRUE); + GetChoiceListItems(wsSaveTextArray, true); CFX_WideString wsItemValue; for (int32_t i = 0; i < iSize; i++) { wsItemValue = (iSize == 1) @@ -1035,7 +1034,7 @@ void CXFA_WidgetData::ClearAllSelections() { void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel, const CFX_WideString& wsValue, int32_t nIndex, - FX_BOOL bNotify) { + bool bNotify) { CFX_WideString wsNewValue(wsValue); if (wsNewValue.IsEmpty()) wsNewValue = wsLabel; @@ -1057,12 +1056,12 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel, InsertListTextItem(pItems, wsLabel, nIndex); CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_Element::Items); m_pNode->InsertChild(-1, pSaveItems); - pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE); + pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, true); InsertListTextItem(pSaveItems, wsNewValue, nIndex); } else if (iCount > 1) { for (int32_t i = 0; i < 2; i++) { CXFA_Node* pNode = listitems[i]; - FX_BOOL bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save); + bool bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save); if (bHasSave) InsertListTextItem(pNode, wsNewValue, nIndex); else @@ -1070,11 +1069,11 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel, } } else { CXFA_Node* pNode = listitems[0]; - pNode->SetBoolean(XFA_ATTRIBUTE_Save, FALSE); + pNode->SetBoolean(XFA_ATTRIBUTE_Save, false); pNode->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Visible); CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_Element::Items); m_pNode->InsertChild(-1, pSaveItems); - pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE); + pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, true); pSaveItems->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Hidden); listitems.RemoveAll(); CXFA_Node* pListNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -1112,7 +1111,7 @@ void CXFA_WidgetData::GetItemLabel(const CFX_WideStringC& wsValue, wsLabel = wsValue; } else { CXFA_Node* pLabelItems = listitems[0]; - FX_BOOL bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save); + bool bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save); CXFA_Node* pSaveItems = nullptr; if (bSave) { pSaveItems = pLabelItems; @@ -1158,7 +1157,7 @@ void CXFA_WidgetData::GetItemValue(const CFX_WideStringC& wsLabel, wsValue = wsLabel; } else { CXFA_Node* pLabelItems = listitems[0]; - FX_BOOL bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save); + bool bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save); CXFA_Node* pSaveItems = nullptr; if (bSave) { pSaveItems = pLabelItems; @@ -1186,11 +1185,11 @@ void CXFA_WidgetData::GetItemValue(const CFX_WideStringC& wsLabel, } } -FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex, - FX_BOOL bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData) { - FX_BOOL bSetValue = FALSE; +bool CXFA_WidgetData::DeleteItem(int32_t nIndex, + bool bNotify, + bool bScriptModify, + bool bSyncData) { + bool bSetValue = false; CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pItems; pItems = pItems->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pItems->GetElementType() != XFA_Element::Items) @@ -1202,8 +1201,8 @@ FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex, } } else { if (!bSetValue && pItems->GetBoolean(XFA_ATTRIBUTE_Save)) { - SetItemState(nIndex, FALSE, true, bScriptModify, bSyncData); - bSetValue = TRUE; + SetItemState(nIndex, false, true, bScriptModify, bSyncData); + bSetValue = true; } int32_t i = 0; CXFA_Node* pNode = pItems->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -1219,7 +1218,7 @@ FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex, } if (bNotify) m_pNode->GetDocument()->GetNotify()->OnWidgetListItemRemoved(this, nIndex); - return TRUE; + return true; } int32_t CXFA_WidgetData::GetHorizontalScrollPolicy() { @@ -1244,33 +1243,33 @@ CFX_WideString CXFA_WidgetData::GetBarcodeType() { : CFX_WideString(); } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideString wsCharEncoding; if (pUIChild->TryCData(XFA_ATTRIBUTE_CharEncoding, wsCharEncoding)) { if (wsCharEncoding.CompareNoCase(L"UTF-16")) { val = CHAR_ENCODING_UNICODE; - return TRUE; + return true; } if (wsCharEncoding.CompareNoCase(L"UTF-8")) { val = CHAR_ENCODING_UTF8; - return TRUE; + return true; } } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_BOOL& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_Checksum(bool& val) { CXFA_Node* pUIChild = GetUIChild(); XFA_ATTRIBUTEENUM eChecksum; if (pUIChild->TryEnum(XFA_ATTRIBUTE_Checksum, eChecksum)) { switch (eChecksum) { case XFA_ATTRIBUTEENUM_None: val = false; - return TRUE; + return true; case XFA_ATTRIBUTEENUM_Auto: val = true; - return TRUE; + return true; case XFA_ATTRIBUTEENUM_1mod10: break; case XFA_ATTRIBUTEENUM_1mod10_1mod11: @@ -1281,121 +1280,121 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_BOOL& val) { break; } } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_DataLength(int32_t& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_DataLength(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideString wsDataLength; if (pUIChild->TryCData(XFA_ATTRIBUTE_DataLength, wsDataLength)) { val = FXSYS_wtoi(wsDataLength.c_str()); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_StartChar(FX_CHAR& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_StartChar(FX_CHAR& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideStringC wsStartEndChar; if (pUIChild->TryCData(XFA_ATTRIBUTE_StartChar, wsStartEndChar)) { if (wsStartEndChar.GetLength()) { val = (FX_CHAR)wsStartEndChar.GetAt(0); - return TRUE; + return true; } } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_EndChar(FX_CHAR& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_EndChar(FX_CHAR& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideStringC wsStartEndChar; if (pUIChild->TryCData(XFA_ATTRIBUTE_EndChar, wsStartEndChar)) { if (wsStartEndChar.GetLength()) { val = (FX_CHAR)wsStartEndChar.GetAt(0); - return TRUE; + return true; } } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(int32_t& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_ECLevel(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideString wsECLevel; if (pUIChild->TryCData(XFA_ATTRIBUTE_ErrorCorrectionLevel, wsECLevel)) { val = FXSYS_wtoi(wsECLevel.c_str()); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(int32_t& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CXFA_Measurement mModuleWidthHeight; if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleWidth, mModuleWidthHeight)) { val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(int32_t& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CXFA_Measurement mModuleWidthHeight; if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleHeight, mModuleWidthHeight)) { val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum(FX_BOOL& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum(bool& val) { CXFA_Node* pUIChild = GetUIChild(); - FX_BOOL bPrintCheckDigit; + bool bPrintCheckDigit; if (pUIChild->TryBoolean(XFA_ATTRIBUTE_PrintCheckDigit, bPrintCheckDigit)) { val = bPrintCheckDigit; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_TextLocation(int32_t& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_TextLocation(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); XFA_ATTRIBUTEENUM eTextLocation; if (pUIChild->TryEnum(XFA_ATTRIBUTE_TextLocation, eTextLocation)) { switch (eTextLocation) { case XFA_ATTRIBUTEENUM_None: val = BC_TEXT_LOC_NONE; - return TRUE; + return true; case XFA_ATTRIBUTEENUM_Above: val = BC_TEXT_LOC_ABOVE; - return TRUE; + return true; case XFA_ATTRIBUTEENUM_Below: val = BC_TEXT_LOC_BELOW; - return TRUE; + return true; case XFA_ATTRIBUTEENUM_AboveEmbedded: val = BC_TEXT_LOC_ABOVEEMBED; - return TRUE; + return true; case XFA_ATTRIBUTEENUM_BelowEmbedded: val = BC_TEXT_LOC_BELOWEMBED; - return TRUE; + return true; default: break; } } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Truncate(FX_BOOL& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_Truncate(bool& val) { CXFA_Node* pUIChild = GetUIChild(); - FX_BOOL bTruncate; + bool bTruncate; if (pUIChild->TryBoolean(XFA_ATTRIBUTE_Truncate, bTruncate)) { val = bTruncate; - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) { +bool CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideString wsWideNarrowRatio; if (pUIChild->TryCData(XFA_ATTRIBUTE_WideNarrowRatio, wsWideNarrowRatio)) { @@ -1411,9 +1410,9 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) { fRatio = (FX_FLOAT)fA / fB; } val = fRatio; - return TRUE; + return true; } - return FALSE; + return false; } void CXFA_WidgetData::GetPasswordChar(CFX_WideString& wsPassWord) { @@ -1427,7 +1426,7 @@ void CXFA_WidgetData::GetPasswordChar(CFX_WideString& wsPassWord) { } } -FX_BOOL CXFA_WidgetData::IsMultiLine() { +bool CXFA_WidgetData::IsMultiLine() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) return pUIChild->GetBoolean(XFA_ATTRIBUTE_MultiLine); @@ -1463,40 +1462,40 @@ int32_t CXFA_WidgetData::GetMaxChars(XFA_Element& eType) { return 0; } -FX_BOOL CXFA_WidgetData::GetFracDigits(int32_t& iFracDigits) { +bool CXFA_WidgetData::GetFracDigits(int32_t& iFracDigits) { if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value)) { if (CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal)) return pChild->TryInteger(XFA_ATTRIBUTE_FracDigits, iFracDigits); } iFracDigits = -1; - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetLeadDigits(int32_t& iLeadDigits) { +bool CXFA_WidgetData::GetLeadDigits(int32_t& iLeadDigits) { if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value)) { if (CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal)) return pChild->TryInteger(XFA_ATTRIBUTE_LeadDigits, iLeadDigits); } iLeadDigits = -1; - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, - XFA_VALUEPICTURE eValueType) { +bool CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, + XFA_VALUEPICTURE eValueType) { if (wsValue.IsEmpty()) { SyncValue(wsValue, true); - return TRUE; + return true; } m_bPreNull = m_bIsNull; - m_bIsNull = FALSE; + m_bIsNull = false; CFX_WideString wsNewText(wsValue); CFX_WideString wsPicture; GetPictureContent(wsPicture, eValueType); - FX_BOOL bValidate = TRUE; - FX_BOOL bSyncData = FALSE; + bool bValidate = true; + bool bSyncData = false; CXFA_Node* pNode = GetUIChild(); if (!pNode) - return TRUE; + return true; XFA_Element eType = pNode->GetElementType(); if (!wsPicture.IsEmpty()) { @@ -1516,7 +1515,7 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, GetFracDigits(iFracDigits); wsNewText = NumericLimit(wsNewText, iLeadDigits, iFracDigits); } - bSyncData = TRUE; + bSyncData = true; } } else { if (eType == XFA_Element::NumericEdit) { @@ -1527,7 +1526,7 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, GetFracDigits(iFracDigits); wsNewText = NumericLimit(wsNewText, iLeadDigits, iFracDigits); } - bSyncData = TRUE; + bSyncData = true; } } if (eType != XFA_Element::NumericEdit || bSyncData) @@ -1536,10 +1535,10 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, return bValidate; } -FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture, - XFA_VALUEPICTURE ePicture) { +bool CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture, + XFA_VALUEPICTURE ePicture) { if (ePicture == XFA_VALUEPICTURE_Raw) - return FALSE; + return false; CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this); switch (ePicture) { @@ -1547,13 +1546,13 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture, if (CXFA_Node* pFormat = m_pNode->GetChild(0, XFA_Element::Format)) { if (CXFA_Node* pPicture = pFormat->GetChild(0, XFA_Element::Picture)) { if (pPicture->TryContent(wsPicture)) - return TRUE; + return true; } } CFX_WideString wsDataPicture, wsTimePicture; IFX_Locale* pLocale = GetLocal(); if (!pLocale) - return FALSE; + return false; uint32_t dwType = widgetValue.GetType(); switch (dwType) { @@ -1578,7 +1577,7 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture, default: break; } - return TRUE; + return true; } case XFA_VALUEPICTURE_Edit: { @@ -1586,14 +1585,14 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture, if (pUI) { if (CXFA_Node* pPicture = pUI->GetChild(0, XFA_Element::Picture)) { if (pPicture->TryContent(wsPicture)) - return TRUE; + return true; } } { CFX_WideString wsDataPicture, wsTimePicture; IFX_Locale* pLocale = GetLocal(); if (!pLocale) { - return FALSE; + return false; } uint32_t dwType = widgetValue.GetType(); switch (dwType) { @@ -1616,19 +1615,19 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture, break; } } - return TRUE; + return true; } case XFA_VALUEPICTURE_DataBind: { if (CXFA_Bind bind = GetBind()) { bind.GetPicture(wsPicture); - return TRUE; + return true; } break; } default: break; } - return FALSE; + return false; } IFX_Locale* CXFA_WidgetData::GetLocal() { @@ -1643,8 +1642,8 @@ IFX_Locale* CXFA_WidgetData::GetLocal() { return m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName(wsLocaleName); } -FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, - XFA_VALUEPICTURE eValueType) { +bool CXFA_WidgetData::GetValue(CFX_WideString& wsValue, + XFA_VALUEPICTURE eValueType) { wsValue = m_pNode->GetContent(); if (eValueType == XFA_VALUEPICTURE_Display) @@ -1654,7 +1653,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, GetPictureContent(wsPicture, eValueType); CXFA_Node* pNode = GetUIChild(); if (!pNode) - return TRUE; + return true; switch (GetUIChild()->GetElementType()) { case XFA_Element::ChoiceList: { @@ -1681,7 +1680,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, break; } if (wsPicture.IsEmpty()) - return TRUE; + return true; if (IFX_Locale* pLocale = GetLocal()) { CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this); @@ -1692,7 +1691,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, if (SplitDateTime(wsValue, wsDate, wsTime)) { CXFA_LocaleValue date(XFA_VT_DATE, wsDate, pLocalMgr); if (date.FormatPatterns(wsValue, wsPicture, pLocale, eValueType)) - return TRUE; + return true; } break; } @@ -1701,7 +1700,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, if (SplitDateTime(wsValue, wsDate, wsTime)) { CXFA_LocaleValue time(XFA_VT_TIME, wsTime, pLocalMgr); if (time.FormatPatterns(wsValue, wsPicture, pLocale, eValueType)) - return TRUE; + return true; } break; } @@ -1710,20 +1709,19 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, } widgetValue.FormatPatterns(wsValue, wsPicture, pLocale, eValueType); } - return TRUE; + return true; } -FX_BOOL CXFA_WidgetData::GetNormalizeDataValue( - const CFX_WideString& wsValue, - CFX_WideString& wsNormalizeValue) { +bool CXFA_WidgetData::GetNormalizeDataValue(const CFX_WideString& wsValue, + CFX_WideString& wsNormalizeValue) { wsNormalizeValue = wsValue; if (wsValue.IsEmpty()) - return TRUE; + return true; CFX_WideString wsPicture; GetPictureContent(wsPicture, XFA_VALUEPICTURE_DataBind); if (wsPicture.IsEmpty()) - return TRUE; + return true; ASSERT(GetNode()); CXFA_LocaleMgr* pLocalMgr = GetNode()->GetDocument()->GetLocalMgr(); @@ -1733,31 +1731,31 @@ FX_BOOL CXFA_WidgetData::GetNormalizeDataValue( widgetValue = CXFA_LocaleValue(widgetValue.GetType(), wsNormalizeValue, wsPicture, pLocale, pLocalMgr); wsNormalizeValue = widgetValue.GetValue(); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue, - CFX_WideString& wsFormattedValue) { +bool CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue, + CFX_WideString& wsFormattedValue) { wsFormattedValue = wsValue; if (wsValue.IsEmpty()) - return TRUE; + return true; CFX_WideString wsPicture; GetPictureContent(wsPicture, XFA_VALUEPICTURE_DataBind); if (wsPicture.IsEmpty()) - return TRUE; + return true; if (IFX_Locale* pLocale = GetLocal()) { ASSERT(GetNode()); CXFA_Node* pNodeValue = GetNode()->GetChild(0, XFA_Element::Value); if (!pNodeValue) - return FALSE; + return false; CXFA_Node* pValueChild = pNodeValue->GetNodeItem(XFA_NODEITEM_FirstChild); if (!pValueChild) - return FALSE; + return false; int32_t iVTType = XFA_VT_NULL; switch (pValueChild->GetElementType()) { @@ -1798,7 +1796,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue, CXFA_LocaleValue date(XFA_VT_DATE, wsDate, pLocalMgr); if (date.FormatPatterns(wsFormattedValue, wsPicture, pLocale, XFA_VALUEPICTURE_DataBind)) { - return TRUE; + return true; } } break; @@ -1809,7 +1807,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue, CXFA_LocaleValue time(XFA_VT_TIME, wsTime, pLocalMgr); if (time.FormatPatterns(wsFormattedValue, wsPicture, pLocale, XFA_VALUEPICTURE_DataBind)) { - return TRUE; + return true; } } break; @@ -1820,7 +1818,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue, widgetValue.FormatPatterns(wsFormattedValue, wsPicture, pLocale, XFA_VALUEPICTURE_DataBind); } - return FALSE; + return false; } void CXFA_WidgetData::NormalizeNumStr(const CFX_WideString& wsValue, @@ -1850,9 +1848,9 @@ void CXFA_WidgetData::FormatNumStr(const CFX_WideString& wsValue, CFX_WideString wsSrcNum = wsValue; CFX_WideString wsGroupSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol); - FX_BOOL bNeg = FALSE; + bool bNeg = false; if (wsSrcNum[0] == '-') { - bNeg = TRUE; + bNeg = true; wsSrcNum.Delete(0, 1); } int32_t len = wsSrcNum.GetLength(); @@ -1901,7 +1899,7 @@ void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems, int32_t nIndex) { CXFA_Node* pText = pItems->CreateSamePacketNode(XFA_Element::Text); pItems->InsertChild(nIndex, pText); - pText->SetContent(wsText, wsText, FALSE, FALSE, FALSE); + pText->SetContent(wsText, wsText, false, false, false); } CFX_WideString CXFA_WidgetData::NumericLimit(const CFX_WideString& wsValue, diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h index ed217ada3d..5c030d6b52 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h @@ -44,40 +44,40 @@ class CXFA_WidgetData : public CXFA_Data { CXFA_Node* GetUIChild(); XFA_Element GetUIType(); CFX_WideString GetRawValue(); - int32_t GetAccess(FX_BOOL bTemplate = FALSE); + int32_t GetAccess(bool bTemplate = false); int32_t GetRotate(); - CXFA_Border GetBorder(FX_BOOL bModified = FALSE); - CXFA_Caption GetCaption(FX_BOOL bModified = FALSE); - CXFA_Font GetFont(FX_BOOL bModified = FALSE); - CXFA_Margin GetMargin(FX_BOOL bModified = FALSE); - CXFA_Para GetPara(FX_BOOL bModified = FALSE); + CXFA_Border GetBorder(bool bModified = false); + CXFA_Caption GetCaption(bool bModified = false); + CXFA_Font GetFont(bool bModified = false); + CXFA_Margin GetMargin(bool bModified = false); + CXFA_Para GetPara(bool bModified = false); void GetEventList(CXFA_NodeArray& events); int32_t GetEventByActivity(int32_t iActivity, CXFA_NodeArray& events, - FX_BOOL bIsFormReady = FALSE); - CXFA_Value GetDefaultValue(FX_BOOL bModified = FALSE); - CXFA_Value GetFormValue(FX_BOOL bModified = FALSE); - CXFA_Calculate GetCalculate(FX_BOOL bModified = FALSE); - CXFA_Validate GetValidate(FX_BOOL bModified = FALSE); - CXFA_Bind GetBind(FX_BOOL bModified = FALSE); - CXFA_Assist GetAssist(FX_BOOL bModified = FALSE); - FX_BOOL GetWidth(FX_FLOAT& fWidth); - FX_BOOL GetHeight(FX_FLOAT& fHeight); - FX_BOOL GetMinWidth(FX_FLOAT& fMinWidth); - FX_BOOL GetMinHeight(FX_FLOAT& fMinHeight); - FX_BOOL GetMaxWidth(FX_FLOAT& fMaxWidth); - FX_BOOL GetMaxHeight(FX_FLOAT& fMaxHeight); - CXFA_Border GetUIBorder(FX_BOOL bModified = FALSE); - CXFA_Margin GetUIMargin(FX_BOOL bModified = FALSE); + bool bIsFormReady = false); + CXFA_Value GetDefaultValue(bool bModified = false); + CXFA_Value GetFormValue(bool bModified = false); + CXFA_Calculate GetCalculate(bool bModified = false); + CXFA_Validate GetValidate(bool bModified = false); + CXFA_Bind GetBind(bool bModified = false); + CXFA_Assist GetAssist(bool bModified = false); + bool GetWidth(FX_FLOAT& fWidth); + bool GetHeight(FX_FLOAT& fHeight); + bool GetMinWidth(FX_FLOAT& fMinWidth); + bool GetMinHeight(FX_FLOAT& fMinHeight); + bool GetMaxWidth(FX_FLOAT& fMaxWidth); + bool GetMaxHeight(FX_FLOAT& fMaxHeight); + CXFA_Border GetUIBorder(bool bModified = false); + CXFA_Margin GetUIMargin(bool bModified = false); void GetUIMargin(CFX_RectF& rtUIMargin); int32_t GetButtonHighlight(); - FX_BOOL GetButtonRollover(CFX_WideString& wsRollover, FX_BOOL& bRichText); - FX_BOOL GetButtonDown(CFX_WideString& wsDown, FX_BOOL& bRichText); + bool GetButtonRollover(CFX_WideString& wsRollover, bool& bRichText); + bool GetButtonDown(CFX_WideString& wsDown, bool& bRichText); int32_t GetCheckButtonShape(); int32_t GetCheckButtonMark(); FX_FLOAT GetCheckButtonSize(); - FX_BOOL IsAllowNeutral(); - FX_BOOL IsRadioButton(); + bool IsAllowNeutral(); + bool IsRadioButton(); XFA_CHECKSTATE GetCheckState(); void SetCheckState(XFA_CHECKSTATE eCheckState, bool bNotify); CXFA_Node* GetExclGroupNode(); @@ -85,83 +85,82 @@ class CXFA_WidgetData : public CXFA_Data { CXFA_Node* SetSelectedMember(const CFX_WideStringC& wsName, bool bNotify); void SetSelectedMemberByValue(const CFX_WideStringC& wsValue, bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData); + bool bScriptModify, + bool bSyncData); CXFA_Node* GetExclGroupFirstMember(); CXFA_Node* GetExclGroupNextMember(CXFA_Node* pNode); int32_t GetChoiceListCommitOn(); - FX_BOOL IsChoiceListAllowTextEntry(); + bool IsChoiceListAllowTextEntry(); int32_t GetChoiceListOpen(); - FX_BOOL IsListBox(); - int32_t CountChoiceListItems(FX_BOOL bSaveValue = FALSE); - FX_BOOL GetChoiceListItem(CFX_WideString& wsText, - int32_t nIndex, - FX_BOOL bSaveValue = FALSE); + bool IsListBox(); + int32_t CountChoiceListItems(bool bSaveValue = false); + bool GetChoiceListItem(CFX_WideString& wsText, + int32_t nIndex, + bool bSaveValue = false); void GetChoiceListItems(CFX_WideStringArray& wsTextArray, - FX_BOOL bSaveValue = FALSE); + bool bSaveValue = false); int32_t CountSelectedItems(); int32_t GetSelectedItem(int32_t nIndex = 0); void GetSelectedItems(CFX_Int32Array& iSelArray); void GetSelectedItemsValue(CFX_WideStringArray& wsSelTextArray); - FX_BOOL GetItemState(int32_t nIndex); + bool GetItemState(int32_t nIndex); void SetItemState(int32_t nIndex, - FX_BOOL bSelected, + bool bSelected, bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData); + bool bScriptModify, + bool bSyncData); void SetSelectedItems(CFX_Int32Array& iSelArray, bool bNotify, - FX_BOOL bScriptModify, - FX_BOOL bSyncData); + bool bScriptModify, + bool bSyncData); void ClearAllSelections(); void InsertItem(const CFX_WideString& wsLabel, const CFX_WideString& wsValue, int32_t nIndex = -1, - FX_BOOL bNotify = FALSE); + bool bNotify = false); void GetItemLabel(const CFX_WideStringC& wsValue, CFX_WideString& wsLabel); void GetItemValue(const CFX_WideStringC& wsLabel, CFX_WideString& wsValue); - FX_BOOL DeleteItem(int32_t nIndex, - FX_BOOL bNotify = FALSE, - FX_BOOL bScriptModify = FALSE, - FX_BOOL bSyncData = TRUE); + bool DeleteItem(int32_t nIndex, + bool bNotify = false, + bool bScriptModify = false, + bool bSyncData = true); int32_t GetHorizontalScrollPolicy(); int32_t GetNumberOfCells(); - FX_BOOL SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); - FX_BOOL GetPictureContent(CFX_WideString& wsPicture, - XFA_VALUEPICTURE ePicture); + bool SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); + bool GetPictureContent(CFX_WideString& wsPicture, XFA_VALUEPICTURE ePicture); IFX_Locale* GetLocal(); - FX_BOOL GetValue(CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); - FX_BOOL GetNormalizeDataValue(const CFX_WideString& wsValue, - CFX_WideString& wsNormalizeValue); - FX_BOOL GetFormatDataValue(const CFX_WideString& wsValue, - CFX_WideString& wsFormattedValue); + bool GetValue(CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); + bool GetNormalizeDataValue(const CFX_WideString& wsValue, + CFX_WideString& wsNormalizeValue); + bool GetFormatDataValue(const CFX_WideString& wsValue, + CFX_WideString& wsFormattedValue); void NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideString& wsOutput); CFX_WideString GetBarcodeType(); - FX_BOOL GetBarcodeAttribute_CharEncoding(int32_t& val); - FX_BOOL GetBarcodeAttribute_Checksum(FX_BOOL& val); - FX_BOOL GetBarcodeAttribute_DataLength(int32_t& val); - FX_BOOL GetBarcodeAttribute_StartChar(FX_CHAR& val); - FX_BOOL GetBarcodeAttribute_EndChar(FX_CHAR& val); - FX_BOOL GetBarcodeAttribute_ECLevel(int32_t& val); - FX_BOOL GetBarcodeAttribute_ModuleWidth(int32_t& val); - FX_BOOL GetBarcodeAttribute_ModuleHeight(int32_t& val); - FX_BOOL GetBarcodeAttribute_PrintChecksum(FX_BOOL& val); - FX_BOOL GetBarcodeAttribute_TextLocation(int32_t& val); - FX_BOOL GetBarcodeAttribute_Truncate(FX_BOOL& val); - FX_BOOL GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val); + bool GetBarcodeAttribute_CharEncoding(int32_t& val); + bool GetBarcodeAttribute_Checksum(bool& val); + bool GetBarcodeAttribute_DataLength(int32_t& val); + bool GetBarcodeAttribute_StartChar(FX_CHAR& val); + bool GetBarcodeAttribute_EndChar(FX_CHAR& val); + bool GetBarcodeAttribute_ECLevel(int32_t& val); + bool GetBarcodeAttribute_ModuleWidth(int32_t& val); + bool GetBarcodeAttribute_ModuleHeight(int32_t& val); + bool GetBarcodeAttribute_PrintChecksum(bool& val); + bool GetBarcodeAttribute_TextLocation(int32_t& val); + bool GetBarcodeAttribute_Truncate(bool& val); + bool GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val); void GetPasswordChar(CFX_WideString& wsPassWord); - FX_BOOL IsMultiLine(); + bool IsMultiLine(); int32_t GetVerticalScrollPolicy(); int32_t GetMaxChars(XFA_Element& eType); - FX_BOOL GetFracDigits(int32_t& iFracDigits); - FX_BOOL GetLeadDigits(int32_t& iLeadDigits); + bool GetFracDigits(int32_t& iFracDigits); + bool GetLeadDigits(int32_t& iLeadDigits); CFX_WideString NumericLimit(const CFX_WideString& wsValue, int32_t iLead, int32_t iTread) const; - FX_BOOL m_bIsNull; - FX_BOOL m_bPreNull; + bool m_bIsNull; + bool m_bPreNull; protected: void SyncValue(const CFX_WideString& wsValue, bool bNotify); diff --git a/xfa/fxfa/parser/cxfa_xml_parser.cpp b/xfa/fxfa/parser/cxfa_xml_parser.cpp index 654a449a88..70e0d7cc9e 100644 --- a/xfa/fxfa/parser/cxfa_xml_parser.cpp +++ b/xfa/fxfa/parser/cxfa_xml_parser.cpp @@ -23,7 +23,7 @@ CXFA_XMLParser::CXFA_XMLParser(CFDE_XMLNode* pRoot, IFX_Stream* pStream) } CXFA_XMLParser::~CXFA_XMLParser() { - m_NodeStack.RemoveAll(FALSE); + m_NodeStack.RemoveAll(false); m_ws1.clear(); m_ws2.clear(); } @@ -39,7 +39,7 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) { return 100; int32_t iCount = 0; - while (TRUE) { + while (true) { m_syntaxParserResult = m_pParser->DoSyntaxParse(); switch (m_syntaxParserResult) { case FDE_XmlSyntaxResult::InstructionOpen: diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index a0ff81405d..1fc9530e09 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -37,12 +37,12 @@ struct RecurseRecord { CXFA_Node* pDataChild; }; -FX_BOOL GetOccurInfo(CXFA_Node* pOccurNode, - int32_t& iMin, - int32_t& iMax, - int32_t& iInit) { +bool GetOccurInfo(CXFA_Node* pOccurNode, + int32_t& iMin, + int32_t& iMax, + int32_t& iInit) { if (!pOccurNode) - return FALSE; + return false; CXFA_Occur occur(pOccurNode); return occur.GetOccurInfo(iMin, iMax, iInit); @@ -64,17 +64,16 @@ void FormValueNode_MatchNoneCreateChild(CXFA_Node* pFormNode) { pWidgetData->GetUIType(); } -FX_BOOL FormValueNode_SetChildContent( - CXFA_Node* pValueNode, - const CFX_WideString& wsContent, - XFA_Element iType = XFA_Element::Unknown) { +bool FormValueNode_SetChildContent(CXFA_Node* pValueNode, + const CFX_WideString& wsContent, + XFA_Element iType = XFA_Element::Unknown) { if (!pValueNode) - return FALSE; + return false; ASSERT(pValueNode->GetPacketID() == XFA_XDPPACKET_Form); CXFA_Node* pChildNode = FormValueNode_CreateChild(pValueNode, iType); if (!pChildNode) - return FALSE; + return false; switch (pChildNode->GetObjectType()) { case XFA_ObjectType::ContentNode: { @@ -85,7 +84,7 @@ FX_BOOL FormValueNode_SetChildContent( if (pChildNode->GetElementType() == XFA_Element::ExData) { CFX_WideString wsContentType; pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, - FALSE); + false); if (wsContentType == FX_WSTRC(L"text/html")) element = XFA_Element::SharpxHTML; else if (wsContentType == FX_WSTRC(L"text/xml")) @@ -104,15 +103,15 @@ FX_BOOL FormValueNode_SetChildContent( break; } default: - ASSERT(FALSE); + ASSERT(false); break; } - return TRUE; + return true; } void CreateDataBinding(CXFA_Node* pFormNode, CXFA_Node* pDataNode, - FX_BOOL bDataToForm) { + bool bDataToForm) { pFormNode->SetObject(XFA_ATTRIBUTE_BindingNode, pDataNode); pDataNode->AddBindItem(pFormNode); XFA_Element eType = pFormNode->GetElementType(); @@ -322,7 +321,7 @@ void CreateDataBinding(CXFA_Node* pFormNode, break; case XFA_Element::ExclGroup: { pWidgetData->SetSelectedMemberByValue(wsNormalizeValue.AsStringC(), false, - FALSE, FALSE); + false, false); break; } case XFA_Element::DateTimeEdit: @@ -368,7 +367,7 @@ void RegisterGlobalBinding(CXFA_Document* pDocument, CXFA_Node* ScopeMatchGlobalBinding(CXFA_Node* pDataScope, uint32_t dwNameHash, XFA_Element eMatchDataNodeType, - FX_BOOL bUpLevel) { + bool bUpLevel) { for (CXFA_Node *pCurDataScope = pDataScope, *pLastDataScope = nullptr; pCurDataScope && pCurDataScope->GetPacketID() == XFA_XDPPACKET_Datasets; pLastDataScope = pCurDataScope, @@ -391,7 +390,7 @@ CXFA_Node* ScopeMatchGlobalBinding(CXFA_Node* pDataScope, pDataChild; pDataChild = pDataChild->GetNextSameClassSibling( XFA_Element::DataGroup)) { CXFA_Node* pDataNode = ScopeMatchGlobalBinding(pDataChild, dwNameHash, - eMatchDataNodeType, FALSE); + eMatchDataNodeType, false); if (pDataNode) return pDataNode; } @@ -412,7 +411,7 @@ CXFA_Node* FindGlobalDataNode(CXFA_Document* pDocument, CXFA_Node* pBounded = GetGlobalBinding(pDocument, dwNameHash); if (!pBounded) { pBounded = - ScopeMatchGlobalBinding(pDataScope, dwNameHash, eMatchNodeType, TRUE); + ScopeMatchGlobalBinding(pDataScope, dwNameHash, eMatchNodeType, true); if (pBounded) RegisterGlobalBinding(pDocument, dwNameHash, pBounded); } @@ -451,8 +450,8 @@ CXFA_Node* FindDataRefDataNode(CXFA_Document* pDocument, CXFA_Node* pDataScope, XFA_Element eMatchNodeType, CXFA_Node* pTemplateNode, - FX_BOOL bForceBind, - FX_BOOL bUpLevel) { + bool bForceBind, + bool bUpLevel) { uint32_t dFlags = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_BindNew; if (bUpLevel || wsRef != FX_WSTRC(L"name")) dFlags |= (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings); @@ -474,18 +473,17 @@ CXFA_Node* FindDataRefDataNode(CXFA_Document* pDocument, return nullptr; } -FX_BOOL NeedGenerateForm(CXFA_Node* pTemplateChild, - FX_BOOL bUseInstanceManager) { +bool NeedGenerateForm(CXFA_Node* pTemplateChild, bool bUseInstanceManager) { XFA_Element eType = pTemplateChild->GetElementType(); if (eType == XFA_Element::Variables) - return TRUE; + return true; if (pTemplateChild->IsContainerNode()) - return FALSE; + return false; if (eType == XFA_Element::Proto || (bUseInstanceManager && eType == XFA_Element::Occur)) { - return FALSE; + return false; } - return TRUE; + return true; } CXFA_Node* CloneOrMergeInstanceManager(CXFA_Document* pDocument, @@ -541,17 +539,17 @@ CXFA_Node* FindMatchingDataNode( CXFA_Document* pDocument, CXFA_Node* pTemplateNode, CXFA_Node* pDataScope, - FX_BOOL& bAccessedDataDOM, - FX_BOOL bForceBind, + bool& bAccessedDataDOM, + bool bForceBind, CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode>* pIterator, - FX_BOOL& bSelfMatch, + bool& bSelfMatch, XFA_ATTRIBUTEENUM& eBindMatch, - FX_BOOL bUpLevel) { - FX_BOOL bOwnIterator = FALSE; + bool bUpLevel) { + bool bOwnIterator = false; if (!pIterator) { - bOwnIterator = TRUE; + bOwnIterator = true; pIterator = new CXFA_NodeIteratorTemplate< CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode>(pTemplateNode); } @@ -596,7 +594,7 @@ CXFA_Node* FindMatchingDataNode( pCurTemplateNode = pIterator->MoveToNext(); continue; case XFA_ATTRIBUTEENUM_Global: - bAccessedDataDOM = TRUE; + bAccessedDataDOM = true; if (!bForceBind) { pCurTemplateNode = pIterator->MoveToNext(); continue; @@ -615,7 +613,7 @@ CXFA_Node* FindMatchingDataNode( break; } case XFA_ATTRIBUTEENUM_Once: { - bAccessedDataDOM = TRUE; + bAccessedDataDOM = true; CXFA_Node* pOnceBindNode = FindOnceDataNode( pDocument, pCurTemplateNode->GetCData(XFA_ATTRIBUTE_Name), pDataScope, eMatchNodeType); @@ -627,7 +625,7 @@ CXFA_Node* FindMatchingDataNode( break; } case XFA_ATTRIBUTEENUM_DataRef: { - bAccessedDataDOM = TRUE; + bAccessedDataDOM = true; CXFA_Node* pDataRefBindNode = FindDataRefDataNode( pDocument, pTemplateNodeBind->GetCData(XFA_ATTRIBUTE_Ref), pDataScope, eMatchNodeType, pTemplateNode, bForceBind, bUpLevel); @@ -645,7 +643,7 @@ CXFA_Node* FindMatchingDataNode( break; } if (pCurTemplateNode == pTemplateNode && pResult) - bSelfMatch = TRUE; + bSelfMatch = true; break; } if (bOwnIterator) @@ -655,7 +653,7 @@ CXFA_Node* FindMatchingDataNode( void SortRecurseRecord(CFX_ArrayTemplate<RecurseRecord>& rgRecords, CXFA_Node* pDataScope, - FX_BOOL bChoiceMode) { + bool bChoiceMode) { int32_t iCount = rgRecords.GetSize(); CFX_ArrayTemplate<RecurseRecord> rgResultRecord; for (CXFA_Node* pChildNode = pDataScope->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -692,12 +690,12 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, CXFA_Node* pTemplateNode, CXFA_Node* pFormParentNode, CXFA_Node* pDataScope, - FX_BOOL bOneInstance, - FX_BOOL bDataMerge) { + bool bOneInstance, + bool bDataMerge) { XFA_Element eType = pTemplateNode->GetElementType(); CXFA_Node* pOccurNode = nullptr; CXFA_Node* pFirstInstance = nullptr; - FX_BOOL bUseInstanceManager = + bool bUseInstanceManager = pFormParentNode->GetElementType() != XFA_Element::Area; CXFA_Node* pInstMgrNode = nullptr; CXFA_NodeArray subformArray; @@ -712,7 +710,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, pTemplateNode->GetFirstChildByClass(XFA_Element::Occur)) { pOccurNode = pInstMgrNode ? XFA_NodeMerge_CloneOrMergeContainer( pDocument, pInstMgrNode, - pOccurTemplateNode, FALSE, nullptr) + pOccurTemplateNode, false, nullptr) : pOccurTemplateNode; } else if (pInstMgrNode) { pOccurNode = pInstMgrNode->GetFirstChildByClass(XFA_Element::Occur); @@ -723,7 +721,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, pInstMgrNode->SetFlag(XFA_NodeFlag_Initialized, true); pSearchArray = &subformArray; if (pFormParentNode->GetElementType() == XFA_Element::PageArea) { - bOneInstance = TRUE; + bOneInstance = true; if (subformArray.GetSize() < 1) pSearchArray = nullptr; } else if ((pTemplateNode->GetNameHash() == 0) && @@ -748,28 +746,28 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, if (bDataMerge) { CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode> sNodeIterator(pTemplateNode); - FX_BOOL bAccessedDataDOM = FALSE; + bool bAccessedDataDOM = false; if (eType == XFA_Element::SubformSet || eType == XFA_Element::Area) { sNodeIterator.MoveToNext(); } else { CFX_MapPtrTemplate<CXFA_Node*, CXFA_Node*> subformMapArray; CXFA_NodeArray nodeArray; for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) { - FX_BOOL bSelfMatch = FALSE; + bool bSelfMatch = false; XFA_ATTRIBUTEENUM eBindMatch = XFA_ATTRIBUTEENUM_None; CXFA_Node* pDataNode = FindMatchingDataNode( - pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, FALSE, - &sNodeIterator, bSelfMatch, eBindMatch, TRUE); + pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, false, + &sNodeIterator, bSelfMatch, eBindMatch, true); if (!pDataNode || sNodeIterator.GetCurrent() != pTemplateNode) break; eParentBindMatch = eBindMatch; CXFA_Node* pSubformNode = XFA_NodeMerge_CloneOrMergeContainer( - pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); + pDocument, pFormParentNode, pTemplateNode, false, pSearchArray); if (!pFirstInstance) pFirstInstance = pSubformNode; - CreateDataBinding(pSubformNode, pDataNode, TRUE); + CreateDataBinding(pSubformNode, pDataNode, true); ASSERT(pSubformNode); subformMapArray.SetAt(pSubformNode, pDataNode); nodeArray.Add(pSubformNode); @@ -786,10 +784,10 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, XFA_NODEITEM_NextSibling)) { if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) { XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubform, - pTemplateChild, TRUE, nullptr); + pTemplateChild, true, nullptr); } else if (pTemplateChild->IsContainerNode()) { pDocument->DataMerge_CopyContainer(pTemplateChild, pSubform, - pDataNode, FALSE, TRUE, FALSE); + pDataNode, false, true, false); } } } @@ -797,11 +795,11 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, } for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) { - FX_BOOL bSelfMatch = FALSE; + bool bSelfMatch = false; XFA_ATTRIBUTEENUM eBindMatch = XFA_ATTRIBUTEENUM_None; if (!FindMatchingDataNode(pDocument, pTemplateNode, pDataScope, - bAccessedDataDOM, FALSE, &sNodeIterator, - bSelfMatch, eBindMatch, TRUE)) { + bAccessedDataDOM, false, &sNodeIterator, + bSelfMatch, eBindMatch, true)) { break; } if (eBindMatch == XFA_ATTRIBUTEENUM_DataRef && @@ -812,7 +810,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, if (eRelation == XFA_ATTRIBUTEENUM_Choice || eRelation == XFA_ATTRIBUTEENUM_Unordered) { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( - pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); + pDocument, pFormParentNode, pTemplateNode, false, pSearchArray); ASSERT(pSubformSetNode); if (!pFirstInstance) pFirstInstance = pSubformSetNode; @@ -825,14 +823,14 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, XFA_NODEITEM_NextSibling)) { if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) { XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformSetNode, - pTemplateChild, TRUE, nullptr); + pTemplateChild, true, nullptr); } else if (pTemplateChild->IsContainerNode()) { - bSelfMatch = FALSE; + bSelfMatch = false; eBindMatch = XFA_ATTRIBUTEENUM_None; if (eRelation != XFA_ATTRIBUTEENUM_Ordered) { CXFA_Node* pDataMatch = FindMatchingDataNode( pDocument, pTemplateChild, pDataScope, bAccessedDataDOM, - FALSE, nullptr, bSelfMatch, eBindMatch, TRUE); + false, nullptr, bSelfMatch, eBindMatch, true); if (pDataMatch) { RecurseRecord sNewRecord = {pTemplateChild, pDataMatch}; if (bSelfMatch) @@ -851,27 +849,27 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, switch (eRelation) { case XFA_ATTRIBUTEENUM_Choice: { ASSERT(rgItemMatchList.GetSize()); - SortRecurseRecord(rgItemMatchList, pDataScope, TRUE); + SortRecurseRecord(rgItemMatchList, pDataScope, true); pDocument->DataMerge_CopyContainer( rgItemMatchList[0].pTemplateChild, pSubformSetNode, pDataScope, - FALSE, TRUE, TRUE); + false, true, true); break; } case XFA_ATTRIBUTEENUM_Unordered: { if (rgItemMatchList.GetSize()) { - SortRecurseRecord(rgItemMatchList, pDataScope, FALSE); + SortRecurseRecord(rgItemMatchList, pDataScope, false); for (int32_t i = 0, count = rgItemMatchList.GetSize(); i < count; i++) { pDocument->DataMerge_CopyContainer( rgItemMatchList[i].pTemplateChild, pSubformSetNode, - pDataScope, FALSE, TRUE, TRUE); + pDataScope, false, true, true); } } for (int32_t i = 0, count = rgItemUnmatchList.GetSize(); i < count; i++) { pDocument->DataMerge_CopyContainer(rgItemUnmatchList[i], pSubformSetNode, pDataScope, - FALSE, TRUE, TRUE); + false, true, true); } break; } @@ -880,7 +878,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, } } else { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( - pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); + pDocument, pFormParentNode, pTemplateNode, false, pSearchArray); ASSERT(pSubformSetNode); if (!pFirstInstance) pFirstInstance = pSubformSetNode; @@ -891,16 +889,16 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, XFA_NODEITEM_NextSibling)) { if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) { XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformSetNode, - pTemplateChild, TRUE, nullptr); + pTemplateChild, true, nullptr); } else if (pTemplateChild->IsContainerNode()) { pDocument->DataMerge_CopyContainer(pTemplateChild, pSubformSetNode, - pDataScope, FALSE, TRUE, TRUE); + pDataScope, false, true, true); } } } } - if (iCurRepeatIndex == 0 && bAccessedDataDOM == FALSE) { + if (iCurRepeatIndex == 0 && bAccessedDataDOM == false) { int32_t iLimit = iMax; if (pInstMgrNode && pTemplateNode->GetNameHash() == 0) { iLimit = subformArray.GetSize(); @@ -921,7 +919,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, break; } CXFA_Node* pSubformNode = XFA_NodeMerge_CloneOrMergeContainer( - pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); + pDocument, pFormParentNode, pTemplateNode, false, pSearchArray); ASSERT(pSubformNode); if (!pFirstInstance) pFirstInstance = pSubformNode; @@ -932,10 +930,10 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, XFA_NODEITEM_NextSibling)) { if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) { XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformNode, - pTemplateChild, TRUE, nullptr); + pTemplateChild, true, nullptr); } else if (pTemplateChild->IsContainerNode()) { pDocument->DataMerge_CopyContainer(pTemplateChild, pSubformNode, - pDataScope, FALSE, TRUE, TRUE); + pDataScope, false, true, true); } } } @@ -945,26 +943,26 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, int32_t iMinimalLimit = iCurRepeatIndex == 0 ? iInit : iMin; for (; iCurRepeatIndex < iMinimalLimit; iCurRepeatIndex++) { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( - pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); + pDocument, pFormParentNode, pTemplateNode, false, pSearchArray); ASSERT(pSubformSetNode); if (!pFirstInstance) pFirstInstance = pSubformSetNode; - FX_BOOL bFound = FALSE; + bool bFound = false; for (CXFA_Node* pTemplateChild = pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem( XFA_NODEITEM_NextSibling)) { if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) { XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformSetNode, - pTemplateChild, TRUE, nullptr); + pTemplateChild, true, nullptr); } else if (pTemplateChild->IsContainerNode()) { if (bFound && eRelation == XFA_ATTRIBUTEENUM_Choice) continue; pDocument->DataMerge_CopyContainer(pTemplateChild, pSubformSetNode, - pDataScope, FALSE, bDataMerge, TRUE); - bFound = TRUE; + pDataScope, false, bDataMerge, true); + bFound = true; } } } @@ -975,35 +973,35 @@ CXFA_Node* CopyContainer_Field(CXFA_Document* pDocument, CXFA_Node* pTemplateNode, CXFA_Node* pFormNode, CXFA_Node* pDataScope, - FX_BOOL bDataMerge, - FX_BOOL bUpLevel) { + bool bDataMerge, + bool bUpLevel) { CXFA_Node* pFieldNode = XFA_NodeMerge_CloneOrMergeContainer( - pDocument, pFormNode, pTemplateNode, FALSE, nullptr); + pDocument, pFormNode, pTemplateNode, false, nullptr); ASSERT(pFieldNode); for (CXFA_Node* pTemplateChildNode = pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChildNode; pTemplateChildNode = pTemplateChildNode->GetNodeItem( XFA_NODEITEM_NextSibling)) { - if (NeedGenerateForm(pTemplateChildNode, TRUE)) { + if (NeedGenerateForm(pTemplateChildNode, true)) { XFA_NodeMerge_CloneOrMergeContainer(pDocument, pFieldNode, - pTemplateChildNode, TRUE, nullptr); + pTemplateChildNode, true, nullptr); } else if (pTemplateNode->GetElementType() == XFA_Element::ExclGroup && pTemplateChildNode->IsContainerNode()) { if (pTemplateChildNode->GetElementType() == XFA_Element::Field) { CopyContainer_Field(pDocument, pTemplateChildNode, pFieldNode, nullptr, - FALSE, TRUE); + false, true); } } } if (bDataMerge) { - FX_BOOL bAccessedDataDOM = FALSE; - FX_BOOL bSelfMatch = FALSE; + bool bAccessedDataDOM = false; + bool bSelfMatch = false; XFA_ATTRIBUTEENUM eBindMatch; CXFA_Node* pDataNode = FindMatchingDataNode( - pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, TRUE, nullptr, + pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, true, nullptr, bSelfMatch, eBindMatch, bUpLevel); if (pDataNode) - CreateDataBinding(pFieldNode, pDataNode, TRUE); + CreateDataBinding(pFieldNode, pDataNode, true); } else { FormValueNode_MatchNoneCreateChild(pFieldNode); } @@ -1068,9 +1066,9 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument, void UpdateBindingRelations(CXFA_Document* pDocument, CXFA_Node* pFormNode, CXFA_Node* pDataScope, - FX_BOOL bDataRef, - FX_BOOL bParentDataRef) { - FX_BOOL bMatchRef = TRUE; + bool bDataRef, + bool bParentDataRef) { + bool bMatchRef = true; XFA_Element eType = pFormNode->GetElementType(); CXFA_Node* pDataNode = pFormNode->GetBindData(); if (eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup || @@ -1101,7 +1099,7 @@ void UpdateBindingRelations(CXFA_Document* pDocument, pDocument, pDataScope, eDataNodeType, CFX_WideString(pFormNode->GetCData(XFA_ATTRIBUTE_Name))); if (pDataNode) - CreateDataBinding(pFormNode, pDataNode, FALSE); + CreateDataBinding(pFormNode, pDataNode, false); } if (!pDataNode) FormValueNode_MatchNoneCreateChild(pFormNode); @@ -1133,12 +1131,12 @@ void UpdateBindingRelations(CXFA_Document* pDocument, pDocument, pRecordNode, eDataNodeType, CFX_WideString(pFormNode->GetCData(XFA_ATTRIBUTE_Name))); if (pDataNode) { - CreateDataBinding(pFormNode, pDataNode, FALSE); + CreateDataBinding(pFormNode, pDataNode, false); RegisterGlobalBinding(pDocument, pFormNode->GetNameHash(), pDataNode); } } else { - CreateDataBinding(pFormNode, pDataNode, TRUE); + CreateDataBinding(pFormNode, pDataNode, true); } } if (!pDataNode) @@ -1147,7 +1145,7 @@ void UpdateBindingRelations(CXFA_Document* pDocument, break; case XFA_ATTRIBUTEENUM_DataRef: { bMatchRef = bDataRef; - bParentDataRef = TRUE; + bParentDataRef = true; if (!pDataNode && bDataRef) { CFX_WideStringC wsRef = pTemplateNodeBind->GetCData(XFA_ATTRIBUTE_Ref); @@ -1249,7 +1247,7 @@ CXFA_Node* XFA_DataMerge_FindFormDOMInstance(CXFA_Document* pDocument, CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, CXFA_Node* pFormParent, CXFA_Node* pTemplateNode, - FX_BOOL bRecursive, + bool bRecursive, CXFA_NodeArray* pSubformArray) { CXFA_Node* pExistingNode = nullptr; if (!pSubformArray) { @@ -1275,7 +1273,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem( XFA_NODEITEM_NextSibling)) { - if (NeedGenerateForm(pTemplateChild, TRUE)) { + if (NeedGenerateForm(pTemplateChild, true)) { XFA_NodeMerge_CloneOrMergeContainer( pDocument, pExistingNode, pTemplateChild, bRecursive, nullptr); } @@ -1285,15 +1283,15 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, return pExistingNode; } - CXFA_Node* pNewNode = pTemplateNode->CloneTemplateToForm(FALSE); + CXFA_Node* pNewNode = pTemplateNode->CloneTemplateToForm(false); pFormParent->InsertChild(pNewNode, nullptr); if (bRecursive) { for (CXFA_Node* pTemplateChild = pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem( XFA_NODEITEM_NextSibling)) { - if (NeedGenerateForm(pTemplateChild, TRUE)) { - CXFA_Node* pNewChild = pTemplateChild->CloneTemplateToForm(TRUE); + if (NeedGenerateForm(pTemplateChild, true)) { + CXFA_Node* pNewChild = pTemplateChild->CloneTemplateToForm(true); pNewNode->InsertChild(pNewChild, nullptr); } } @@ -1316,9 +1314,9 @@ CXFA_Node* XFA_DataMerge_FindDataScope(CXFA_Node* pParentFormNode) { CXFA_Node* CXFA_Document::DataMerge_CopyContainer(CXFA_Node* pTemplateNode, CXFA_Node* pFormNode, CXFA_Node* pDataScope, - FX_BOOL bOneInstance, - FX_BOOL bDataMerge, - FX_BOOL bUpLevel) { + bool bOneInstance, + bool bDataMerge, + bool bUpLevel) { switch (pTemplateNode->GetElementType()) { case XFA_Element::SubformSet: case XFA_Element::Subform: @@ -1336,7 +1334,7 @@ CXFA_Node* CXFA_Document::DataMerge_CopyContainer(CXFA_Node* pTemplateNode, case XFA_Element::Variables: break; default: - ASSERT(FALSE); + ASSERT(false); break; } return nullptr; @@ -1349,8 +1347,8 @@ void CXFA_Document::DataMerge_UpdateBindingRelations( if (!pDataScope) return; - UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, FALSE, FALSE); - UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, TRUE, FALSE); + UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, false, false); + UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, true, false); } CXFA_Node* CXFA_Document::GetNotBindNode(CXFA_ObjArray& arrayNodes) { @@ -1427,9 +1425,9 @@ void CXFA_Document::DoDataMerge() { return; CXFA_Node* pFormRoot = m_pRootNode->GetFirstChildByClass(XFA_Element::Form); - FX_BOOL bEmptyForm = FALSE; + bool bEmptyForm = false; if (!pFormRoot) { - bEmptyForm = TRUE; + bEmptyForm = true; pFormRoot = CreateNode(XFA_XDPPACKET_Form, XFA_Element::Form); ASSERT(pFormRoot); pFormRoot->SetCData(XFA_ATTRIBUTE_Name, L"form"); @@ -1444,7 +1442,7 @@ void CXFA_Document::DoDataMerge() { } CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( - this, pFormRoot, pTemplateChosen, FALSE, nullptr); + this, pFormRoot, pTemplateChosen, false, nullptr); ASSERT(pSubformSetNode); if (!pDataTopLevel) { CFX_WideStringC wsFormName = pSubformSetNode->GetCData(XFA_ATTRIBUTE_Name); @@ -1461,17 +1459,17 @@ void CXFA_Document::DoDataMerge() { } ASSERT(pDataTopLevel); - CreateDataBinding(pSubformSetNode, pDataTopLevel, TRUE); + CreateDataBinding(pSubformSetNode, pDataTopLevel, true); for (CXFA_Node* pTemplateChild = pTemplateChosen->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { - if (NeedGenerateForm(pTemplateChild, TRUE)) { + if (NeedGenerateForm(pTemplateChild, true)) { XFA_NodeMerge_CloneOrMergeContainer(this, pSubformSetNode, pTemplateChild, - TRUE, nullptr); + true, nullptr); } else if (pTemplateChild->IsContainerNode()) { DataMerge_CopyContainer(pTemplateChild, pSubformSetNode, pDataTopLevel, - FALSE, TRUE, TRUE); + false, true, true); } } if (pDDRoot) @@ -1513,7 +1511,7 @@ void CXFA_Document::DoDataMerge() { } } -void CXFA_Document::DoDataRemerge(FX_BOOL bDoDataMerge) { +void CXFA_Document::DoDataRemerge(bool bDoDataMerge) { CXFA_Node* pFormRoot = ToNode(GetXFAObject(XFA_HASHCODE_Form)); if (pFormRoot) { while (CXFA_Node* pNode = pFormRoot->GetNodeItem(XFA_NODEITEM_FirstChild)) @@ -1525,5 +1523,5 @@ void CXFA_Document::DoDataRemerge(FX_BOOL bDoDataMerge) { DoDataMerge(); CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); - pLayoutProcessor->SetForceReLayout(TRUE); + pLayoutProcessor->SetForceReLayout(true); } diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.h b/xfa/fxfa/parser/xfa_document_datamerger_imp.h index f97a7b43b9..f9ea087731 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.h +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.h @@ -12,7 +12,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, CXFA_Node* pFormParent, CXFA_Node* pTemplateNode, - FX_BOOL bRecursive, + bool bRecursive, CXFA_NodeArray* pSubformArray); CXFA_Node* XFA_DataMerge_FindDataScope(CXFA_Node* pParentFormNode); CXFA_Node* XFA_DataMerge_FindFormDOMInstance(CXFA_Document* pDocument, diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index 1f2e1ea089..6926a99309 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -33,7 +33,7 @@ int32_t SeparateStringW(const FX_WCHAR* pStr, const FX_WCHAR* pToken = pStr; const FX_WCHAR* pEnd = pStr + iStrLen; - while (TRUE) { + while (true) { if (pStr >= pEnd || delimiter == *pStr) { CFX_WideString sub(pToken, pStr - pToken); pieces.Add(sub); @@ -50,8 +50,8 @@ int32_t SeparateStringW(const FX_WCHAR* pStr, CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode, CXFA_LayoutPageMgr* pPageMgr) - : m_bKeepBreakFinish(FALSE), - m_bIsProcessKeep(FALSE), + : m_bKeepBreakFinish(false), + m_bIsProcessKeep(false), m_pKeepHeadNode(nullptr), m_pKeepTailNode(nullptr), m_pFormNode(pNode), @@ -62,13 +62,13 @@ CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode, m_nCurChildNodeStage(XFA_ItemLayoutProcessorStages_None), m_fUsedSize(0), m_pPageMgr(pPageMgr), - m_bBreakPending(TRUE), + m_bBreakPending(true), m_fLastRowWidth(0), m_fLastRowY(0), m_fWidthLimite(0), - m_bUseInheriated(FALSE), + m_bUseInheriated(false), m_ePreProcessRs(XFA_ItemLayoutProcessorResult_Done), - m_bHasAvailHeight(TRUE) { + m_bHasAvailHeight(true) { ASSERT(m_pFormNode && (m_pFormNode->IsContainerNode() || m_pFormNode->GetElementType() == XFA_Element::Form)); m_pOldLayoutItem = @@ -104,19 +104,19 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem( } return pLayoutItem; } -FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos( +bool CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos( CXFA_ContentLayoutItem* pLayoutItem, FX_FLOAT fCurVerticalOffset, FX_FLOAT& fProposedSplitPos, - FX_BOOL& bAppChange, - FX_BOOL bCalculateMargin) { + bool& bAppChange, + bool bCalculateMargin) { CXFA_Node* pFormNode = pLayoutItem->m_pFormNode; if (fProposedSplitPos > fCurVerticalOffset + XFA_LAYOUT_FLOAT_PERCISION && fProposedSplitPos <= fCurVerticalOffset + pLayoutItem->m_sSize.y - XFA_LAYOUT_FLOAT_PERCISION) { switch (pFormNode->GetIntact()) { case XFA_ATTRIBUTEENUM_None: { - FX_BOOL bAnyChanged = FALSE; + bool bAnyChanged = false; CXFA_Document* pDocument = pFormNode->GetDocument(); CXFA_FFNotify* pNotify = pDocument->GetNotify(); FX_FLOAT fCurTopMargin = 0, fCurBottomMargin = 0; @@ -128,20 +128,20 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos( fCurBottomMargin = pMarginNode->GetMeasure(XFA_ATTRIBUTE_BottomInset) .ToUnit(XFA_UNIT_Pt); } - FX_BOOL bChanged = TRUE; + bool bChanged = true; while (bChanged) { - bChanged = FALSE; + bChanged = false; { FX_FLOAT fRelSplitPos = fProposedSplitPos - fCurVerticalOffset; if (pNotify->FindSplitPos(pFormNode, pLayoutItem->GetIndex(), fRelSplitPos)) { - bAnyChanged = TRUE; - bChanged = TRUE; + bAnyChanged = true; + bChanged = true; fProposedSplitPos = fCurVerticalOffset + fRelSplitPos; - bAppChange = TRUE; + bAppChange = true; if (fProposedSplitPos <= fCurVerticalOffset + XFA_LAYOUT_FLOAT_PERCISION) { - return TRUE; + return true; } } } @@ -153,7 +153,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos( (CXFA_ContentLayoutItem*)pChildItem->m_pNextSibling) { FX_FLOAT fChildOffset = fCurVerticalOffset + fCurTopMargin + pChildItem->m_sPos.y; - FX_BOOL bChange = FALSE; + bool bChange = false; if (FindLayoutItemSplitPos(pChildItem, fChildOffset, fRelSplitPos, bChange, bCalculateMargin)) { if (fRelSplitPos - fChildOffset < XFA_LAYOUT_FLOAT_PERCISION && @@ -162,11 +162,11 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos( } else { fProposedSplitPos = fRelSplitPos + fCurBottomMargin; } - bAnyChanged = TRUE; - bChanged = TRUE; + bAnyChanged = true; + bChanged = true; if (fProposedSplitPos <= fCurVerticalOffset + XFA_LAYOUT_FLOAT_PERCISION) { - return TRUE; + return true; } if (bAnyChanged) { break; @@ -179,32 +179,31 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos( case XFA_ATTRIBUTEENUM_ContentArea: case XFA_ATTRIBUTEENUM_PageArea: { fProposedSplitPos = fCurVerticalOffset; - return TRUE; + return true; } default: - return FALSE; + return false; } } - return FALSE; + return false; } -static XFA_ATTRIBUTEENUM XFA_ItemLayoutProcessor_GetLayout( - CXFA_Node* pFormNode, - FX_BOOL& bRootForceTb) { - bRootForceTb = FALSE; +static XFA_ATTRIBUTEENUM XFA_ItemLayoutProcessor_GetLayout(CXFA_Node* pFormNode, + bool& bRootForceTb) { + bRootForceTb = false; XFA_ATTRIBUTEENUM eLayoutMode; - if (pFormNode->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, FALSE)) { + if (pFormNode->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, false)) { return eLayoutMode; } CXFA_Node* pParentNode = pFormNode->GetNodeItem(XFA_NODEITEM_Parent); if (pParentNode && pParentNode->GetElementType() == XFA_Element::Form) { - bRootForceTb = TRUE; + bRootForceTb = true; return XFA_ATTRIBUTEENUM_Tb; } return XFA_ATTRIBUTEENUM_Position; } -static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) { +static bool XFA_ExistContainerKeep(CXFA_Node* pCurNode, bool bPreFind) { if (!pCurNode || !XFA_ItemLayoutProcessor_IsTakingSpace(pCurNode)) { - return FALSE; + return false; } XFA_NODEITEM eItemType = XFA_NODEITEM_PrevSibling; if (!bPreFind) { @@ -213,7 +212,7 @@ static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) { CXFA_Node* pPreContainer = pCurNode->GetNodeItem(eItemType, XFA_ObjectType::ContainerNode); if (!pPreContainer) { - return FALSE; + return false; } CXFA_Node* pKeep = pCurNode->GetFirstChildByClass(XFA_Element::Keep); if (pKeep) { @@ -222,40 +221,40 @@ static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) { if (!bPreFind) { eKeepType = XFA_ATTRIBUTE_Next; } - if (pKeep->TryEnum(eKeepType, ePrevious, FALSE)) { + if (pKeep->TryEnum(eKeepType, ePrevious, false)) { if (ePrevious == XFA_ATTRIBUTEENUM_ContentArea || ePrevious == XFA_ATTRIBUTEENUM_PageArea) { - return TRUE; + return true; } } } pKeep = pPreContainer->GetFirstChildByClass(XFA_Element::Keep); if (!pKeep) { - return FALSE; + return false; } XFA_ATTRIBUTEENUM eNext; XFA_ATTRIBUTE eKeepType = XFA_ATTRIBUTE_Next; if (!bPreFind) { eKeepType = XFA_ATTRIBUTE_Previous; } - if (!pKeep->TryEnum(eKeepType, eNext, FALSE)) { - return FALSE; + if (!pKeep->TryEnum(eKeepType, eNext, false)) { + return false; } if (eNext == XFA_ATTRIBUTEENUM_ContentArea || eNext == XFA_ATTRIBUTEENUM_PageArea) { - return TRUE; + return true; } - return FALSE; + return false; } FX_FLOAT CXFA_ItemLayoutProcessor::FindSplitPos(FX_FLOAT fProposedSplitPos) { ASSERT(m_pLayoutItem); XFA_ATTRIBUTEENUM eLayout = m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout); - FX_BOOL bCalculateMargin = TRUE; + bool bCalculateMargin = true; if (eLayout == XFA_ATTRIBUTEENUM_Position) { - bCalculateMargin = FALSE; + bCalculateMargin = false; } while (fProposedSplitPos > XFA_LAYOUT_FLOAT_PERCISION) { - FX_BOOL bAppChange = FALSE; + bool bAppChange = false; if (!FindLayoutItemSplitPos(m_pLayoutItem, 0, fProposedSplitPos, bAppChange, bCalculateMargin)) { break; @@ -269,9 +268,9 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem( FX_FLOAT fSplitPos) { FX_FLOAT fCurTopMargin = 0, fCurBottomMargin = 0; XFA_ATTRIBUTEENUM eLayout = m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout); - FX_BOOL bCalculateMargin = TRUE; + bool bCalculateMargin = true; if (eLayout == XFA_ATTRIBUTEENUM_Position) { - bCalculateMargin = FALSE; + bCalculateMargin = false; } CXFA_Node* pMarginNode = pLayoutItem->m_pFormNode->GetFirstChildByClass(XFA_Element::Margin); @@ -325,7 +324,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem( pChildItem->m_pNextSibling = nullptr; if (fSplitPos <= fCurTopMargin + pChildItem->m_sPos.y + fCurBottomMargin + XFA_LAYOUT_FLOAT_PERCISION) { - if (!XFA_ExistContainerKeep(pChildItem->m_pFormNode, TRUE)) { + if (!XFA_ExistContainerKeep(pChildItem->m_pFormNode, true)) { pChildItem->m_sPos.y -= fSplitPos - fCurBottomMargin; pChildItem->m_sPos.y += lHeightForKeep; pChildItem->m_sPos.y += fAddMarginHeight; @@ -360,7 +359,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem( fCurTopMargin + fCurBottomMargin + pChildItem->m_sPos.y + pChildItem->m_sSize.y) { pLayoutItem->AddChild(pChildItem); - if (XFA_ExistContainerKeep(pChildItem->m_pFormNode, FALSE)) { + if (XFA_ExistContainerKeep(pChildItem->m_pFormNode, false)) { keepLayoutItems.Add(pChildItem); } else { keepLayoutItems.RemoveAll(); @@ -393,7 +392,7 @@ CXFA_Node* CXFA_LayoutItem::GetFormNode() const { return m_pFormNode; } -void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative) const { +void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, bool bRelative) const { ASSERT(m_bIsContentLayoutItem); const CXFA_ContentLayoutItem* pThis = static_cast<const CXFA_ContentLayoutItem*>(this); @@ -596,12 +595,12 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::ExtractLayoutItem() { m_pOldLayoutItem = nullptr; return pLayoutItem; } -static FX_BOOL XFA_ItemLayoutProcessor_FindBreakNode( +static bool XFA_ItemLayoutProcessor_FindBreakNode( CXFA_Node* pContainerNode, CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, - FX_BOOL bBreakBefore) { - FX_BOOL bFindRs = FALSE; + bool bBreakBefore) { + bool bFindRs = false; for (CXFA_Node* pBreakNode = pContainerNode; pBreakNode; pBreakNode = pBreakNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { XFA_ATTRIBUTE eAttributeType = XFA_ATTRIBUTE_Before; @@ -613,14 +612,14 @@ static FX_BOOL XFA_ItemLayoutProcessor_FindBreakNode( if (bBreakBefore) { pCurActionNode = pBreakNode; nCurStage = XFA_ItemLayoutProcessorStages_BreakBefore; - bFindRs = TRUE; + bFindRs = true; } } break; case XFA_Element::BreakAfter: { if (!bBreakBefore) { pCurActionNode = pBreakNode; nCurStage = XFA_ItemLayoutProcessorStages_BreakAfter; - bFindRs = TRUE; + bFindRs = true; } } break; case XFA_Element::Break: @@ -630,7 +629,7 @@ static FX_BOOL XFA_ItemLayoutProcessor_FindBreakNode( if (!bBreakBefore) { nCurStage = XFA_ItemLayoutProcessorStages_BreakAfter; } - bFindRs = TRUE; + bFindRs = true; break; } default: @@ -666,7 +665,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node* pParentContainer, - FX_BOOL bUsePageBreak) { + bool bUsePageBreak) { CXFA_Node* pEntireContainer = pParentContainer; CXFA_Node* pChildContainer = XFA_LAYOUT_INVALIDNODE; switch (nCurStage) { @@ -688,7 +687,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( pChildContainer->GetNodeItem(XFA_NODEITEM_FirstChild); if (!m_bKeepBreakFinish && XFA_ItemLayoutProcessor_FindBreakNode(pBreakAfterNode, pCurActionNode, - nCurStage, FALSE)) { + nCurStage, false)) { return; } goto CheckNextChildContainer; @@ -721,7 +720,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( pCurActionNode->GetNodeItem(XFA_NODEITEM_NextSibling); if (!m_bKeepBreakFinish && XFA_ItemLayoutProcessor_FindBreakNode( - pBreakBeforeNode, pCurActionNode, nCurStage, TRUE)) { + pBreakBeforeNode, pCurActionNode, nCurStage, true)) { return; } if (m_bIsProcessKeep) { @@ -745,14 +744,14 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( pChildContainer->GetNodeItem(XFA_NODEITEM_FirstChild); if (!m_bKeepBreakFinish && XFA_ItemLayoutProcessor_FindBreakNode( - pBreakAfterNode, pCurActionNode, nCurStage, FALSE)) { + pBreakAfterNode, pCurActionNode, nCurStage, false)) { return; } } else { CXFA_Node* pBreakAfterNode = pCurActionNode->GetNodeItem(XFA_NODEITEM_NextSibling); if (XFA_ItemLayoutProcessor_FindBreakNode( - pBreakAfterNode, pCurActionNode, nCurStage, FALSE)) { + pBreakAfterNode, pCurActionNode, nCurStage, false)) { return; } } @@ -777,7 +776,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( if (!pNextChildContainer) { goto NoMoreChildContainer; } - FX_BOOL bLastKeep = FALSE; + bool bLastKeep = false; if (ProcessKeepNodesForCheckNext(pCurActionNode, nCurStage, pNextChildContainer, bLastKeep)) { return; @@ -785,7 +784,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( if (!m_bKeepBreakFinish && !bLastKeep && XFA_ItemLayoutProcessor_FindBreakNode( pNextChildContainer->GetNodeItem(XFA_NODEITEM_FirstChild), - pCurActionNode, nCurStage, TRUE)) { + pCurActionNode, nCurStage, true)) { return; } pCurActionNode = pNextChildContainer; @@ -821,20 +820,20 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( nCurStage = XFA_ItemLayoutProcessorStages_Done; } } -FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext( +bool CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext( CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node*& pNextContainer, - FX_BOOL& bLastKeepNode) { + bool& bLastKeepNode) { const bool bCanSplit = pNextContainer->GetIntact() == XFA_ATTRIBUTEENUM_None; - FX_BOOL bNextKeep = FALSE; - if (XFA_ExistContainerKeep(pNextContainer, FALSE)) { - bNextKeep = TRUE; + bool bNextKeep = false; + if (XFA_ExistContainerKeep(pNextContainer, false)) { + bNextKeep = true; } if (bNextKeep && !bCanSplit) { if (!m_bIsProcessKeep && !m_bKeepBreakFinish) { m_pKeepHeadNode = pNextContainer; - m_bIsProcessKeep = TRUE; + m_bIsProcessKeep = true; } } else { if (m_bIsProcessKeep && m_pKeepHeadNode) { @@ -842,46 +841,46 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext( if (!m_bKeepBreakFinish && XFA_ItemLayoutProcessor_FindBreakNode( pNextContainer->GetNodeItem(XFA_NODEITEM_FirstChild), - pCurActionNode, nCurStage, TRUE)) { - return TRUE; + pCurActionNode, nCurStage, true)) { + return true; } else { pNextContainer = m_pKeepHeadNode; - m_bKeepBreakFinish = TRUE; + m_bKeepBreakFinish = true; m_pKeepHeadNode = nullptr; m_pKeepTailNode = nullptr; - m_bIsProcessKeep = FALSE; + m_bIsProcessKeep = false; } } else { if (m_bKeepBreakFinish) { - bLastKeepNode = TRUE; + bLastKeepNode = true; } - m_bKeepBreakFinish = FALSE; + m_bKeepBreakFinish = false; } } - return FALSE; + return false; } -FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForBreakBefore( +bool CXFA_ItemLayoutProcessor::ProcessKeepNodesForBreakBefore( CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node* pContainerNode) { if (m_pKeepTailNode == pContainerNode) { pCurActionNode = m_pKeepHeadNode; - m_bKeepBreakFinish = TRUE; + m_bKeepBreakFinish = true; m_pKeepHeadNode = nullptr; m_pKeepTailNode = nullptr; - m_bIsProcessKeep = FALSE; + m_bIsProcessKeep = false; nCurStage = XFA_ItemLayoutProcessorStages_Container; - return TRUE; + return true; } CXFA_Node* pBreakAfterNode = pContainerNode->GetNodeItem(XFA_NODEITEM_FirstChild); if (XFA_ItemLayoutProcessor_FindBreakNode(pBreakAfterNode, pCurActionNode, - nCurStage, FALSE)) { - return TRUE; + nCurStage, false)) { + return true; } - return FALSE; + return false; } -FX_BOOL XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode) { +bool XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode) { XFA_ATTRIBUTEENUM ePresence = pNode->GetEnum(XFA_ATTRIBUTE_Presence); return ePresence == XFA_ATTRIBUTEENUM_Visible || ePresence == XFA_ATTRIBUTEENUM_Invisible; @@ -890,48 +889,48 @@ static inline void XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize( CXFA_Node* pFormNode, FX_FLOAT& fContainerWidth, FX_FLOAT& fContainerHeight, - FX_BOOL& bContainerWidthAutoSize, - FX_BOOL& bContainerHeightAutoSize) { + bool& bContainerWidthAutoSize, + bool& bContainerHeightAutoSize) { fContainerWidth = 0; fContainerHeight = 0; - bContainerWidthAutoSize = TRUE; - bContainerHeightAutoSize = TRUE; + bContainerWidthAutoSize = true; + bContainerHeightAutoSize = true; XFA_Element eType = pFormNode->GetElementType(); CXFA_Measurement mTmpValue; if (bContainerWidthAutoSize && (eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup) && - pFormNode->TryMeasure(XFA_ATTRIBUTE_W, mTmpValue, FALSE) && + pFormNode->TryMeasure(XFA_ATTRIBUTE_W, mTmpValue, false) && mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) { fContainerWidth = mTmpValue.ToUnit(XFA_UNIT_Pt); - bContainerWidthAutoSize = FALSE; + bContainerWidthAutoSize = false; } if (bContainerHeightAutoSize && (eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup) && - pFormNode->TryMeasure(XFA_ATTRIBUTE_H, mTmpValue, FALSE) && + pFormNode->TryMeasure(XFA_ATTRIBUTE_H, mTmpValue, false) && mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) { fContainerHeight = mTmpValue.ToUnit(XFA_UNIT_Pt); - bContainerHeightAutoSize = FALSE; + bContainerHeightAutoSize = false; } if (bContainerWidthAutoSize && eType == XFA_Element::Subform && - pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxW, mTmpValue, FALSE) && + pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxW, mTmpValue, false) && mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) { fContainerWidth = mTmpValue.ToUnit(XFA_UNIT_Pt); - bContainerWidthAutoSize = FALSE; + bContainerWidthAutoSize = false; } if (bContainerHeightAutoSize && eType == XFA_Element::Subform && - pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxH, mTmpValue, FALSE) && + pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxH, mTmpValue, false) && mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) { fContainerHeight = mTmpValue.ToUnit(XFA_UNIT_Pt); - bContainerHeightAutoSize = FALSE; + bContainerHeightAutoSize = false; } } static inline void XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize( CXFA_Node* pFormNode, - FX_BOOL bContainerWidthAutoSize, + bool bContainerWidthAutoSize, FX_FLOAT fContentCalculatedWidth, FX_FLOAT& fContainerWidth, - FX_BOOL bContainerHeightAutoSize, + bool bContainerHeightAutoSize, FX_FLOAT fContentCalculatedHeight, FX_FLOAT& fContainerHeight) { CXFA_Node* pMarginNode = pFormNode->GetFirstChildByClass(XFA_Element::Margin); @@ -939,10 +938,10 @@ XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize( if (bContainerWidthAutoSize) { fContainerWidth = fContentCalculatedWidth; if (pMarginNode) { - if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_LeftInset, mTmpValue, FALSE)) { + if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_LeftInset, mTmpValue, false)) { fContainerWidth += mTmpValue.ToUnit(XFA_UNIT_Pt); } - if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_RightInset, mTmpValue, FALSE)) { + if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_RightInset, mTmpValue, false)) { fContainerWidth += mTmpValue.ToUnit(XFA_UNIT_Pt); } } @@ -950,11 +949,11 @@ XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize( if (bContainerHeightAutoSize) { fContainerHeight = fContentCalculatedHeight; if (pMarginNode) { - if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_TopInset, mTmpValue, FALSE)) { + if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_TopInset, mTmpValue, false)) { fContainerHeight += mTmpValue.ToUnit(XFA_UNIT_Pt); } if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_BottomInset, mTmpValue, - FALSE)) { + false)) { fContainerHeight += mTmpValue.ToUnit(XFA_UNIT_Pt); } } @@ -1033,11 +1032,11 @@ void CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos( break; } } -FX_BOOL CXFA_ItemLayoutProcessor::IncrementRelayoutNode( +bool CXFA_ItemLayoutProcessor::IncrementRelayoutNode( CXFA_LayoutProcessor* pLayoutProcessor, CXFA_Node* pNode, CXFA_Node* pParentNode) { - return FALSE; + return false; } void CXFA_ItemLayoutProcessor::DoLayoutPageArea( CXFA_ContainerLayoutItem* pPageAreaLayoutItem) { @@ -1047,9 +1046,9 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea( XFA_ItemLayoutProcessorStages_None; CXFA_LayoutItem* pBeforeItem = nullptr; for (XFA_ItemLayoutProcessor_GotoNextContainerNode( - pCurChildNode, nCurChildNodeStage, pFormNode, FALSE); + pCurChildNode, nCurChildNodeStage, pFormNode, false); pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode( - pCurChildNode, nCurChildNodeStage, pFormNode, FALSE)) { + pCurChildNode, nCurChildNodeStage, pFormNode, false)) { if (nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) { continue; } @@ -1058,7 +1057,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea( } CXFA_ItemLayoutProcessor* pProcessor = new CXFA_ItemLayoutProcessor(pCurChildNode, nullptr); - pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX); + pProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX); if (!pProcessor->HasLayoutItem()) { delete pProcessor; continue; @@ -1105,10 +1104,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer( return; m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); - FX_BOOL bIgnoreXY = (m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout) != - XFA_ATTRIBUTEENUM_Position); + bool bIgnoreXY = (m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout) != + XFA_ATTRIBUTEENUM_Position); FX_FLOAT fContainerWidth = 0, fContainerHeight = 0; - FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE; + bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true; XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize( m_pFormNode, fContainerWidth, fContainerHeight, bContainerWidthAutoSize, bContainerHeightAutoSize); @@ -1117,11 +1116,11 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer( fHiddenContentCalculatedHeight = 0; if (m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) { XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE); + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false); } int32_t iColIndex = 0; for (; m_pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE)) { + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false)) { if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) { continue; } @@ -1135,7 +1134,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer( if (iColSpan <= pContext->m_prgSpecifiedColumnWidths->GetSize() - iColIndex) { pContext->m_fCurColumnWidth = 0; - pContext->m_bCurColumnWidthAvaiable = TRUE; + pContext->m_bCurColumnWidthAvaiable = true; if (iColSpan == -1) iColSpan = pContext->m_prgSpecifiedColumnWidths->GetSize(); for (int32_t i = 0; iColIndex + i < iColSpan; ++i) { @@ -1143,11 +1142,11 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer( pContext->m_prgSpecifiedColumnWidths->GetAt(iColIndex + i); } if (pContext->m_fCurColumnWidth == 0) - pContext->m_bCurColumnWidthAvaiable = FALSE; + pContext->m_bCurColumnWidthAvaiable = false; iColIndex += iColSpan >= 0 ? iColSpan : 0; } } - pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, + pProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, pContext); if (!pProcessor->HasLayoutItem()) { delete pProcessor; @@ -1155,9 +1154,9 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer( } FX_FLOAT fWidth, fHeight; pProcessor->GetCurrentComponentSize(fWidth, fHeight); - FX_BOOL bChangeParentSize = FALSE; + bool bChangeParentSize = false; if (XFA_ItemLayoutProcessor_IsTakingSpace(m_pCurChildNode)) { - bChangeParentSize = TRUE; + bChangeParentSize = true; } FX_FLOAT fAbsoluteX = 0, fAbsoluteY = 0; if (!bIgnoreXY) { @@ -1233,7 +1232,7 @@ static inline void XFA_ItemLayoutProcessor_UpdateWidgetSize( break; } default: - ASSERT(FALSE); + ASSERT(false); } } static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells( @@ -1241,7 +1240,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells( const CFX_ArrayTemplate<FX_FLOAT>& rgSpecifiedColumnWidths, XFA_ATTRIBUTEENUM eLayout) { FX_FLOAT fContainerWidth = 0, fContainerHeight = 0; - FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE; + bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true; XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize( pLayoutRow->m_pFormNode, fContainerWidth, fContainerHeight, bContainerWidthAutoSize, bContainerHeightAutoSize); @@ -1266,7 +1265,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells( FX_FLOAT fContentCalculatedWidth = 0, fContentCalculatedHeight = 0; FX_FLOAT fCurrentColX = 0; int32_t nCurrentColIdx = 0; - FX_BOOL bMetWholeRowCell = FALSE; + bool bMetWholeRowCell = false; for (CXFA_ContentLayoutItem* pLayoutChild = (CXFA_ContentLayoutItem*)pLayoutRow->m_pFirstChild; pLayoutChild; @@ -1287,7 +1286,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells( pLayoutChild->m_sSize.y); } if (nOriginalColSpan == -1) { - bMetWholeRowCell = TRUE; + bMetWholeRowCell = true; } pLayoutChild->m_sPos = CFX_PointF(fCurrentColX, 0); pLayoutChild->m_sSize.x = fColSpanWidth; @@ -1382,7 +1381,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { ASSERT(m_pCurChildNode == XFA_LAYOUT_INVALIDNODE); m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); FX_FLOAT fContainerWidth = 0, fContainerHeight = 0; - FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE; + bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true; XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize( m_pFormNode, fContainerWidth, fContainerHeight, bContainerWidthAutoSize, bContainerHeightAutoSize); @@ -1424,18 +1423,18 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { iSpecifiedColumnCount > 0 ? &layoutContext : nullptr; if (m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) { XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE); + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false); } for (; m_pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE)) { - layoutContext.m_bCurColumnWidthAvaiable = FALSE; + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false)) { + layoutContext.m_bCurColumnWidthAvaiable = false; layoutContext.m_fCurColumnWidth = 0; if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) { continue; } CXFA_ItemLayoutProcessor* pProcessor = new CXFA_ItemLayoutProcessor(m_pCurChildNode, m_pPageMgr); - pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, + pProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, pLayoutContext); if (!pProcessor->HasLayoutItem()) { delete pProcessor; @@ -1476,10 +1475,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { } iRowCount = rgRowItems.GetSize(); iColCount = 0; - FX_BOOL bMoreColumns = TRUE; + bool bMoreColumns = true; while (bMoreColumns) { - bMoreColumns = FALSE; - FX_BOOL bAutoCol = FALSE; + bMoreColumns = false; + bool bAutoCol = false; for (int32_t i = 0; i < iRowCount; i++) { while (rgRowItems[i] && (rgRowItemsSpan[i] <= 0 || !XFA_ItemLayoutProcessor_IsTakingSpace( @@ -1501,7 +1500,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { if (!pCell) { continue; } - bMoreColumns = TRUE; + bMoreColumns = true; if (rgRowItemsSpan[i] == 1) { if (iColCount >= iSpecifiedColumnCount) { for (int32_t j = 0, c = iColCount + 1 - @@ -1512,7 +1511,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { } if (m_rgSpecifiedColumnWidths[iColCount] < XFA_LAYOUT_FLOAT_PERCISION) { - bAutoCol = TRUE; + bAutoCol = true; } if (bAutoCol && m_rgSpecifiedColumnWidths[iColCount] < rgRowItemsWidth[i]) { @@ -1621,23 +1620,23 @@ static void XFA_ItemLayoutProcessor_UpdatePendedItemLayout( break; } } -FX_BOOL CXFA_ItemLayoutProcessor::IsAddNewRowForTrailer( +bool CXFA_ItemLayoutProcessor::IsAddNewRowForTrailer( CXFA_ContentLayoutItem* pTrailerItem) { if (!pTrailerItem) { - return FALSE; + return false; } FX_FLOAT fWidth = pTrailerItem->m_sSize.x; XFA_ATTRIBUTEENUM eLayout = m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout); if (eLayout != XFA_ATTRIBUTEENUM_Tb && m_fWidthLimite > fWidth) { - return FALSE; + return false; } - return TRUE; + return true; } static void XFA_ItemLayoutProcessor_AddTrailerBeforeSplit( CXFA_ItemLayoutProcessor* pProcessor, FX_FLOAT fSplitPos, CXFA_ContentLayoutItem* pTrailerLayoutItem, - FX_BOOL bUseInherited = FALSE) { + bool bUseInherited = false) { if (!pTrailerLayoutItem) { return; } @@ -1748,7 +1747,7 @@ static void XFA_ItemLayoutProcessor_AddLeaderAfterSplit( static void XFA_ItemLayoutProcessor_AddPendingNode( CXFA_ItemLayoutProcessor* pProcessor, CXFA_Node* pPendingNode, - FX_BOOL bBreakPending) { + bool bBreakPending) { pProcessor->m_PendingNodes.push_back(pPendingNode); pProcessor->m_bBreakPending = bBreakPending; } @@ -1769,7 +1768,7 @@ static FX_FLOAT XFA_ItemLayoutProcessor_InsertPendingItems( new CXFA_ItemLayoutProcessor(pProcessor->m_PendingNodes.front(), nullptr)); pProcessor->m_PendingNodes.pop_front(); - pPendingProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX); + pPendingProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX); CXFA_ContentLayoutItem* pPendingLayoutItem = pPendingProcessor->HasLayoutItem() ? pPendingProcessor->ExtractLayoutItem() @@ -1801,7 +1800,7 @@ FX_FLOAT CXFA_ItemLayoutProcessor::InsertKeepLayoutItems() { } return fTotalHeight; } -FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite( +bool CXFA_ItemLayoutProcessor::ProcessKeepForSplite( CXFA_ItemLayoutProcessor* pParentProcessor, CXFA_ItemLayoutProcessor* pChildProcessor, XFA_ItemLayoutProcessorResult eRetValue, @@ -1809,16 +1808,16 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite( FX_FLOAT& fContentCurRowAvailWidth, FX_FLOAT& fContentCurRowHeight, FX_FLOAT& fContentCurRowY, - FX_BOOL& bAddedItemInRow, - FX_BOOL& bForceEndPage, + bool& bAddedItemInRow, + bool& bForceEndPage, XFA_ItemLayoutProcessorResult& result) { if (!pParentProcessor || !pChildProcessor) { - return FALSE; + return false; } if (pParentProcessor->m_pCurChildNode->GetIntact() != XFA_ATTRIBUTEENUM_None || !pChildProcessor->m_bHasAvailHeight) { - if (XFA_ExistContainerKeep(pParentProcessor->m_pCurChildNode, TRUE)) { + if (XFA_ExistContainerKeep(pParentProcessor->m_pCurChildNode, true)) { FX_FLOAT fChildWidth, fChildHeight; pChildProcessor->GetCurrentComponentSize(fChildWidth, fChildHeight); CFX_ArrayTemplate<CXFA_ContentLayoutItem*> keepLayoutItems; @@ -1831,29 +1830,29 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite( fContentCurRowY -= pItem->m_sSize.y; m_arrayKeepItems.Add(pItem); } - bAddedItemInRow = TRUE; - bForceEndPage = TRUE; + bAddedItemInRow = true; + bForceEndPage = true; result = XFA_ItemLayoutProcessorResult_PageFullBreak; - return TRUE; + return true; } rgCurLineLayoutItem.Add(pChildProcessor->ExtractLayoutItem()); - bAddedItemInRow = TRUE; + bAddedItemInRow = true; fContentCurRowAvailWidth -= fChildWidth; if (fContentCurRowHeight < fChildHeight) { fContentCurRowHeight = fChildHeight; } result = eRetValue; - return TRUE; + return true; } } - return FALSE; + return false; } -FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage( +bool CXFA_ItemLayoutProcessor::JudgePutNextPage( CXFA_ContentLayoutItem* pParentLayoutItem, FX_FLOAT fChildHeight, CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems) { if (!pParentLayoutItem) { - return FALSE; + return false; } FX_FLOAT fItemsHeight = 0; for (CXFA_ContentLayoutItem* pChildLayoutItem = @@ -1861,7 +1860,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage( pChildLayoutItem; pChildLayoutItem = (CXFA_ContentLayoutItem*)pChildLayoutItem->m_pNextSibling) { - if (XFA_ExistContainerKeep(pChildLayoutItem->m_pFormNode, FALSE)) { + if (XFA_ExistContainerKeep(pChildLayoutItem->m_pFormNode, false)) { pKeepItems.Add(pChildLayoutItem); fItemsHeight += pChildLayoutItem->m_sSize.y; } else { @@ -1871,9 +1870,9 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage( } fItemsHeight += fChildHeight; if (m_pPageMgr->GetNextAvailContentHeight(fItemsHeight)) { - return TRUE; + return true; } - return FALSE; + return false; } void CXFA_ItemLayoutProcessor::ProcessUnUseBinds(CXFA_Node* pFormNode) { if (!pFormNode) { @@ -1920,24 +1919,24 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow( static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( CXFA_ItemLayoutProcessor* pThis, CXFA_ItemLayoutProcessor* pProcessor, - FX_BOOL bContainerWidthAutoSize, - FX_BOOL bContainerHeightAutoSize, + bool bContainerWidthAutoSize, + bool bContainerHeightAutoSize, FX_FLOAT fContainerHeight, XFA_ATTRIBUTEENUM eFlowStrategy, uint8_t& uCurHAlignState, CFX_ArrayTemplate<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3], - FX_BOOL bUseBreakControl, + bool bUseBreakControl, FX_FLOAT fAvailHeight, FX_FLOAT fRealHeight, FX_FLOAT& fContentCurRowY, FX_FLOAT& fContentWidthLimit, FX_FLOAT& fContentCurRowAvailWidth, FX_FLOAT& fContentCurRowHeight, - FX_BOOL& bAddedItemInRow, - FX_BOOL& bForceEndPage, + bool& bAddedItemInRow, + bool& bForceEndPage, CXFA_LayoutContext* pLayoutContext = nullptr, - FX_BOOL bNewRow = FALSE) { - FX_BOOL bTakeSpace = + bool bNewRow = false) { + bool bTakeSpace = XFA_ItemLayoutProcessor_IsTakingSpace(pProcessor->m_pFormNode); uint8_t uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt( pThis->m_pCurChildNode->GetEnum(XFA_ATTRIBUTE_HAlign)); @@ -1949,23 +1948,23 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( return XFA_ItemLayoutProcessorResult_RowFullBreak; } uCurHAlignState = uHAlign; - FX_BOOL bIsOwnSplite = + bool bIsOwnSplite = pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None; - FX_BOOL bUseRealHeight = + bool bUseRealHeight = bTakeSpace && bContainerHeightAutoSize && bIsOwnSplite && pProcessor->m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent)->GetIntact() == XFA_ATTRIBUTEENUM_None; - FX_BOOL bIsTransHeight = bTakeSpace; + bool bIsTransHeight = bTakeSpace; if (bIsTransHeight && !bIsOwnSplite) { - FX_BOOL bRootForceTb = FALSE; + bool bRootForceTb = false; XFA_ATTRIBUTEENUM eLayoutStrategy = XFA_ItemLayoutProcessor_GetLayout( pProcessor->m_pFormNode, bRootForceTb); if (eLayoutStrategy == XFA_ATTRIBUTEENUM_Lr_tb || eLayoutStrategy == XFA_ATTRIBUTEENUM_Rl_tb) { - bIsTransHeight = FALSE; + bIsTransHeight = false; } } - FX_BOOL bUseInherited = FALSE; + bool bUseInherited = false; CXFA_LayoutContext layoutContext; if (pThis->m_pPageMgr) { CXFA_Node* pOverflowNode = @@ -1980,7 +1979,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( if (!bNewRow || pProcessor->m_ePreProcessRs == XFA_ItemLayoutProcessorResult_Done) { eRetValue = pProcessor->DoLayout( - bTakeSpace ? bUseBreakControl : FALSE, + bTakeSpace ? bUseBreakControl : false, bUseRealHeight ? fRealHeight - fContentCurRowY : XFA_LAYOUT_FLOAT_MAX, bIsTransHeight ? fRealHeight - fContentCurRowY : XFA_LAYOUT_FLOAT_MAX, pLayoutContext); @@ -1989,7 +1988,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( eRetValue = pProcessor->m_ePreProcessRs; pProcessor->m_ePreProcessRs = XFA_ItemLayoutProcessorResult_Done; } - if (pProcessor->HasLayoutItem() == FALSE) { + if (pProcessor->HasLayoutItem() == false) { return eRetValue; } FX_FLOAT fChildWidth, fChildHeight; @@ -2006,23 +2005,23 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( CXFA_Node* pOverflowTrailerNode = nullptr; CXFA_Node* pFormNode = nullptr; CXFA_ContentLayoutItem* pTrailerLayoutItem = nullptr; - FX_BOOL bIsAddTrailerHeight = FALSE; + bool bIsAddTrailerHeight = false; if (pThis->m_pPageMgr && pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) { pFormNode = pThis->m_pPageMgr->QueryOverflow(pProcessor->m_pFormNode); if (!pFormNode && pLayoutContext && pLayoutContext->m_pOverflowProcessor) { pFormNode = pLayoutContext->m_pOverflowNode; - bUseInherited = TRUE; + bUseInherited = true; } if (pThis->m_pPageMgr->ProcessOverflow(pFormNode, pOverflowLeaderNode, - pOverflowTrailerNode, FALSE, - FALSE)) { + pOverflowTrailerNode, false, + false)) { if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowTrailerNode)) { if (pOverflowTrailerNode) { CXFA_ItemLayoutProcessor* pOverflowLeaderProcessor = new CXFA_ItemLayoutProcessor(pOverflowTrailerNode, nullptr); - pOverflowLeaderProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX); + pOverflowLeaderProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX); pTrailerLayoutItem = pOverflowLeaderProcessor->HasLayoutItem() ? pOverflowLeaderProcessor->ExtractLayoutItem() @@ -2039,7 +2038,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( if (bIsAddTrailerHeight) { FX_FLOAT fTrailerHeight = pTrailerLayoutItem->m_sSize.y; fChildHeight += fTrailerHeight; - bIsAddTrailerHeight = TRUE; + bIsAddTrailerHeight = true; } } } @@ -2058,9 +2057,9 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) { XFA_ItemLayoutProcessor_AddPendingNode(pProcessor, - pOverflowLeaderNode, FALSE); + pOverflowLeaderNode, false); } - pProcessor->m_bUseInheriated = FALSE; + pProcessor->m_bUseInheriated = false; } else { if (bIsAddTrailerHeight) { fChildHeight -= pTrailerLayoutItem->m_sSize.y; @@ -2071,14 +2070,14 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } CXFA_ContentLayoutItem* pChildLayoutItem = pProcessor->ExtractLayoutItem(); - if (XFA_ExistContainerKeep(pProcessor->m_pFormNode, FALSE) && + if (XFA_ExistContainerKeep(pProcessor->m_pFormNode, false) && pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) { pThis->m_arrayKeepItems.Add(pChildLayoutItem); } else { pThis->m_arrayKeepItems.RemoveAll(); } rgCurLineLayoutItems[uHAlign].Add(pChildLayoutItem); - bAddedItemInRow = TRUE; + bAddedItemInRow = true; if (bTakeSpace) { fContentCurRowAvailWidth -= fChildWidth; if (fContentCurRowHeight < fChildHeight) { @@ -2095,9 +2094,9 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) { XFA_ItemLayoutProcessor_AddPendingNode( - pProcessor, pOverflowLeaderNode, FALSE); + pProcessor, pOverflowLeaderNode, false); } - pProcessor->m_bUseInheriated = FALSE; + pProcessor->m_bUseInheriated = false; } else { if (bIsAddTrailerHeight) { fChildHeight -= pTrailerLayoutItem->m_sSize.y; @@ -2108,7 +2107,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } } rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem()); - bAddedItemInRow = TRUE; + bAddedItemInRow = true; fContentCurRowAvailWidth -= fChildWidth; if (fContentCurRowHeight < fChildHeight) { fContentCurRowHeight = fChildHeight; @@ -2123,7 +2122,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( bAddedItemInRow, bForceEndPage, eResult)) { return eResult; } - bForceEndPage = TRUE; + bForceEndPage = true; FX_FLOAT fSplitPos = pProcessor->FindSplitPos(fAvailHeight - fContentCurRowY); if (fSplitPos > XFA_LAYOUT_FLOAT_PERCISION) { @@ -2135,7 +2134,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( pOverflowTrailerNode, pTrailerLayoutItem, pFormNode); rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem()); - bAddedItemInRow = TRUE; + bAddedItemInRow = true; if (bTakeSpace) { fContentCurRowAvailWidth -= fChildWidth; if (fContentCurRowHeight < fChildHeight) { @@ -2149,7 +2148,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( if (pThis->m_pPageMgr && !pProcessor->m_bUseInheriated && eRetValue != XFA_ItemLayoutProcessorResult_PageFullBreak) { pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode, - pTempTrailerNode, FALSE, TRUE); + pTempTrailerNode, false, true); } if (pTrailerLayoutItem && bIsAddTrailerHeight) { XFA_ItemLayoutProcessor_AddTrailerBeforeSplit( @@ -2161,7 +2160,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode, pOverflowTrailerNode, pTrailerLayoutItem, pFormNode); - pThis->m_bUseInheriated = TRUE; + pThis->m_bUseInheriated = true; } else { CXFA_LayoutItem* firstChild = pProcessor->m_pLayoutItem->m_pFirstChild; @@ -2173,14 +2172,14 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } else { if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) { XFA_ItemLayoutProcessor_AddPendingNode( - pProcessor, pOverflowLeaderNode, FALSE); + pProcessor, pOverflowLeaderNode, false); } } } if (pProcessor->m_pLayoutItem->m_pNextSibling) { pProcessor->GetCurrentComponentSize(fChildWidth, fChildHeight); rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem()); - bAddedItemInRow = TRUE; + bAddedItemInRow = true; if (bTakeSpace) { fContentCurRowAvailWidth -= fChildWidth; if (fContentCurRowHeight < fChildHeight) { @@ -2199,18 +2198,18 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( pFormNode = pLayoutContext->m_pOverflowProcessor->m_pFormNode; } pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode, - pTempTrailerNode, FALSE, TRUE); + pTempTrailerNode, false, true); } if (bUseInherited) { pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode, pOverflowTrailerNode, pTrailerLayoutItem, pFormNode); - pThis->m_bUseInheriated = TRUE; + pThis->m_bUseInheriated = true; } return XFA_ItemLayoutProcessorResult_PageFullBreak; } rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem()); - bAddedItemInRow = TRUE; + bAddedItemInRow = true; if (bTakeSpace) { fContentCurRowAvailWidth -= fChildWidth; if (fContentCurRowHeight < fChildHeight) { @@ -2218,7 +2217,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } } if (eRetValue == XFA_ItemLayoutProcessorResult_Done) { - bForceEndPage = FALSE; + bForceEndPage = false; } return eRetValue; } else { @@ -2228,8 +2227,8 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( eLayout == XFA_ATTRIBUTEENUM_Tb) { if (pThis->m_pPageMgr) { pThis->m_pPageMgr->ProcessOverflow(pFormNode, pOverflowLeaderNode, - pOverflowTrailerNode, FALSE, - TRUE); + pOverflowTrailerNode, false, + true); } if (pTrailerLayoutItem) { XFA_ItemLayoutProcessor_AddTrailerBeforeSplit(pProcessor, fSplitPos, @@ -2237,7 +2236,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) { XFA_ItemLayoutProcessor_AddPendingNode(pProcessor, - pOverflowLeaderNode, FALSE); + pOverflowLeaderNode, false); } } else { if (eRetValue == XFA_ItemLayoutProcessorResult_Done) { @@ -2246,14 +2245,14 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } if (pThis->m_pPageMgr) { pThis->m_pPageMgr->ProcessOverflow(pFormNode, pOverflowLeaderNode, - pOverflowTrailerNode, FALSE, - TRUE); + pOverflowTrailerNode, false, + true); } if (bUseInherited) { pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode, pOverflowTrailerNode, pTrailerLayoutItem, pFormNode); - pThis->m_bUseInheriated = TRUE; + pThis->m_bUseInheriated = true; } } } @@ -2267,18 +2266,18 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( - FX_BOOL bUseBreakControl, + bool bUseBreakControl, XFA_ATTRIBUTEENUM eFlowStrategy, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight, CXFA_LayoutContext* pContext, - FX_BOOL bRootForceTb) { - m_bHasAvailHeight = TRUE; + bool bRootForceTb) { + m_bHasAvailHeight = true; FX_FLOAT fContainerWidth = 0, fContainerHeight = 0; - FX_BOOL bBreakDone = FALSE; - FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE; - FX_BOOL bForceEndPage = FALSE; - FX_BOOL bIsManualBreak = FALSE; + bool bBreakDone = false; + bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true; + bool bForceEndPage = false; + bool bIsManualBreak = false; if (m_pCurChildPreprocessor) { m_pCurChildPreprocessor->m_ePreProcessRs = XFA_ItemLayoutProcessorResult_Done; @@ -2287,7 +2286,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( m_pFormNode, fContainerWidth, fContainerHeight, bContainerWidthAutoSize, bContainerHeightAutoSize); if (pContext && pContext->m_bCurColumnWidthAvaiable) { - bContainerWidthAutoSize = FALSE; + bContainerWidthAutoSize = false; fContainerWidth = pContext->m_fCurColumnWidth; } if (!bContainerHeightAutoSize) { @@ -2295,7 +2294,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } if (!bContainerHeightAutoSize) { CXFA_Node* pParentNode = m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent); - FX_BOOL bFocrTb = FALSE; + bool bFocrTb = false; if (pParentNode && XFA_ItemLayoutProcessor_GetLayout(pParentNode, bFocrTb) == XFA_ATTRIBUTEENUM_Row) { @@ -2305,7 +2304,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( pChildContainer->GetNodeItem(XFA_NODEITEM_NextSibling, XFA_ObjectType::ContainerNode)) { fContainerHeight = 0; - bContainerHeightAutoSize = TRUE; + bContainerHeightAutoSize = true; } } } @@ -2328,7 +2327,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( FX_FLOAT fContentCalculatedWidth = 0, fContentCalculatedHeight = 0; FX_FLOAT fAvailHeight = fHeightLimit - fTopInset - fBottomInset; if (fAvailHeight < 0) { - m_bHasAvailHeight = FALSE; + m_bHasAvailHeight = false; } fRealHeight = fRealHeight - fTopInset - fBottomInset; FX_FLOAT fContentCurRowY = 0; @@ -2372,15 +2371,15 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( fContentCurRowY += InsertKeepLayoutItems(); if (m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_None) { XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE); + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true); } fContentCurRowY += XFA_ItemLayoutProcessor_InsertPendingItems(this, m_pFormNode); if (m_pCurChildPreprocessor && m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Container) { - if (XFA_ExistContainerKeep(m_pCurChildPreprocessor->GetFormNode(), FALSE)) { + if (XFA_ExistContainerKeep(m_pCurChildPreprocessor->GetFormNode(), false)) { m_pKeepHeadNode = m_pCurChildNode; - m_bIsProcessKeep = TRUE; + m_bIsProcessKeep = true; m_nCurChildNodeStage = XFA_ItemLayoutProcessorStages_Keep; } } @@ -2446,7 +2445,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } while (m_pCurChildNode) { CXFA_ItemLayoutProcessor* pProcessor = nullptr; - FX_BOOL bAddedItemInRow = FALSE; + bool bAddedItemInRow = false; fContentCurRowY += XFA_ItemLayoutProcessor_InsertPendingItems(this, m_pFormNode); switch (m_nCurChildNodeStage) { @@ -2462,29 +2461,29 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } CXFA_Node* pLeaderNode = nullptr; CXFA_Node* pTrailerNode = nullptr; - FX_BOOL bCreatePage = FALSE; + bool bCreatePage = false; if (bUseBreakControl && m_pPageMgr && - m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, TRUE, + m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, true, pLeaderNode, pTrailerNode, bCreatePage) && m_pFormNode->GetElementType() != XFA_Element::Form && bCreatePage) { if (JudgeLeaderOrTrailerForOccur(pLeaderNode)) { - XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, TRUE); + XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, true); } if (JudgeLeaderOrTrailerForOccur(pTrailerNode)) { if (m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent) ->GetElementType() == XFA_Element::Form && !m_pLayoutItem) { XFA_ItemLayoutProcessor_AddPendingNode(this, pTrailerNode, - TRUE); + true); } else { std::unique_ptr<CXFA_ItemLayoutProcessor> pTempProcessor( new CXFA_ItemLayoutProcessor(pTrailerNode, nullptr)); XFA_ItemLayoutProcessor_InsertFlowedItem( this, pTempProcessor.get(), bContainerWidthAutoSize, bContainerHeightAutoSize, fContainerHeight, eFlowStrategy, - uCurHAlignState, rgCurLineLayoutItems, FALSE, + uCurHAlignState, rgCurLineLayoutItems, false, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, fContentCurRowY, fContentWidthLimit, fContentCurRowAvailWidth, fContentCurRowHeight, bAddedItemInRow, bForceEndPage, @@ -2492,18 +2491,18 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } } XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE); - bForceEndPage = TRUE; - bIsManualBreak = TRUE; + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true); + bForceEndPage = true; + bIsManualBreak = true; goto SuspendAndCreateNewRow; } } break; case XFA_ItemLayoutProcessorStages_BreakAfter: { CXFA_Node* pLeaderNode = nullptr; CXFA_Node* pTrailerNode = nullptr; - FX_BOOL bCreatePage = FALSE; + bool bCreatePage = false; if (bUseBreakControl && m_pPageMgr && - m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, FALSE, + m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, false, pLeaderNode, pTrailerNode, bCreatePage) && m_pFormNode->GetElementType() != XFA_Element::Form) { @@ -2513,7 +2512,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( XFA_ItemLayoutProcessor_InsertFlowedItem( this, pTempProcessor.get(), bContainerWidthAutoSize, bContainerHeightAutoSize, fContainerHeight, eFlowStrategy, - uCurHAlignState, rgCurLineLayoutItems, FALSE, + uCurHAlignState, rgCurLineLayoutItems, false, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, fContentCurRowY, fContentWidthLimit, fContentCurRowAvailWidth, fContentCurRowHeight, bAddedItemInRow, bForceEndPage, @@ -2532,7 +2531,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( XFA_ItemLayoutProcessor_InsertFlowedItem( this, pTempProcessor.get(), bContainerWidthAutoSize, bContainerHeightAutoSize, fContainerHeight, eFlowStrategy, - uCurHAlignState, rgCurLineLayoutItems, FALSE, + uCurHAlignState, rgCurLineLayoutItems, false, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, fContentCurRowY, fContentWidthLimit, fContentCurRowAvailWidth, fContentCurRowHeight, bAddedItemInRow, bForceEndPage, @@ -2540,16 +2539,16 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } } else { if (JudgeLeaderOrTrailerForOccur(pLeaderNode)) { - XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, TRUE); + XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, true); } } XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE); + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true); if (bCreatePage) { - bForceEndPage = TRUE; - bIsManualBreak = TRUE; + bForceEndPage = true; + bIsManualBreak = true; if (m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Done) { - bBreakDone = TRUE; + bBreakDone = true; } } goto SuspendAndCreateNewRow; @@ -2562,7 +2561,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( m_pCurChildPreprocessor = nullptr; } else if (m_pPageMgr && m_pPageMgr->ProcessBookendLeaderOrTrailer( - m_pCurChildNode, TRUE, pLeaderNode)) { + m_pCurChildNode, true, pLeaderNode)) { pProcessor = new CXFA_ItemLayoutProcessor(pLeaderNode, m_pPageMgr); } if (pProcessor) { @@ -2588,7 +2587,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( m_pCurChildPreprocessor = nullptr; } else if (m_pPageMgr && m_pPageMgr->ProcessBookendLeaderOrTrailer( - m_pCurChildNode, FALSE, pTrailerNode)) { + m_pCurChildNode, false, pTrailerNode)) { pProcessor = new CXFA_ItemLayoutProcessor(pTrailerNode, m_pPageMgr); } if (pProcessor) { @@ -2614,15 +2613,15 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } if (fContentCurRowY >= fHeightLimit + XFA_LAYOUT_FLOAT_PERCISION && XFA_ItemLayoutProcessor_IsTakingSpace(m_pCurChildNode)) { - bForceEndPage = TRUE; + bForceEndPage = true; goto SuspendAndCreateNewRow; } if (m_pCurChildNode->IsContainerNode()) { - FX_BOOL bNewRow = FALSE; + bool bNewRow = false; if (m_pCurChildPreprocessor) { pProcessor = m_pCurChildPreprocessor; m_pCurChildPreprocessor = nullptr; - bNewRow = TRUE; + bNewRow = true; } else { pProcessor = new CXFA_ItemLayoutProcessor(m_pCurChildNode, m_pPageMgr); @@ -2640,9 +2639,9 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( pContext, bNewRow); switch (rs) { case XFA_ItemLayoutProcessorResult_ManualBreak: - bIsManualBreak = TRUE; + bIsManualBreak = true; case XFA_ItemLayoutProcessorResult_PageFullBreak: - bForceEndPage = TRUE; + bForceEndPage = true; case XFA_ItemLayoutProcessorResult_RowFullBreak: goto SuspendAndCreateNewRow; case XFA_ItemLayoutProcessorResult_Done: @@ -2660,7 +2659,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( break; } XFA_ItemLayoutProcessor_GotoNextContainerNode( - m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE); + m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true); if (bAddedItemInRow && eFlowStrategy == XFA_ATTRIBUTEENUM_Tb) { break; } else { @@ -2682,11 +2681,10 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( break; } } - FX_BOOL bRetValue = - m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Done && - m_PendingNodes.empty(); + bool bRetValue = m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Done && + m_PendingNodes.empty(); if (bBreakDone) { - bRetValue = FALSE; + bRetValue = false; } XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize( m_pFormNode, bContainerWidthAutoSize, fContentCalculatedWidth, @@ -2713,17 +2711,17 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( : XFA_ItemLayoutProcessorResult_PageFullBreak); } -FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition( - CFX_ArrayTemplate<CXFA_ContentLayoutItem*>(&rgCurLineLayoutItems)[3], +bool CXFA_ItemLayoutProcessor::CalculateRowChildPosition( + CFX_ArrayTemplate<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3], XFA_ATTRIBUTEENUM eFlowStrategy, - FX_BOOL bContainerHeightAutoSize, - FX_BOOL bContainerWidthAutoSize, + bool bContainerHeightAutoSize, + bool bContainerWidthAutoSize, FX_FLOAT& fContentCalculatedWidth, FX_FLOAT& fContentCalculatedHeight, FX_FLOAT& fContentCurRowY, FX_FLOAT fContentCurRowHeight, FX_FLOAT fContentWidthLimit, - FX_BOOL bRootForceTb) { + bool bRootForceTb) { int32_t nGroupLengths[3] = {0, 0, 0}; FX_FLOAT fGroupWidths[3] = {0, 0, 0}; int32_t nTotalLength = 0; @@ -2744,7 +2742,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition( fContentCalculatedHeight = fNewHeight; } } - return FALSE; + return false; } if (!m_pLayoutItem) { m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); @@ -2866,7 +2864,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition( fContentCalculatedHeight = fChildSuppliedHeight; } } - return TRUE; + return true; } CXFA_Node* CXFA_ItemLayoutProcessor::GetSubformSetParent( CXFA_Node* pSubformSet) { @@ -2906,7 +2904,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutField() { SetCurrentComponentSize(fWidth, fHeight); } XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayout( - FX_BOOL bUseBreakControl, + bool bUseBreakControl, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight, CXFA_LayoutContext* pContext) { @@ -2915,7 +2913,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayout( case XFA_Element::Area: case XFA_Element::ExclGroup: case XFA_Element::SubformSet: { - FX_BOOL bRootForceTb = FALSE; + bool bRootForceTb = false; CXFA_Node* pLayoutNode = GetSubformSetParent(m_pFormNode); XFA_ATTRIBUTEENUM eLayoutStrategy = XFA_ItemLayoutProcessor_GetLayout(pLayoutNode, bRootForceTb); @@ -2971,10 +2969,10 @@ void CXFA_ItemLayoutProcessor::SetCurrentComponentSize(FX_FLOAT fWidth, m_pLayoutItem->m_sSize = CFX_SizeF(fWidth, fHeight); } -FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur( +bool CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur( CXFA_Node* pFormNode) { if (!pFormNode) - return FALSE; + return false; CXFA_Node* pTemplate = pFormNode->GetTemplateNode(); if (!pTemplate) @@ -2983,12 +2981,12 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur( CXFA_Occur NodeOccur(pTemplate->GetFirstChildByClass(XFA_Element::Occur)); int32_t iMax = NodeOccur.GetMax(); if (iMax < 0) - return TRUE; + return true; int32_t iCount = m_PendingNodesCount[pTemplate]; if (iCount >= iMax) - return FALSE; + return false; m_PendingNodesCount[pTemplate] = iCount + 1; - return TRUE; + return true; } diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.h b/xfa/fxfa/parser/xfa_layout_itemlayout.h index 6da09cb3f7..0d114a4d5c 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.h +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.h @@ -49,13 +49,13 @@ class CXFA_LayoutContext { CXFA_LayoutContext() : m_prgSpecifiedColumnWidths(nullptr), m_fCurColumnWidth(0), - m_bCurColumnWidthAvaiable(FALSE), + m_bCurColumnWidthAvaiable(false), m_pOverflowProcessor(nullptr), m_pOverflowNode(nullptr) {} ~CXFA_LayoutContext() { m_pOverflowProcessor = nullptr; } CFX_ArrayTemplate<FX_FLOAT>* m_prgSpecifiedColumnWidths; FX_FLOAT m_fCurColumnWidth; - FX_BOOL m_bCurColumnWidthAvaiable; + bool m_bCurColumnWidthAvaiable; CXFA_ItemLayoutProcessor* m_pOverflowProcessor; CXFA_Node* m_pOverflowNode; }; @@ -66,7 +66,7 @@ class CXFA_ItemLayoutProcessor { ~CXFA_ItemLayoutProcessor(); XFA_ItemLayoutProcessorResult DoLayout( - FX_BOOL bUseBreakControl, + bool bUseBreakControl, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight = XFA_LAYOUT_FLOAT_MAX, CXFA_LayoutContext* pContext = nullptr); @@ -79,32 +79,31 @@ class CXFA_ItemLayoutProcessor { void SetCurrentComponentSize(FX_FLOAT fWidth, FX_FLOAT fHeight); CXFA_Node* GetFormNode() { return m_pFormNode; } - FX_BOOL HasLayoutItem() { return !!m_pLayoutItem; } + bool HasLayoutItem() { return !!m_pLayoutItem; } CXFA_ContentLayoutItem* ExtractLayoutItem(); - static FX_BOOL IncrementRelayoutNode(CXFA_LayoutProcessor* pLayoutProcessor, - CXFA_Node* pNode, - CXFA_Node* pParentNode); + static bool IncrementRelayoutNode(CXFA_LayoutProcessor* pLayoutProcessor, + CXFA_Node* pNode, + CXFA_Node* pParentNode); static void CalculatePositionedContainerPos(CXFA_Node* pNode, FX_FLOAT fWidth, FX_FLOAT fHeight, FX_FLOAT& fAbsoluteX, FX_FLOAT& fAbsoluteY); - static FX_BOOL FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem, - FX_FLOAT fCurVerticalOffset, - FX_FLOAT& fProposedSplitPos, - FX_BOOL& bAppChange, - FX_BOOL bCalculateMargin = TRUE); + static bool FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem, + FX_FLOAT fCurVerticalOffset, + FX_FLOAT& fProposedSplitPos, + bool& bAppChange, + bool bCalculateMargin = true); FX_FLOAT FindSplitPos(FX_FLOAT fProposedSplitPos); void SplitLayoutItem(CXFA_ContentLayoutItem* pLayoutItem, CXFA_ContentLayoutItem* pSecondParent, FX_FLOAT fSplitPos); void SplitLayoutItem(FX_FLOAT fSplitPos); - FX_BOOL JudgePutNextPage( - CXFA_ContentLayoutItem* pParentLayoutItem, - FX_FLOAT fChildHeight, - CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems); - FX_BOOL ProcessKeepForSplite( + bool JudgePutNextPage(CXFA_ContentLayoutItem* pParentLayoutItem, + FX_FLOAT fChildHeight, + CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems); + bool ProcessKeepForSplite( CXFA_ItemLayoutProcessor* pParentProcessor, CXFA_ItemLayoutProcessor* pChildProcessor, XFA_ItemLayoutProcessorResult eRetValue, @@ -112,64 +111,63 @@ class CXFA_ItemLayoutProcessor { FX_FLOAT& fContentCurRowAvailWidth, FX_FLOAT& fContentCurRowHeight, FX_FLOAT& fContentCurRowY, - FX_BOOL& bAddedItemInRow, - FX_BOOL& bForceEndPage, + bool& bAddedItemInRow, + bool& bForceEndPage, XFA_ItemLayoutProcessorResult& result); FX_FLOAT InsertKeepLayoutItems(); void DoLayoutPageArea(CXFA_ContainerLayoutItem* pPageAreaLayoutItem); - FX_BOOL CalculateRowChildPosition( - CFX_ArrayTemplate<CXFA_ContentLayoutItem*>(&rgCurLineLayoutItems)[3], + bool CalculateRowChildPosition( + CFX_ArrayTemplate<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3], XFA_ATTRIBUTEENUM eFlowStrategy, - FX_BOOL bContainerHeightAutoSize, - FX_BOOL bContainerWidthAutoSize, + bool bContainerHeightAutoSize, + bool bContainerWidthAutoSize, FX_FLOAT& fContentCalculatedWidth, FX_FLOAT& fContentCalculatedHeight, FX_FLOAT& fContentCurRowY, FX_FLOAT fContentCurRowHeight, FX_FLOAT fContentWidthLimit, - FX_BOOL bRootForceTb = FALSE); + bool bRootForceTb = false); void ProcessUnUseOverFlow(CXFA_Node* pLeaderNode, CXFA_Node* pTrailerNode, CXFA_ContentLayoutItem* pTrailerItem, CXFA_Node* pFormNode); void ProcessUnUseBinds(CXFA_Node* pFormNode); - FX_BOOL IsAddNewRowForTrailer(CXFA_ContentLayoutItem* pTrailerItem); - FX_BOOL JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormNode); + bool IsAddNewRowForTrailer(CXFA_ContentLayoutItem* pTrailerItem); + bool JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormNode); CXFA_ContentLayoutItem* CreateContentLayoutItem(CXFA_Node* pFormNode); protected: void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext = nullptr); void DoLayoutTableContainer(CXFA_Node* pLayoutNode); XFA_ItemLayoutProcessorResult DoLayoutFlowedContainer( - FX_BOOL bUseBreakControl, + bool bUseBreakControl, XFA_ATTRIBUTEENUM eFlowStrategy, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight, CXFA_LayoutContext* pContext = nullptr, - FX_BOOL bRootForceTb = FALSE); + bool bRootForceTb = false); void DoLayoutField(); void XFA_ItemLayoutProcessor_GotoNextContainerNode( CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node* pParentContainer, - FX_BOOL bUsePageBreak); + bool bUsePageBreak); - FX_BOOL ProcessKeepNodesForCheckNext(CXFA_Node*& pCurActionNode, - XFA_ItemLayoutProcessorStages& nCurStage, - CXFA_Node*& pNextContainer, - FX_BOOL& bLastKeepNode); + bool ProcessKeepNodesForCheckNext(CXFA_Node*& pCurActionNode, + XFA_ItemLayoutProcessorStages& nCurStage, + CXFA_Node*& pNextContainer, + bool& bLastKeepNode); - FX_BOOL ProcessKeepNodesForBreakBefore( - CXFA_Node*& pCurActionNode, - XFA_ItemLayoutProcessorStages& nCurStage, - CXFA_Node* pContainerNode); + bool ProcessKeepNodesForBreakBefore(CXFA_Node*& pCurActionNode, + XFA_ItemLayoutProcessorStages& nCurStage, + CXFA_Node* pContainerNode); CXFA_Node* GetSubformSetParent(CXFA_Node* pSubformSet); public: - FX_BOOL m_bKeepBreakFinish; - FX_BOOL m_bIsProcessKeep; + bool m_bKeepBreakFinish; + bool m_bIsProcessKeep; CXFA_Node* m_pKeepHeadNode; CXFA_Node* m_pKeepTailNode; CXFA_Node* m_pFormNode; @@ -181,17 +179,17 @@ class CXFA_ItemLayoutProcessor { FX_FLOAT m_fUsedSize; CXFA_LayoutPageMgr* m_pPageMgr; std::list<CXFA_Node*> m_PendingNodes; - FX_BOOL m_bBreakPending; + bool m_bBreakPending; CFX_ArrayTemplate<FX_FLOAT> m_rgSpecifiedColumnWidths; CFX_ArrayTemplate<CXFA_ContentLayoutItem*> m_arrayKeepItems; std::map<CXFA_Node*, int32_t> m_PendingNodesCount; FX_FLOAT m_fLastRowWidth; FX_FLOAT m_fLastRowY; FX_FLOAT m_fWidthLimite; - FX_BOOL m_bUseInheriated; + bool m_bUseInheriated; XFA_ItemLayoutProcessorResult m_ePreProcessRs; - FX_BOOL m_bHasAvailHeight; + bool m_bHasAvailHeight; }; -FX_BOOL XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode); +bool XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode); #endif // XFA_FXFA_PARSER_XFA_LAYOUT_ITEMLAYOUT_H_ diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp index 5e8c7a208c..8c106209aa 100644 --- a/xfa/fxfa/parser/xfa_locale.cpp +++ b/xfa/fxfa/parser/xfa_locale.cpp @@ -88,32 +88,32 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { void CXFA_XMLLocale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, - FX_BOOL bAbbr) const { + bool bAbbr) const { wsMonthName = GetCalendarSymbol("month", nMonth, bAbbr); } void CXFA_XMLLocale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, - FX_BOOL bAbbr) const { + bool bAbbr) const { wsDayName = GetCalendarSymbol("day", nWeek, bAbbr); } void CXFA_XMLLocale::GetMeridiemName(CFX_WideString& wsMeridiemName, - FX_BOOL bAM) const { - wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, FALSE); + bool bAM) const { + wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, false); } void CXFA_XMLLocale::GetTimeZone(FX_TIMEZONE& tz) const { CXFA_TimeZoneProvider::Get()->GetTimeZone(tz); } -void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const { - wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, FALSE); +void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, bool bAD) const { + wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, false); } CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol, int index, - FX_BOOL bAbbr) const { + bool bAbbr) const { CFX_ByteString pstrSymbolNames = symbol + "Names"; CFX_WideString wsSymbolName = L""; if (m_pLocaleData) { @@ -272,28 +272,28 @@ void CXFA_NodeLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { void CXFA_NodeLocale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, - FX_BOOL bAbbr) const { + bool bAbbr) const { wsMonthName = GetCalendarSymbol(XFA_Element::MonthNames, nMonth, bAbbr); } void CXFA_NodeLocale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, - FX_BOOL bAbbr) const { + bool bAbbr) const { wsDayName = GetCalendarSymbol(XFA_Element::DayNames, nWeek, bAbbr); } void CXFA_NodeLocale::GetMeridiemName(CFX_WideString& wsMeridiemName, - FX_BOOL bAM) const { + bool bAM) const { wsMeridiemName = - GetCalendarSymbol(XFA_Element::MeridiemNames, bAM ? 0 : 1, FALSE); + GetCalendarSymbol(XFA_Element::MeridiemNames, bAM ? 0 : 1, false); } void CXFA_NodeLocale::GetTimeZone(FX_TIMEZONE& tz) const { CXFA_TimeZoneProvider::Get()->GetTimeZone(tz); } -void CXFA_NodeLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const { - wsEraName = GetCalendarSymbol(XFA_Element::EraNames, bAD ? 1 : 0, FALSE); +void CXFA_NodeLocale::GetEraName(CFX_WideString& wsEraName, bool bAD) const { + wsEraName = GetCalendarSymbol(XFA_Element::EraNames, bAD ? 1 : 0, false); } void CXFA_NodeLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, @@ -378,7 +378,7 @@ CFX_WideString CXFA_NodeLocale::GetSymbol( CFX_WideString CXFA_NodeLocale::GetCalendarSymbol(XFA_Element eElement, int index, - FX_BOOL bAbbr) const { + bool bAbbr) const { CXFA_Node* pCalendar = m_pLocale ? m_pLocale->GetChild(0, XFA_Element::CalendarSymbols) : nullptr; diff --git a/xfa/fxfa/parser/xfa_locale.h b/xfa/fxfa/parser/xfa_locale.h index 75104b456c..b9a3259ead 100644 --- a/xfa/fxfa/parser/xfa_locale.h +++ b/xfa/fxfa/parser/xfa_locale.h @@ -25,14 +25,14 @@ class CXFA_XMLLocale : public IFX_Locale { void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override; void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, - FX_BOOL bAbbr = TRUE) const override; + bool bAbbr = true) const override; void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, - FX_BOOL bAbbr = TRUE) const override; + bool bAbbr = true) const override; void GetMeridiemName(CFX_WideString& wsMeridiemName, - FX_BOOL bAM = TRUE) const override; + bool bAM = true) const override; void GetTimeZone(FX_TIMEZONE& tz) const override; - void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const override; + void GetEraName(CFX_WideString& wsEraName, bool bAD = true) const override; void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const override; @@ -48,7 +48,7 @@ class CXFA_XMLLocale : public IFX_Locale { CFX_WideString& wsPattern) const; CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol, int index, - FX_BOOL bAbbr) const; + bool bAbbr) const; private: std::unique_ptr<CXML_Element> m_pLocaleData; @@ -67,14 +67,14 @@ class CXFA_NodeLocale : public IFX_Locale { void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override; void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, - FX_BOOL bAbbr = TRUE) const override; + bool bAbbr = true) const override; void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, - FX_BOOL bAbbr = TRUE) const override; + bool bAbbr = true) const override; void GetMeridiemName(CFX_WideString& wsMeridiemName, - FX_BOOL bAM = TRUE) const override; + bool bAM = true) const override; void GetTimeZone(FX_TIMEZONE& tz) const override; - void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const override; + void GetEraName(CFX_WideString& wsEraName, bool bAD = true) const override; void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const override; @@ -90,7 +90,7 @@ class CXFA_NodeLocale : public IFX_Locale { const CFX_WideStringC& symbol_type) const; CFX_WideString GetCalendarSymbol(XFA_Element eElement, int index, - FX_BOOL bAbbr) const; + bool bAbbr) const; CXFA_Node* const m_pLocale; }; diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index b7f0fbea59..74565a7ea0 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1048,7 +1048,7 @@ static std::unique_ptr<IFX_Locale> XFA_GetLocaleFromBuffer(const uint8_t* pBuf, std::unique_ptr<CXML_Element> pLocale; uint8_t* pOut = nullptr; uint32_t dwSize; - pCodecMgr->GetFlateModule()->FlateOrLZWDecode(FALSE, pBuf, nBufLen, TRUE, 0, + pCodecMgr->GetFlateModule()->FlateOrLZWDecode(false, pBuf, nBufLen, true, 0, 0, 0, 0, 0, pOut, dwSize); if (pOut) { pLocale.reset(CXML_Element::Parse(pOut, dwSize)); @@ -1237,7 +1237,7 @@ CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { pCommon ? pCommon->GetFirstChildByClass(XFA_Element::Locale) : nullptr; if (pLocale) { - pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, FALSE); + pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, false); } } m_dwLocaleFlags |= 0x01; diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index 27f3b0cf3f..b662121230 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -31,12 +31,12 @@ static const FX_DOUBLE fraction_scales[] = {0.1, 0.0000000000000001}; CXFA_LocaleValue::CXFA_LocaleValue() { m_dwType = XFA_VT_NULL; - m_bValid = TRUE; + m_bValid = true; m_pLocaleMgr = nullptr; } CXFA_LocaleValue::CXFA_LocaleValue(const CXFA_LocaleValue& value) { m_dwType = XFA_VT_NULL; - m_bValid = TRUE; + m_bValid = true; m_pLocaleMgr = nullptr; *this = value; } @@ -60,7 +60,7 @@ CXFA_LocaleValue::CXFA_LocaleValue(uint32_t dwType, IFX_Locale* pLocale, CXFA_LocaleMgr* pLocaleMgr) { m_pLocaleMgr = pLocaleMgr; - m_bValid = TRUE; + m_bValid = true; m_dwType = dwType; m_bValid = ParsePatternValue(wsValue, wsFormat, pLocale); } @@ -93,10 +93,10 @@ static FX_LOCALECATEGORY XFA_ValugeCategory(FX_LOCALECATEGORY eCategory, } return eCategory; } -FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, - const CFX_WideString& wsPattern, - IFX_Locale* pLocale, - CFX_WideString* pMatchFormat) { +bool CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, + const CFX_WideString& wsPattern, + IFX_Locale* pLocale, + CFX_WideString* pMatchFormat) { CFX_WideString wsOutput; IFX_Locale* locale = m_pLocaleMgr->GetDefLocale(); if (pLocale) { @@ -104,11 +104,11 @@ FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, } CFX_FormatString* pFormat = nullptr; if (m_pLocaleMgr) - pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE); + pFormat = new CFX_FormatString(m_pLocaleMgr, false); CFX_WideStringArray wsPatterns; pFormat->SplitFormatString(wsPattern, wsPatterns); - FX_BOOL bRet = FALSE; + bool bRet = false; int32_t iCount = wsPatterns.GetSize(); int32_t i = 0; for (; i < iCount && !bRet; i++) { @@ -177,7 +177,7 @@ FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, break; } default: - bRet = FALSE; + bRet = false; break; } } @@ -214,7 +214,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const { uint32_t dwFractional = 0; int32_t nExponent = 0; int cc = 0; - FX_BOOL bNegative = FALSE, bExpSign = FALSE; + bool bNegative = false, bExpSign = false; const FX_WCHAR* str = m_wsValue.c_str(); int len = m_wsValue.GetLength(); while (FXSYS_iswspace(str[cc]) && cc < len) { @@ -226,7 +226,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const { if (str[0] == '+') { cc++; } else if (str[0] == '-') { - bNegative = TRUE; + bNegative = true; cc++; } int nIntegralLen = 0; @@ -261,7 +261,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const { if (str[cc] == '+') { cc++; } else if (str[cc] == '-') { - bExpSign = TRUE; + bExpSign = true; cc++; } } @@ -290,7 +290,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const { uint32_t dwFractional = 0; int32_t nExponent = 0; int32_t cc = 0; - FX_BOOL bNegative = FALSE, bExpSign = FALSE; + bool bNegative = false, bExpSign = false; const FX_WCHAR* str = m_wsValue.c_str(); int len = m_wsValue.GetLength(); while (FXSYS_iswspace(str[cc]) && cc < len) { @@ -302,7 +302,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const { if (str[0] == '+') { cc++; } else if (str[0] == '-') { - bNegative = TRUE; + bNegative = true; cc++; } int32_t nIntegralLen = 0; @@ -337,7 +337,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const { if (str[cc] == '+') { cc++; } else if (str[cc] == '-') { - bExpSign = TRUE; + bExpSign = true; cc++; } } @@ -390,40 +390,40 @@ CFX_Unitime CXFA_LocaleValue::GetDateTime() const { } return CFX_Unitime(); } -FX_BOOL CXFA_LocaleValue::SetText(const CFX_WideString& wsText) { +bool CXFA_LocaleValue::SetText(const CFX_WideString& wsText) { m_dwType = XFA_VT_TEXT; m_wsValue = wsText; - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::SetText(const CFX_WideString& wsText, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale) { +bool CXFA_LocaleValue::SetText(const CFX_WideString& wsText, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale) { m_dwType = XFA_VT_TEXT; return m_bValid = ParsePatternValue(wsText, wsFormat, pLocale); } -FX_BOOL CXFA_LocaleValue::SetNum(FX_FLOAT fNum) { +bool CXFA_LocaleValue::SetNum(FX_FLOAT fNum) { m_dwType = XFA_VT_FLOAT; m_wsValue.Format(L"%.8g", (FX_DOUBLE)fNum); - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::SetNum(const CFX_WideString& wsNum, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale) { +bool CXFA_LocaleValue::SetNum(const CFX_WideString& wsNum, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale) { m_dwType = XFA_VT_FLOAT; return m_bValid = ParsePatternValue(wsNum, wsFormat, pLocale); } -FX_BOOL CXFA_LocaleValue::SetDate(const CFX_Unitime& d) { +bool CXFA_LocaleValue::SetDate(const CFX_Unitime& d) { m_dwType = XFA_VT_DATE; m_wsValue.Format(L"%04d-%02d-%02d", d.GetYear(), d.GetMonth(), d.GetDay()); - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::SetDate(const CFX_WideString& wsDate, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale) { +bool CXFA_LocaleValue::SetDate(const CFX_WideString& wsDate, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale) { m_dwType = XFA_VT_DATE; return m_bValid = ParsePatternValue(wsDate, wsFormat, pLocale); } -FX_BOOL CXFA_LocaleValue::SetTime(const CFX_Unitime& t) { +bool CXFA_LocaleValue::SetTime(const CFX_Unitime& t) { m_dwType = XFA_VT_TIME; m_wsValue.Format(L"%02d:%02d:%02d", t.GetHour(), t.GetMinute(), t.GetSecond()); @@ -432,15 +432,15 @@ FX_BOOL CXFA_LocaleValue::SetTime(const CFX_Unitime& t) { wsTemp.Format(L"%:03d", t.GetMillisecond()); m_wsValue += wsTemp; } - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::SetTime(const CFX_WideString& wsTime, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale) { +bool CXFA_LocaleValue::SetTime(const CFX_WideString& wsTime, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale) { m_dwType = XFA_VT_TIME; return m_bValid = ParsePatternValue(wsTime, wsFormat, pLocale); } -FX_BOOL CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) { +bool CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) { m_dwType = XFA_VT_DATETIME; m_wsValue.Format(L"%04d-%02d-%02dT%02d:%02d:%02d", dt.GetYear(), dt.GetMonth(), dt.GetDay(), dt.GetHour(), dt.GetMinute(), @@ -450,24 +450,24 @@ FX_BOOL CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) { wsTemp.Format(L"%:03d", dt.GetMillisecond()); m_wsValue += wsTemp; } - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::SetDateTime(const CFX_WideString& wsDateTime, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale) { +bool CXFA_LocaleValue::SetDateTime(const CFX_WideString& wsDateTime, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale) { m_dwType = XFA_VT_DATETIME; return m_bValid = ParsePatternValue(wsDateTime, wsFormat, pLocale); } -FX_BOOL CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale, - XFA_VALUEPICTURE eValueType) const { +bool CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale, + XFA_VALUEPICTURE eValueType) const { wsResult.clear(); - FX_BOOL bRet = FALSE; + bool bRet = false; CFX_FormatString* pFormat = nullptr; if (m_pLocaleMgr) - pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE); + pFormat = new CFX_FormatString(m_pLocaleMgr, false); CFX_WideStringArray wsPatterns; pFormat->SplitFormatString(wsFormat, wsPatterns); @@ -481,21 +481,20 @@ FX_BOOL CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult, pFormat->Release(); return bRet; } -FX_BOOL CXFA_LocaleValue::FormatSinglePattern( - CFX_WideString& wsResult, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale, - XFA_VALUEPICTURE eValueType) const { +bool CXFA_LocaleValue::FormatSinglePattern(CFX_WideString& wsResult, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale, + XFA_VALUEPICTURE eValueType) const { IFX_Locale* locale = m_pLocaleMgr->GetDefLocale(); if (pLocale) { m_pLocaleMgr->SetDefLocale(pLocale); } wsResult.clear(); - FX_BOOL bRet = FALSE; + bool bRet = false; CFX_FormatString* pFormat = nullptr; if (m_pLocaleMgr) - pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE); + pFormat = new CFX_FormatString(m_pLocaleMgr, false); FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat); eCategory = XFA_ValugeCategory(eCategory, m_dwType); @@ -530,7 +529,7 @@ FX_BOOL CXFA_LocaleValue::FormatSinglePattern( break; default: wsResult = m_wsValue; - bRet = TRUE; + bRet = true; } pFormat->Release(); if (!bRet && (eCategory != FX_LOCALECATEGORY_Num || @@ -542,13 +541,13 @@ FX_BOOL CXFA_LocaleValue::FormatSinglePattern( } return bRet; } -static FX_BOOL XFA_ValueSplitDateTime(const CFX_WideString& wsDateTime, - CFX_WideString& wsDate, - CFX_WideString& wsTime) { +static bool XFA_ValueSplitDateTime(const CFX_WideString& wsDateTime, + CFX_WideString& wsDate, + CFX_WideString& wsTime) { wsDate = L""; wsTime = L""; if (wsDateTime.IsEmpty()) { - return FALSE; + return false; } int nSplitIndex = -1; nSplitIndex = wsDateTime.Find('T'); @@ -556,58 +555,58 @@ static FX_BOOL XFA_ValueSplitDateTime(const CFX_WideString& wsDateTime, nSplitIndex = wsDateTime.Find(' '); } if (nSplitIndex < 0) { - return FALSE; + return false; } wsDate = wsDateTime.Left(nSplitIndex); wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1); - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::ValidateCanonicalValue(const CFX_WideString& wsValue, - uint32_t dwVType) { +bool CXFA_LocaleValue::ValidateCanonicalValue(const CFX_WideString& wsValue, + uint32_t dwVType) { if (wsValue.IsEmpty()) { - return TRUE; + return true; } CFX_Unitime dt; switch (dwVType) { case XFA_VT_DATE: { if (ValidateCanonicalDate(wsValue, dt)) { - return TRUE; + return true; } CFX_WideString wsDate, wsTime; if (XFA_ValueSplitDateTime(wsValue, wsDate, wsTime) && ValidateCanonicalDate(wsDate, dt)) { - return TRUE; + return true; } - return FALSE; + return false; } case XFA_VT_TIME: { if (ValidateCanonicalTime(wsValue)) { - return TRUE; + return true; } CFX_WideString wsDate, wsTime; if (XFA_ValueSplitDateTime(wsValue, wsDate, wsTime) && ValidateCanonicalTime(wsTime)) { - return TRUE; + return true; } - return FALSE; + return false; } case XFA_VT_DATETIME: { CFX_WideString wsDate, wsTime; if (XFA_ValueSplitDateTime(wsValue, wsDate, wsTime) && ValidateCanonicalDate(wsDate, dt) && ValidateCanonicalTime(wsTime)) { - return TRUE; + return true; } } break; } - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate, - CFX_Unitime& unDate) { +bool CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate, + CFX_Unitime& unDate) { const uint16_t LastDay[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; const uint16_t wCountY = 4, wCountM = 2, wCountD = 2; int nLen = wsDate.GetLength(); if (nLen < wCountY || nLen > wCountY + wCountM + wCountD + 2) { - return FALSE; + return false; } const bool bSymbol = wsDate.Find(0x2D) != -1; uint16_t wYear = 0; @@ -617,79 +616,79 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate, int nIndex = 0, nStart = 0; while (pDate[nIndex] != '\0' && nIndex < wCountY) { if (!FXSYS_isDecimalDigit(pDate[nIndex])) { - return FALSE; + return false; } wYear = (pDate[nIndex] - '0') + wYear * 10; nIndex++; } if (bSymbol) { if (pDate[nIndex] != 0x2D) { - return FALSE; + return false; } nIndex++; } nStart = nIndex; while (pDate[nIndex] != '\0' && nIndex - nStart < wCountM && nIndex < nLen) { if (!FXSYS_isDecimalDigit(pDate[nIndex])) { - return FALSE; + return false; } wMonth = (pDate[nIndex] - '0') + wMonth * 10; nIndex++; } if (bSymbol) { if (pDate[nIndex] != 0x2D) { - return FALSE; + return false; } nIndex++; } nStart = nIndex; while (pDate[nIndex] != '\0' && nIndex - nStart < wCountD && nIndex < nLen) { if (!FXSYS_isDecimalDigit(pDate[nIndex])) { - return FALSE; + return false; } wDay = (pDate[nIndex] - '0') + wDay * 10; nIndex++; } if (nIndex != nLen) { - return FALSE; + return false; } if (wYear < 1900 || wYear > 2029) { - return FALSE; + return false; } if (wMonth < 1 || wMonth > 12) { if (wMonth == 0 && nLen == wCountY) { - return TRUE; + return true; } - return FALSE; + return false; } if (wDay < 1) { if (wDay == 0 && (nLen == wCountY + wCountM)) { - return TRUE; + return true; } - return FALSE; + return false; } if (wMonth == 2) { if (wYear % 400 == 0 || (wYear % 100 != 0 && wYear % 4 == 0)) { if (wDay > 29) { - return FALSE; + return false; } } else { if (wDay > 28) { - return FALSE; + return false; } } } else if (wDay > LastDay[wMonth - 1]) { - return FALSE; + return false; } CFX_Unitime ut; ut.Set(wYear, static_cast<uint8_t>(wMonth), static_cast<uint8_t>(wDay)); unDate = unDate + ut; - return TRUE; + return true; } -FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) { +bool CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) { int nLen = wsTime.GetLength(); if (nLen < 2) - return FALSE; + return false; const uint16_t wCountH = 2; const uint16_t wCountM = 2; const uint16_t wCountS = 2; @@ -704,42 +703,42 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) { int nStart = 0; while (nIndex - nStart < wCountH && pTime[nIndex]) { if (!FXSYS_isDecimalDigit(pTime[nIndex])) - return FALSE; + return false; wHour = pTime[nIndex] - '0' + wHour * 10; nIndex++; } if (bSymbol) { if (nIndex < nLen && pTime[nIndex] != ':') - return FALSE; + return false; nIndex++; } nStart = nIndex; while (nIndex - nStart < wCountM && nIndex < nLen && pTime[nIndex]) { if (!FXSYS_isDecimalDigit(pTime[nIndex])) - return FALSE; + return false; wMinute = pTime[nIndex] - '0' + wMinute * 10; nIndex++; } if (bSymbol) { if (nIndex < nLen && pTime[nIndex] != ':') - return FALSE; + return false; nIndex++; } nStart = nIndex; while (nIndex - nStart < wCountS && nIndex < nLen && pTime[nIndex]) { if (!FXSYS_isDecimalDigit(pTime[nIndex])) - return FALSE; + return false; wSecond = pTime[nIndex] - '0' + wSecond * 10; nIndex++; } if (wsTime.Find('.') > 0) { if (pTime[nIndex] != '.') - return FALSE; + return false; nIndex++; nStart = nIndex; while (nIndex - nStart < wCountF && nIndex < nLen && pTime[nIndex]) { if (!FXSYS_isDecimalDigit(pTime[nIndex])) - return FALSE; + return false; wFraction = pTime[nIndex] - '0' + wFraction * 10; nIndex++; } @@ -754,34 +753,34 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) { nStart = nIndex; while (nIndex - nStart < wCountH && nIndex < nLen && pTime[nIndex]) { if (!FXSYS_isDecimalDigit(pTime[nIndex])) - return FALSE; + return false; nOffsetH = pTime[nIndex] - '0' + nOffsetH * 10; nIndex++; } if (bSymbol) { if (nIndex < nLen && pTime[nIndex] != ':') - return FALSE; + return false; nIndex++; } nStart = nIndex; while (nIndex - nStart < wCountM && nIndex < nLen && pTime[nIndex]) { if (!FXSYS_isDecimalDigit(pTime[nIndex])) - return FALSE; + return false; nOffsetM = pTime[nIndex] - '0' + nOffsetM * 10; nIndex++; } if (nOffsetH > 12 || nOffsetM >= 60) - return FALSE; + return false; } } return nIndex == nLen && wHour < 24 && wMinute < 60 && wSecond < 60 && wFraction <= 999; } -FX_BOOL CXFA_LocaleValue::ValidateCanonicalDateTime( +bool CXFA_LocaleValue::ValidateCanonicalDateTime( const CFX_WideString& wsDateTime) { CFX_WideString wsDate, wsTime; if (wsDateTime.IsEmpty()) { - return FALSE; + return false; } int nSplitIndex = -1; nSplitIndex = wsDateTime.Find('T'); @@ -789,16 +788,16 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalDateTime( nSplitIndex = wsDateTime.Find(' '); } if (nSplitIndex < 0) { - return FALSE; + return false; } wsDate = wsDateTime.Left(nSplitIndex); wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1); CFX_Unitime dt; return ValidateCanonicalDate(wsDate, dt) && ValidateCanonicalTime(wsTime); } -FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, - const CFX_WideString& wsPattern, - IFX_Locale* pLocale) { +bool CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, + const CFX_WideString& wsPattern, + IFX_Locale* pLocale) { IFX_Locale* locale = m_pLocaleMgr->GetDefLocale(); if (pLocale) { m_pLocaleMgr->SetDefLocale(pLocale); @@ -806,11 +805,11 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, CFX_FormatString* pFormat = nullptr; if (m_pLocaleMgr) - pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE); + pFormat = new CFX_FormatString(m_pLocaleMgr, false); CFX_WideStringArray wsPatterns; pFormat->SplitFormatString(wsPattern, wsPatterns); - FX_BOOL bRet = FALSE; + bool bRet = false; int32_t iCount = wsPatterns.GetSize(); for (int32_t i = 0; i < iCount && !bRet; i++) { CFX_WideString wsFormat = wsPatterns[i]; @@ -872,7 +871,7 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, } default: m_wsValue = wsValue; - bRet = TRUE; + bRet = true; break; } } @@ -888,7 +887,7 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString& wsFormat, int32_t nIntLen, int32_t nDecLen, - FX_BOOL bSign) { + bool bSign) { ASSERT(wsFormat.IsEmpty()); ASSERT(nIntLen >= -1 && nDecLen >= -1); int32_t nTotalLen = (nIntLen >= 0 ? nIntLen : 2) + (bSign ? 1 : 0) + @@ -921,12 +920,12 @@ void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString& wsFormat, } wsFormat.ReleaseBuffer(nTotalLen); } -FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, - CFX_WideString& wsFormat, - IFX_Locale* pLocale, - int32_t* pos) { +bool CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, + CFX_WideString& wsFormat, + IFX_Locale* pLocale, + int32_t* pos) { if (wsFormat.IsEmpty() || wsNumeric.IsEmpty()) { - return TRUE; + return true; } const FX_WCHAR* pNum = wsNumeric.c_str(); const FX_WCHAR* pFmt = wsFormat.c_str(); @@ -939,27 +938,27 @@ FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, } ++nf; } - FX_BOOL bLimit = TRUE; + bool bLimit = true; int32_t nCount = wsNumeric.GetLength(); int32_t nCountFmt = wsFormat.GetLength(); - while (n < nCount && (bLimit ? nf < nCountFmt : TRUE) && + while (n < nCount && (bLimit ? nf < nCountFmt : true) && FXSYS_isDecimalDigit(c = pNum[n])) { - if (bLimit == TRUE) { + if (bLimit == true) { if ((cf = pFmt[nf]) == L'*') { - bLimit = FALSE; + bLimit = false; } else if (cf == L'z') { nf++; } else { - return FALSE; + return false; } } n++; } if (n == nCount) { - return TRUE; + return true; } if (nf == nCountFmt) { - return FALSE; + return false; } while (nf < nCountFmt && (cf = pFmt[nf]) != L'.') { ASSERT(cf == L'z' || cf == L'*'); @@ -972,23 +971,23 @@ FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, wsDecimalSymbol = CFX_WideString(L'.'); } if (pFmt[nf] != L'.') { - return FALSE; + return false; } if (wsDecimalSymbol != CFX_WideStringC(c) && c != L'.') { - return FALSE; + return false; } ++nf; ++n; - bLimit = TRUE; - while (n < nCount && (bLimit ? nf < nCountFmt : TRUE) && + bLimit = true; + while (n < nCount && (bLimit ? nf < nCountFmt : true) && FXSYS_isDecimalDigit(c = pNum[n])) { - if (bLimit == TRUE) { + if (bLimit == true) { if ((cf = pFmt[nf]) == L'*') { - bLimit = FALSE; + bLimit = false; } else if (cf == L'z') { nf++; } else { - return FALSE; + return false; } } n++; diff --git a/xfa/fxfa/parser/xfa_localevalue.h b/xfa/fxfa/parser/xfa_localevalue.h index f278c07105..dbc3513a3f 100644 --- a/xfa/fxfa/parser/xfa_localevalue.h +++ b/xfa/fxfa/parser/xfa_localevalue.h @@ -41,32 +41,30 @@ class CXFA_LocaleValue { ~CXFA_LocaleValue(); CXFA_LocaleValue& operator=(const CXFA_LocaleValue& value); - FX_BOOL ValidateValue(const CFX_WideString& wsValue, - const CFX_WideString& wsPattern, - IFX_Locale* pLocale, - CFX_WideString* pMatchFormat = nullptr); - FX_BOOL FormatPatterns(CFX_WideString& wsResult, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale, - XFA_VALUEPICTURE eValueType) const; - FX_BOOL FormatSinglePattern(CFX_WideString& wsResult, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale, - XFA_VALUEPICTURE eValueType) const; - FX_BOOL ValidateCanonicalValue(const CFX_WideString& wsValue, - uint32_t dwVType); - FX_BOOL ValidateCanonicalDate(const CFX_WideString& wsDate, - CFX_Unitime& unDate); - FX_BOOL ValidateCanonicalTime(const CFX_WideString& wsTime); - FX_BOOL ValidateCanonicalDateTime(const CFX_WideString& wsDateTime); + bool ValidateValue(const CFX_WideString& wsValue, + const CFX_WideString& wsPattern, + IFX_Locale* pLocale, + CFX_WideString* pMatchFormat = nullptr); + bool FormatPatterns(CFX_WideString& wsResult, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale, + XFA_VALUEPICTURE eValueType) const; + bool FormatSinglePattern(CFX_WideString& wsResult, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale, + XFA_VALUEPICTURE eValueType) const; + bool ValidateCanonicalValue(const CFX_WideString& wsValue, uint32_t dwVType); + bool ValidateCanonicalDate(const CFX_WideString& wsDate, CFX_Unitime& unDate); + bool ValidateCanonicalTime(const CFX_WideString& wsTime); + bool ValidateCanonicalDateTime(const CFX_WideString& wsDateTime); void GetNumbericFormat(CFX_WideString& wsFormat, int32_t nIntLen, int32_t nDecLen, - FX_BOOL bSign = TRUE); - FX_BOOL ValidateNumericTemp(CFX_WideString& wsNumeric, - CFX_WideString& wsFormat, - IFX_Locale* pLocale = nullptr, - int32_t* pos = nullptr); + bool bSign = true); + bool ValidateNumericTemp(CFX_WideString& wsNumeric, + CFX_WideString& wsFormat, + IFX_Locale* pLocale = nullptr, + int32_t* pos = nullptr); CFX_WideString GetValue() const; uint32_t GetType() const; @@ -77,38 +75,38 @@ class CXFA_LocaleValue { CFX_Unitime GetDate() const; CFX_Unitime GetTime() const; CFX_Unitime GetDateTime() const; - FX_BOOL SetText(const CFX_WideString& wsText); - FX_BOOL SetText(const CFX_WideString& wsText, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale); - FX_BOOL SetNum(FX_FLOAT fNum); - FX_BOOL SetNum(const CFX_WideString& wsNum, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale); - FX_BOOL SetDate(const CFX_Unitime& d); - FX_BOOL SetDate(const CFX_WideString& wsDate, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale); - FX_BOOL SetTime(const CFX_Unitime& t); - FX_BOOL SetTime(const CFX_WideString& wsTime, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale); - FX_BOOL SetDateTime(const CFX_Unitime& dt); - FX_BOOL SetDateTime(const CFX_WideString& wsDateTime, - const CFX_WideString& wsFormat, - IFX_Locale* pLocale); + bool SetText(const CFX_WideString& wsText); + bool SetText(const CFX_WideString& wsText, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale); + bool SetNum(FX_FLOAT fNum); + bool SetNum(const CFX_WideString& wsNum, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale); + bool SetDate(const CFX_Unitime& d); + bool SetDate(const CFX_WideString& wsDate, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale); + bool SetTime(const CFX_Unitime& t); + bool SetTime(const CFX_WideString& wsTime, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale); + bool SetDateTime(const CFX_Unitime& dt); + bool SetDateTime(const CFX_WideString& wsDateTime, + const CFX_WideString& wsFormat, + IFX_Locale* pLocale); bool IsNull() const { return m_dwType == XFA_VT_NULL; } - FX_BOOL IsEmpty() const { return m_wsValue.IsEmpty(); } - FX_BOOL IsValid() const { return m_bValid; } + bool IsEmpty() const { return m_wsValue.IsEmpty(); } + bool IsValid() const { return m_bValid; } protected: - FX_BOOL ParsePatternValue(const CFX_WideString& wsValue, - const CFX_WideString& wsPattern, - IFX_Locale* pLocale); + bool ParsePatternValue(const CFX_WideString& wsValue, + const CFX_WideString& wsPattern, + IFX_Locale* pLocale); CXFA_LocaleMgr* m_pLocaleMgr; CFX_WideString m_wsValue; uint32_t m_dwType; - FX_BOOL m_bValid; + bool m_bValid; }; #endif // XFA_FXFA_PARSER_XFA_LOCALEVALUE_H_ diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h index 5056f59d9c..c3686ac076 100644 --- a/xfa/fxfa/parser/xfa_object.h +++ b/xfa/fxfa/parser/xfa_object.h @@ -88,7 +88,7 @@ class CXFA_Object : public CFXJSE_HostObject { CFX_WideStringC GetClassName() const; uint32_t GetClassHashCode() const; void Script_ObjectClass_ClassName(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void ThrowException(int32_t iStringID, ...); @@ -168,137 +168,131 @@ class CXFA_Node : public CXFA_Object { } bool NeedsInitApp() const { return HasFlag(XFA_NodeFlag_NeedsInitApp); } - FX_BOOL IsAttributeInXML(); + bool IsAttributeInXML(); bool IsFormContainer() const { return m_ePacket == XFA_XDPPACKET_Form && IsContainerNode(); } void SetXMLMappingNode(CFDE_XMLNode* pXMLNode) { m_pXMLNode = pXMLNode; } CFDE_XMLNode* GetXMLMappingNode() const { return m_pXMLNode; } CFDE_XMLNode* CreateXMLMappingNode(); - FX_BOOL IsNeedSavingXMLNode(); + bool IsNeedSavingXMLNode(); uint32_t GetNameHash() const { return m_dwNameHash; } bool IsUnnamed() const { return m_dwNameHash == 0; } CXFA_Node* GetModelNode(); void UpdateNameHash(); - FX_BOOL HasAttribute(XFA_ATTRIBUTE eAttr, FX_BOOL bCanInherit = FALSE); - FX_BOOL SetAttribute(XFA_ATTRIBUTE eAttr, - const CFX_WideStringC& wsValue, - bool bNotify = false); - FX_BOOL GetAttribute(XFA_ATTRIBUTE eAttr, - CFX_WideString& wsValue, - FX_BOOL bUseDefault = TRUE); - FX_BOOL SetAttribute(const CFX_WideStringC& wsAttr, - const CFX_WideStringC& wsValue, - bool bNotify = false); - FX_BOOL GetAttribute(const CFX_WideStringC& wsAttr, - CFX_WideString& wsValue, - FX_BOOL bUseDefault = TRUE); - FX_BOOL RemoveAttribute(const CFX_WideStringC& wsAttr); - FX_BOOL SetContent(const CFX_WideString& wsContent, - const CFX_WideString& wsXMLValue, - bool bNotify = false, - FX_BOOL bScriptModify = FALSE, - FX_BOOL bSyncData = TRUE); - FX_BOOL TryContent(CFX_WideString& wsContent, - FX_BOOL bScriptModify = FALSE, - FX_BOOL bProto = TRUE); + bool HasAttribute(XFA_ATTRIBUTE eAttr, bool bCanInherit = false); + bool SetAttribute(XFA_ATTRIBUTE eAttr, + const CFX_WideStringC& wsValue, + bool bNotify = false); + bool GetAttribute(XFA_ATTRIBUTE eAttr, + CFX_WideString& wsValue, + bool bUseDefault = true); + bool SetAttribute(const CFX_WideStringC& wsAttr, + const CFX_WideStringC& wsValue, + bool bNotify = false); + bool GetAttribute(const CFX_WideStringC& wsAttr, + CFX_WideString& wsValue, + bool bUseDefault = true); + bool RemoveAttribute(const CFX_WideStringC& wsAttr); + bool SetContent(const CFX_WideString& wsContent, + const CFX_WideString& wsXMLValue, + bool bNotify = false, + bool bScriptModify = false, + bool bSyncData = true); + bool TryContent(CFX_WideString& wsContent, + bool bScriptModify = false, + bool bProto = true); CFX_WideString GetContent(); - FX_BOOL TryNamespace(CFX_WideString& wsNamespace); + bool TryNamespace(CFX_WideString& wsNamespace); - FX_BOOL SetBoolean(XFA_ATTRIBUTE eAttr, - FX_BOOL bValue, - bool bNotify = false) { + bool SetBoolean(XFA_ATTRIBUTE eAttr, bool bValue, bool bNotify = false) { return SetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, (void*)(uintptr_t)bValue, bNotify); } - FX_BOOL TryBoolean(XFA_ATTRIBUTE eAttr, - FX_BOOL& bValue, - FX_BOOL bUseDefault = TRUE); - FX_BOOL GetBoolean(XFA_ATTRIBUTE eAttr) { - FX_BOOL bValue; - return TryBoolean(eAttr, bValue, TRUE) ? bValue : FALSE; + bool TryBoolean(XFA_ATTRIBUTE eAttr, bool& bValue, bool bUseDefault = true); + bool GetBoolean(XFA_ATTRIBUTE eAttr) { + bool bValue; + return TryBoolean(eAttr, bValue, true) ? bValue : false; } - FX_BOOL SetInteger(XFA_ATTRIBUTE eAttr, - int32_t iValue, - bool bNotify = false) { + bool SetInteger(XFA_ATTRIBUTE eAttr, int32_t iValue, bool bNotify = false) { return SetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, (void*)(uintptr_t)iValue, bNotify); } - FX_BOOL TryInteger(XFA_ATTRIBUTE eAttr, - int32_t& iValue, - FX_BOOL bUseDefault = TRUE); + bool TryInteger(XFA_ATTRIBUTE eAttr, + int32_t& iValue, + bool bUseDefault = true); int32_t GetInteger(XFA_ATTRIBUTE eAttr) { int32_t iValue; - return TryInteger(eAttr, iValue, TRUE) ? iValue : 0; + return TryInteger(eAttr, iValue, true) ? iValue : 0; } - FX_BOOL SetEnum(XFA_ATTRIBUTE eAttr, - XFA_ATTRIBUTEENUM eValue, - bool bNotify = false) { + bool SetEnum(XFA_ATTRIBUTE eAttr, + XFA_ATTRIBUTEENUM eValue, + bool bNotify = false) { return SetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, (void*)(uintptr_t)eValue, bNotify); } - FX_BOOL TryEnum(XFA_ATTRIBUTE eAttr, - XFA_ATTRIBUTEENUM& eValue, - FX_BOOL bUseDefault = TRUE); + bool TryEnum(XFA_ATTRIBUTE eAttr, + XFA_ATTRIBUTEENUM& eValue, + bool bUseDefault = true); XFA_ATTRIBUTEENUM GetEnum(XFA_ATTRIBUTE eAttr) { XFA_ATTRIBUTEENUM eValue; - return TryEnum(eAttr, eValue, TRUE) ? eValue : XFA_ATTRIBUTEENUM_Unknown; + return TryEnum(eAttr, eValue, true) ? eValue : XFA_ATTRIBUTEENUM_Unknown; } - FX_BOOL SetCData(XFA_ATTRIBUTE eAttr, - const CFX_WideString& wsValue, - bool bNotify = false, - FX_BOOL bScriptModify = FALSE); - FX_BOOL SetAttributeValue(const CFX_WideString& wsValue, - const CFX_WideString& wsXMLValue, - bool bNotify = false, - FX_BOOL bScriptModify = FALSE); - FX_BOOL TryCData(XFA_ATTRIBUTE eAttr, - CFX_WideString& wsValue, - FX_BOOL bUseDefault = TRUE, - FX_BOOL bProto = TRUE); - FX_BOOL TryCData(XFA_ATTRIBUTE eAttr, - CFX_WideStringC& wsValue, - FX_BOOL bUseDefault = TRUE, - FX_BOOL bProto = TRUE); + bool SetCData(XFA_ATTRIBUTE eAttr, + const CFX_WideString& wsValue, + bool bNotify = false, + bool bScriptModify = false); + bool SetAttributeValue(const CFX_WideString& wsValue, + const CFX_WideString& wsXMLValue, + bool bNotify = false, + bool bScriptModify = false); + bool TryCData(XFA_ATTRIBUTE eAttr, + CFX_WideString& wsValue, + bool bUseDefault = true, + bool bProto = true); + bool TryCData(XFA_ATTRIBUTE eAttr, + CFX_WideStringC& wsValue, + bool bUseDefault = true, + bool bProto = true); CFX_WideStringC GetCData(XFA_ATTRIBUTE eAttr) { CFX_WideStringC wsValue; return TryCData(eAttr, wsValue) ? wsValue : CFX_WideStringC(); } - FX_BOOL SetMeasure(XFA_ATTRIBUTE eAttr, - CXFA_Measurement mValue, - bool bNotify = false); - FX_BOOL TryMeasure(XFA_ATTRIBUTE eAttr, - CXFA_Measurement& mValue, - FX_BOOL bUseDefault = TRUE) const; + bool SetMeasure(XFA_ATTRIBUTE eAttr, + CXFA_Measurement mValue, + bool bNotify = false); + bool TryMeasure(XFA_ATTRIBUTE eAttr, + CXFA_Measurement& mValue, + bool bUseDefault = true) const; CXFA_Measurement GetMeasure(XFA_ATTRIBUTE eAttr) const; - FX_BOOL SetObject(XFA_ATTRIBUTE eAttr, - void* pData, - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); - FX_BOOL TryObject(XFA_ATTRIBUTE eAttr, void*& pData); + bool SetObject(XFA_ATTRIBUTE eAttr, + void* pData, + XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); + bool TryObject(XFA_ATTRIBUTE eAttr, void*& pData); void* GetObject(XFA_ATTRIBUTE eAttr) { void* pData; return TryObject(eAttr, pData) ? pData : nullptr; } - FX_BOOL SetUserData(void* pKey, - void* pData, - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); - FX_BOOL TryUserData(void* pKey, void*& pData, FX_BOOL bProtoAlso = FALSE); - void* GetUserData(void* pKey, FX_BOOL bProtoAlso = FALSE) { + bool SetUserData(void* pKey, + void* pData, + XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); + bool TryUserData(void* pKey, void*& pData, bool bProtoAlso = false); + void* GetUserData(void* pKey, bool bProtoAlso = false) { void* pData; return TryUserData(pKey, pData, bProtoAlso) ? pData : nullptr; } CXFA_Node* GetProperty(int32_t index, XFA_Element eType, - FX_BOOL bCreateProperty = TRUE); - int32_t CountChildren(XFA_Element eType, FX_BOOL bOnlyChild = FALSE); + bool bCreateProperty = true); + int32_t CountChildren(XFA_Element eType, bool bOnlyChild = false); CXFA_Node* GetChild(int32_t index, XFA_Element eType, - FX_BOOL bOnlyChild = FALSE); + bool bOnlyChild = false); int32_t InsertChild(int32_t index, CXFA_Node* pNode); - FX_BOOL InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode = nullptr); - FX_BOOL RemoveChild(CXFA_Node* pNode, bool bNotify = true); - CXFA_Node* Clone(FX_BOOL bRecursive); + bool InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode = nullptr); + bool RemoveChild(CXFA_Node* pNode, bool bNotify = true); + CXFA_Node* Clone(bool bRecursive); CXFA_Node* GetNodeItem(XFA_NODEITEM eItem) const; CXFA_Node* GetNodeItem(XFA_NODEITEM eItem, XFA_ObjectType eType) const; int32_t GetNodeList(CXFA_NodeArray& nodes, @@ -308,7 +302,7 @@ class CXFA_Node : public CXFA_Object { int32_t iLevel = 1); CXFA_Node* CreateSamePacketNode(XFA_Element eType, uint32_t dwFlags = XFA_NodeFlag_Initialized); - CXFA_Node* CloneTemplateToForm(FX_BOOL bRecursive); + CXFA_Node* CloneTemplateToForm(bool bRecursive); CXFA_Node* GetTemplateNode() const; void SetTemplateNode(CXFA_Node* pTemplateNode); CXFA_Node* GetDataDescriptionNode(); @@ -317,10 +311,10 @@ class CXFA_Node : public CXFA_Object { int32_t GetBindItems(CXFA_NodeArray& formItems); int32_t AddBindItem(CXFA_Node* pFormNode); int32_t RemoveBindItem(CXFA_Node* pFormNode); - FX_BOOL HasBindItem(); + bool HasBindItem(); CXFA_WidgetData* GetWidgetData(); CXFA_WidgetData* GetContainerWidgetData(); - FX_BOOL GetLocaleName(CFX_WideString& wsLocaleName); + bool GetLocaleName(CFX_WideString& wsLocaleName); XFA_ATTRIBUTEENUM GetIntact(); CXFA_Node* GetFirstChildByName(const CFX_WideStringC& wsNodeName) const; CXFA_Node* GetFirstChildByName(uint32_t dwNodeNameHash) const; @@ -341,25 +335,25 @@ class CXFA_Node : public CXFA_Object { uint32_t dwFlag, CXFA_Node* refNode = nullptr); void Script_TreeClass_All(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_TreeClass_Nodes(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_TreeClass_ClassAll(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_TreeClass_Parent(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_TreeClass_Index(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_TreeClass_ClassIndex(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_TreeClass_SomExpression(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments); void Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments); @@ -373,19 +367,19 @@ class CXFA_Node : public CXFA_Object { void Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments); void Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments); void Script_NodeClass_Ns(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_NodeClass_Model(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_NodeClass_IsContainer(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_NodeClass_IsNull(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_NodeClass_OneOfChild(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_ContainerClass_GetDelta(CFXJSE_Arguments* pArguments); void Script_ContainerClass_GetDeltas(CFXJSE_Arguments* pArguments); @@ -393,104 +387,104 @@ class CXFA_Node : public CXFA_Object { void Script_ModelClass_CreateNode(CFXJSE_Arguments* pArguments); void Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments); void Script_ModelClass_Context(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_ModelClass_AliasNode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments); void Script_Delta_Restore(CFXJSE_Arguments* pArguments); void Script_Delta_CurrentValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Delta_SavedValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Delta_Target(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Attribute_SendAttributeChangeMessage(XFA_ATTRIBUTE eAttribute, - FX_BOOL bScriptModify); + bool bScriptModify); void Script_Attribute_Integer(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Attribute_IntegerRead(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Attribute_BOOL(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Attribute_BOOLRead(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Attribute_String(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Attribute_StringRead(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_ValidationMessage(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_Length(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_DefaultValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_DefaultValue_Read(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Boolean_Value(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_Message(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_SOM_MESSAGETYPE iMessageType); void Script_Som_BorderColor(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_BorderWidth(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_FillColor(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_DataNode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_FontColor(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_Mandatory(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_MandatoryMessage(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Som_InstanceIndex(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Draw_DefaultValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_DefaultValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_EditValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_FormatMessage(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_FormattedValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_ParentSubform(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_SelectedIndex(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Field_ClearItems(CFXJSE_Arguments* pArguments); void Script_Field_ExecEvent(CFXJSE_Arguments* pArguments); @@ -506,13 +500,13 @@ class CXFA_Node : public CXFA_Object { void Script_Field_AddItem(CFXJSE_Arguments* pArguments); void Script_Field_ExecValidate(CFXJSE_Arguments* pArguments); void Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_ExclGroup_ErrorText(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_ExclGroup_Transient(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments); void Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments); @@ -520,10 +514,10 @@ class CXFA_Node : public CXFA_Object { void Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments); void Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments); void Script_Subform_InstanceManager(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Subform_Locale(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments); void Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments); @@ -541,13 +535,13 @@ class CXFA_Node : public CXFA_Object { void Script_Template_ExecValidate(CFXJSE_Arguments* pArguments); void Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments); void Script_InstanceManager_Count(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_InstanceManager_Max(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_InstanceManager_Min(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_InstanceManager_MoveInstance(CFXJSE_Arguments* pArguments); void Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArguments); @@ -557,10 +551,10 @@ class CXFA_Node : public CXFA_Object { int32_t InstanceManager_SetInstances(int32_t iCount); int32_t InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom); void Script_Occur_Max(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Occur_Min(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Desc_Metadata(CFXJSE_Arguments* pArguments); void Script_Form_FormNodes(CFXJSE_Arguments* pArguments); @@ -570,13 +564,13 @@ class CXFA_Node : public CXFA_Object { void Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments); void Script_Form_ExecValidate(CFXJSE_Arguments* pArguments); void Script_Form_Checksum(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments); void Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments); void Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments); void Script_Packet_Content(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Source_Next(CFXJSE_Arguments* pArguments); void Script_Source_CancelBatch(CFXJSE_Arguments* pArguments); @@ -596,25 +590,25 @@ class CXFA_Node : public CXFA_Object { void Script_Source_Last(CFXJSE_Arguments* pArguments); void Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments); void Script_Source_Db(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Xfa_This(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Handler_Version(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_SubmitFormat_Mode(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Extras_Type(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Encrypt_Format(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); void Script_Script_Stateless(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); protected: @@ -629,48 +623,48 @@ class CXFA_Node : public CXFA_Object { bool HasFlag(XFA_NodeFlag dwFlag) const; CXFA_Node* Deprecated_GetPrevSibling(); - FX_BOOL SetValue(XFA_ATTRIBUTE eAttr, - XFA_ATTRIBUTETYPE eType, - void* pValue, - bool bNotify); - FX_BOOL GetValue(XFA_ATTRIBUTE eAttr, - XFA_ATTRIBUTETYPE eType, - FX_BOOL bUseDefault, - void*& pValue); + bool SetValue(XFA_ATTRIBUTE eAttr, + XFA_ATTRIBUTETYPE eType, + void* pValue, + bool bNotify); + bool GetValue(XFA_ATTRIBUTE eAttr, + XFA_ATTRIBUTETYPE eType, + bool bUseDefault, + void*& pValue); void OnRemoved(bool bNotify); void OnChanging(XFA_ATTRIBUTE eAttr, bool bNotify); - void OnChanged(XFA_ATTRIBUTE eAttr, bool bNotify, FX_BOOL bScriptModify); + void OnChanged(XFA_ATTRIBUTE eAttr, bool bNotify, bool bScriptModify); int32_t execSingleEventByName(const CFX_WideStringC& wsEventName, XFA_Element eType); - FX_BOOL SetScriptContent(const CFX_WideString& wsContent, - const CFX_WideString& wsXMLValue, - bool bNotify = true, - FX_BOOL bScriptModify = FALSE, - FX_BOOL bSyncData = TRUE); - CFX_WideString GetScriptContent(FX_BOOL bScriptModify = FALSE); + bool SetScriptContent(const CFX_WideString& wsContent, + const CFX_WideString& wsXMLValue, + bool bNotify = true, + bool bScriptModify = false, + bool bSyncData = true); + CFX_WideString GetScriptContent(bool bScriptModify = false); XFA_MAPMODULEDATA* CreateMapModuleData(); XFA_MAPMODULEDATA* GetMapModuleData() const; void SetMapModuleValue(void* pKey, void* pValue); - FX_BOOL GetMapModuleValue(void* pKey, void*& pValue); + bool GetMapModuleValue(void* pKey, void*& pValue); void SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue); - FX_BOOL GetMapModuleString(void* pKey, CFX_WideStringC& wsValue); + bool GetMapModuleString(void* pKey, CFX_WideStringC& wsValue); void SetMapModuleBuffer( void* pKey, void* pValue, int32_t iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); - FX_BOOL GetMapModuleBuffer(void* pKey, - void*& pValue, - int32_t& iBytes, - FX_BOOL bProtoAlso = TRUE) const; - FX_BOOL HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso = FALSE); + bool GetMapModuleBuffer(void* pKey, + void*& pValue, + int32_t& iBytes, + bool bProtoAlso = true) const; + bool HasMapModuleKey(void* pKey, bool bProtoAlso = false); void RemoveMapModuleKey(void* pKey = nullptr); - void MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr = TRUE); + void MergeAllData(void* pDstModule, bool bUseSrcAttr = true); void MoveBufferMapData(CXFA_Node* pDstModule, void* pKey); void MoveBufferMapData(CXFA_Node* pSrcModule, CXFA_Node* pDstModule, void* pKey, - FX_BOOL bRecursive = FALSE); + bool bRecursive = false); CXFA_Node* m_pNext; CXFA_Node* m_pChild; @@ -704,9 +698,9 @@ class CXFA_NodeList : public CXFA_Object { CXFA_Node* NamedItem(const CFX_WideStringC& wsName); virtual int32_t GetLength() = 0; - virtual FX_BOOL Append(CXFA_Node* pNode) = 0; - virtual FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) = 0; - virtual FX_BOOL Remove(CXFA_Node* pNode) = 0; + virtual bool Append(CXFA_Node* pNode) = 0; + virtual bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) = 0; + virtual bool Remove(CXFA_Node* pNode) = 0; virtual CXFA_Node* Item(int32_t iIndex) = 0; void Script_ListClass_Append(CFXJSE_Arguments* pArguments); @@ -716,7 +710,7 @@ class CXFA_NodeList : public CXFA_Object { void Script_TreelistClass_NamedItem(CFXJSE_Arguments* pArguments); void Script_ListClass_Length(CFXJSE_Value* pValue, - FX_BOOL bSetting, + bool bSetting, XFA_ATTRIBUTE eAttribute); }; @@ -727,9 +721,9 @@ class CXFA_ArrayNodeList : public CXFA_NodeList { // From CXFA_NodeList. int32_t GetLength() override; - FX_BOOL Append(CXFA_Node* pNode) override; - FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override; - FX_BOOL Remove(CXFA_Node* pNode) override; + bool Append(CXFA_Node* pNode) override; + bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override; + bool Remove(CXFA_Node* pNode) override; CXFA_Node* Item(int32_t iIndex) override; void SetArrayNodeList(const CXFA_NodeArray& srcArray); @@ -744,9 +738,9 @@ class CXFA_AttachNodeList : public CXFA_NodeList { // From CXFA_NodeList. int32_t GetLength() override; - FX_BOOL Append(CXFA_Node* pNode) override; - FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override; - FX_BOOL Remove(CXFA_Node* pNode) override; + bool Append(CXFA_Node* pNode) override; + bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override; + bool Remove(CXFA_Node* pNode) override; CXFA_Node* Item(int32_t iIndex) override; protected: diff --git a/xfa/fxfa/parser/xfa_resolvenode_rs.h b/xfa/fxfa/parser/xfa_resolvenode_rs.h index 633d080876..2e7e297aea 100644 --- a/xfa/fxfa/parser/xfa_resolvenode_rs.h +++ b/xfa/fxfa/parser/xfa_resolvenode_rs.h @@ -47,7 +47,7 @@ struct XFA_RESOLVENODE_RS { for (int32_t i = 0; i < nodes.GetSize(); i++) { std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(pIsolate)); (nodes[i]->*(pScriptAttribute->lpfnCallback))( - pValue.get(), FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute); + pValue.get(), false, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute); valueArray.Add(pValue.release()); } } diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp index 3967784fe9..6f54c0e5fe 100644 --- a/xfa/fxfa/parser/xfa_utils.cpp +++ b/xfa/fxfa/parser/xfa_utils.cpp @@ -204,8 +204,8 @@ void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode, } } -FX_BOOL XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) { - FX_BOOL bRet = FALSE; +bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) { + bool bRet = false; if (!pFieldNode) return bRet; @@ -395,29 +395,29 @@ CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_Element eElement, return CXFA_Measurement(); } -FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue, - XFA_Element eElement, - XFA_ATTRIBUTE eAttribute, - XFA_ATTRIBUTETYPE eType, - uint32_t dwPacket) { +bool XFA_GetAttributeDefaultValue(void*& pValue, + XFA_Element eElement, + XFA_ATTRIBUTE eAttribute, + XFA_ATTRIBUTETYPE eType, + uint32_t dwPacket) { const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttribute); if (!pInfo) - return FALSE; + return false; if (dwPacket && (dwPacket & pInfo->dwPackets) == 0) - return FALSE; + return false; if (pInfo->eType == eType) { pValue = pInfo->pDefValue; - return TRUE; + return true; } if (pInfo->eType == XFA_ATTRIBUTETYPE_NOTSURE) { const XFA_NOTSUREATTRIBUTE* pAttr = XFA_GetNotsureAttribute(eElement, eAttribute, eType); if (pAttr) { pValue = pAttr->pValue; - return TRUE; + return true; } } - return FALSE; + return false; } const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName) { diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h index 90168604eb..9a84fd6f67 100644 --- a/xfa/fxfa/parser/xfa_utils.h +++ b/xfa/fxfa/parser/xfa_utils.h @@ -18,7 +18,7 @@ class CXFA_LocaleValue; class CXFA_Node; class CXFA_WidgetData; -FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( +bool XFA_FDEExtension_ResolveNamespaceQualifier( CFDE_XMLElement* pNode, const CFX_WideStringC& wsQualifier, CFX_WideString& wsNamespaceURI); @@ -32,24 +32,24 @@ class CXFA_NodeIteratorTemplate { m_NodeStack.Push(pRootNode); } } - FX_BOOL Init(NodeType* pRootNode) { + bool Init(NodeType* pRootNode) { if (!pRootNode) { - return FALSE; + return false; } m_pRoot = pRootNode; - m_NodeStack.RemoveAll(FALSE); + m_NodeStack.RemoveAll(false); m_NodeStack.Push(pRootNode); - return TRUE; + return true; } - void Clear() { m_NodeStack.RemoveAll(FALSE); } + void Clear() { m_NodeStack.RemoveAll(false); } void Reset() { Clear(); if (m_pRoot) { m_NodeStack.Push(m_pRoot); } } - FX_BOOL SetCurrent(NodeType* pCurNode) { - m_NodeStack.RemoveAll(FALSE); + bool SetCurrent(NodeType* pCurNode) { + m_NodeStack.RemoveAll(false); if (pCurNode) { CFX_StackTemplate<NodeType*> revStack(100); NodeType* pNode; @@ -58,7 +58,7 @@ class CXFA_NodeIteratorTemplate { revStack.Push(pNode); } if (!pNode) { - return FALSE; + return false; } revStack.Push(m_pRoot); while (revStack.GetSize()) { @@ -66,7 +66,7 @@ class CXFA_NodeIteratorTemplate { revStack.Pop(); } } - return TRUE; + return true; } NodeType* GetCurrent() const { return m_NodeStack.GetSize() ? *m_NodeStack.GetTopElement() : nullptr; @@ -94,7 +94,7 @@ class CXFA_NodeIteratorTemplate { } m_NodeStack.Push(pPrevItem); } else { - m_NodeStack.RemoveAll(FALSE); + m_NodeStack.RemoveAll(false); if (m_pRoot) { m_NodeStack.Push(m_pRoot); } @@ -166,16 +166,16 @@ CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData); FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal); int32_t XFA_MapRotation(int32_t nRotation); -FX_BOOL XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode); +bool XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode); void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode, CFX_WideString& wsPlainText); -FX_BOOL XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode); +bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode); void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode); void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, IFX_Stream* pStream, const FX_CHAR* pChecksum = nullptr, - FX_BOOL bSaveXML = FALSE); + bool bSaveXML = false); const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute( XFA_Element eElement, @@ -197,11 +197,11 @@ XFA_Element XFA_GetElementTypeForName(const CFX_WideStringC& wsName); CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_Element eElement, XFA_ATTRIBUTE eAttribute, uint32_t dwPacket); -FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue, - XFA_Element eElement, - XFA_ATTRIBUTE eAttribute, - XFA_ATTRIBUTETYPE eType, - uint32_t dwPacket); +bool XFA_GetAttributeDefaultValue(void*& pValue, + XFA_Element eElement, + XFA_ATTRIBUTE eAttribute, + XFA_ATTRIBUTETYPE eType, + uint32_t dwPacket); const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName); const XFA_ATTRIBUTEINFO* XFA_GetAttributeByID(XFA_ATTRIBUTE eName); const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByName( |