diff options
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_datamerger_imp.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 222 |
1 files changed, 110 insertions, 112 deletions
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); } |