summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-04 03:31:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-04 03:31:29 +0000
commit185832ce3665ddfe7c3c96b398a4f56ce3eacf62 (patch)
tree98d3bce032a949f5ef79b15b7545f5ed25d16af5 /xfa/fxfa/parser
parent33591752d2cb14f2e07726ca52afce6efbdc07c9 (diff)
downloadpdfium-185832ce3665ddfe7c3c96b398a4f56ce3eacf62.tar.xz
Remove default params for CXFA_Node::{Insert|Remove}Child
This CL removes the default values and inlines in the call sites as needed. Change-Id: I68925d57b6230400429421ce728dd5524e5fc9a1 Reviewed-on: https://pdfium-review.googlesource.com/17710 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/cxfa_attachnodelist.cpp8
-rw-r--r--xfa/fxfa/parser/cxfa_dataimporter.cpp8
-rw-r--r--xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp7
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.cpp6
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp12
-rw-r--r--xfa/fxfa/parser/cxfa_node.h4
-rw-r--r--xfa/fxfa/parser/cxfa_nodehelper.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.cpp26
-rw-r--r--xfa/fxfa/parser/cxfa_validate.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp6
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp34
11 files changed, 59 insertions, 58 deletions
diff --git a/xfa/fxfa/parser/cxfa_attachnodelist.cpp b/xfa/fxfa/parser/cxfa_attachnodelist.cpp
index 9c0b0fd18e..6340377d4d 100644
--- a/xfa/fxfa/parser/cxfa_attachnodelist.cpp
+++ b/xfa/fxfa/parser/cxfa_attachnodelist.cpp
@@ -23,21 +23,21 @@ int32_t CXFA_AttachNodeList::GetLength() {
bool CXFA_AttachNodeList::Append(CXFA_Node* pNode) {
CXFA_Node* pParent = pNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pParent)
- pParent->RemoveChild(pNode);
+ pParent->RemoveChild(pNode, true);
- return m_pAttachNode->InsertChild(pNode);
+ return m_pAttachNode->InsertChild(pNode, nullptr);
}
bool CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) {
CXFA_Node* pParent = pNewNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pParent)
- pParent->RemoveChild(pNewNode);
+ pParent->RemoveChild(pNewNode, true);
return m_pAttachNode->InsertChild(pNewNode, pBeforeNode);
}
bool CXFA_AttachNodeList::Remove(CXFA_Node* pNode) {
- return m_pAttachNode->RemoveChild(pNode);
+ return m_pAttachNode->RemoveChild(pNode, true);
}
CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) {
diff --git a/xfa/fxfa/parser/cxfa_dataimporter.cpp b/xfa/fxfa/parser/cxfa_dataimporter.cpp
index ab18f6182d..61daff3698 100644
--- a/xfa/fxfa/parser/cxfa_dataimporter.cpp
+++ b/xfa/fxfa/parser/cxfa_dataimporter.cpp
@@ -46,20 +46,20 @@ bool CXFA_DataImporter::ImportData(
CXFA_Node* pDataNode = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Data));
if (pDataNode)
- pDataModel->RemoveChild(pDataNode);
+ pDataModel->RemoveChild(pDataNode, true);
if (pImportDataRoot->GetElementType() == XFA_Element::DataModel) {
while (CXFA_Node* pChildNode =
pImportDataRoot->GetNodeItem(XFA_NODEITEM_FirstChild)) {
- pImportDataRoot->RemoveChild(pChildNode);
- pDataModel->InsertChild(pChildNode);
+ pImportDataRoot->RemoveChild(pChildNode, true);
+ pDataModel->InsertChild(pChildNode, nullptr);
}
} else {
CFX_XMLNode* pXMLNode = pImportDataRoot->GetXMLMappingNode();
CFX_XMLNode* pParentXMLNode = pXMLNode->GetNodeItem(CFX_XMLNode::Parent);
if (pParentXMLNode)
pParentXMLNode->RemoveChildNode(pXMLNode);
- pDataModel->InsertChild(pImportDataRoot);
+ pDataModel->InsertChild(pImportDataRoot, nullptr);
}
m_pDocument->DoDataRemerge(false);
return true;
diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
index 78ac13d816..f408ec4d58 100644
--- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
+++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
@@ -607,7 +607,8 @@ void DeleteLayoutGeneratedNode(CXFA_Node* pGenerateNode) {
pCurLayoutItem = pNextLayoutItem;
}
}
- pGenerateNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pGenerateNode);
+ pGenerateNode->GetNodeItem(XFA_NODEITEM_Parent)
+ ->RemoveChild(pGenerateNode, true);
}
uint8_t HAlignEnumToInt(XFA_ATTRIBUTEENUM eHAlign) {
@@ -2112,9 +2113,9 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow(
pFormNode = pFormNode->GetNodeItem(XFA_NODEITEM_Parent);
}
if (pLeaderNode && pFormNode)
- pFormNode->RemoveChild(pLeaderNode);
+ pFormNode->RemoveChild(pLeaderNode, true);
if (pTrailerNode && pFormNode)
- pFormNode->RemoveChild(pTrailerNode);
+ pFormNode->RemoveChild(pTrailerNode, true);
if (pTrailerItem)
XFA_ReleaseLayoutItem(pTrailerItem);
}
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index 1b72331608..3711752746 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -1791,7 +1791,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
}
}
if (pExistingNode) {
- pParentNode->RemoveChild(pExistingNode);
+ pParentNode->RemoveChild(pExistingNode, true);
}
}
pContainerItem->m_pOldSubform = pNewSubform;
@@ -1825,7 +1825,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
pDocument->GetXFAObject(XFA_HASHCODE_Form)
->AsNode()
->GetFirstChildByClass(XFA_Element::Subform);
- pFormToplevelSubform->InsertChild(pPendingPageSet);
+ pFormToplevelSubform->InsertChild(pPendingPageSet, nullptr);
}
pDocument->DataMerge_UpdateBindingRelations(pPendingPageSet);
pPendingPageSet->SetFlag(XFA_NodeFlag_Initialized, true);
@@ -1862,7 +1862,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
}
}
CXFA_Node* pNext = sIterator.SkipChildrenAndMoveToNext();
- pNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pNode);
+ pNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pNode, true);
pNode = pNext;
} else {
pNode->ClearFlag(XFA_NodeFlag_UnusedNode);
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index e4fae59a4b..b46a0bda87 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -128,7 +128,7 @@ void ReorderDataNodes(const std::set<CXFA_Node*>& sSet1,
pBeforeNode = pLastNode->GetNodeItem(XFA_NODEITEM_NextSibling);
}
for (auto* pCurNode : rgNodeArray1) {
- pParentNode->RemoveChild(pCurNode);
+ pParentNode->RemoveChild(pCurNode, true);
pParentNode->InsertChild(pCurNode, pBeforeNode);
}
}
@@ -207,7 +207,7 @@ CXFA_Node* CXFA_Node::Clone(bool bRecursive) {
if (bRecursive) {
for (CXFA_Node* pChild = GetNodeItem(XFA_NODEITEM_FirstChild); pChild;
pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- pClone->InsertChild(pChild->Clone(bRecursive));
+ pClone->InsertChild(pChild->Clone(bRecursive), nullptr);
}
}
pClone->SetFlag(XFA_NodeFlag_Initialized, true);
@@ -357,7 +357,7 @@ CXFA_Node* CXFA_Node::CloneTemplateToForm(bool bRecursive) {
if (bRecursive) {
for (CXFA_Node* pChild = GetNodeItem(XFA_NODEITEM_FirstChild); pChild;
pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- pClone->InsertChild(pChild->CloneTemplateToForm(bRecursive));
+ pClone->InsertChild(pChild->CloneTemplateToForm(bRecursive), nullptr);
}
}
pClone->SetFlag(XFA_NodeFlag_Initialized, true);
@@ -1887,7 +1887,7 @@ void CXFA_Node::InsertItem(CXFA_Node* pNewInstance,
void CXFA_Node::RemoveItem(CXFA_Node* pRemoveInstance,
bool bRemoveDataBinding) {
- GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pRemoveInstance);
+ GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pRemoveInstance, true);
if (!bRemoveDataBinding)
return;
@@ -1902,7 +1902,7 @@ void CXFA_Node::RemoveItem(CXFA_Node* pRemoveInstance,
if (pDataNode->RemoveBindItem(pFormNode) == 0) {
if (CXFA_Node* pDataParent =
pDataNode->GetNodeItem(XFA_NODEITEM_Parent)) {
- pDataParent->RemoveChild(pDataNode);
+ pDataParent->RemoveChild(pDataNode, true);
}
}
pFormNode->JSNode()->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr, nullptr);
@@ -1929,7 +1929,7 @@ CXFA_Node* CXFA_Node::CreateInstance(bool bDataMerge) {
pTemplateNode, pFormParent, pDataScope, true, bDataMerge, true);
if (pInstance) {
pDocument->DataMerge_UpdateBindingRelations(pInstance);
- pFormParent->RemoveChild(pInstance);
+ pFormParent->RemoveChild(pInstance, true);
}
return pInstance;
}
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index fa9bab46ed..c0beb69b6a 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -100,8 +100,8 @@ class CXFA_Node : public CXFA_Object {
int32_t CountChildren(XFA_Element eType, bool bOnlyChild);
CXFA_Node* GetChild(int32_t index, XFA_Element eType, bool bOnlyChild);
int32_t InsertChild(int32_t index, CXFA_Node* pNode);
- bool InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode = nullptr);
- bool RemoveChild(CXFA_Node* pNode, bool bNotify = true);
+ bool InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode);
+ bool RemoveChild(CXFA_Node* pNode, bool bNotify);
CXFA_Node* Clone(bool bRecursive);
CXFA_Node* GetNodeItem(XFA_NODEITEM eItem) const;
diff --git a/xfa/fxfa/parser/cxfa_nodehelper.cpp b/xfa/fxfa/parser/cxfa_nodehelper.cpp
index d8ccf8517c..84237485b3 100644
--- a/xfa/fxfa/parser/cxfa_nodehelper.cpp
+++ b/xfa/fxfa/parser/cxfa_nodehelper.cpp
@@ -342,7 +342,7 @@ bool CXFA_NodeHelper::ResolveNodes_CreateNode(WideString wsName,
for (int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex++) {
CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eType);
if (pNewNode) {
- m_pCreateParent->InsertChild(pNewNode);
+ m_pCreateParent->InsertChild(pNewNode, nullptr);
if (iIndex == m_iCreateCount - 1) {
m_pCreateParent = pNewNode;
}
@@ -360,7 +360,7 @@ bool CXFA_NodeHelper::ResolveNodes_CreateNode(WideString wsName,
pNewNode->JSNode()->SetAttribute(XFA_ATTRIBUTE_Name,
wsName.AsStringView(), false);
pNewNode->CreateXMLMappingNode();
- m_pCreateParent->InsertChild(pNewNode);
+ m_pCreateParent->InsertChild(pNewNode, nullptr);
if (iIndex == m_iCreateCount - 1) {
m_pCreateParent = pNewNode;
}
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp
index 02f927d053..2efc5c4bfa 100644
--- a/xfa/fxfa/parser/cxfa_simple_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp
@@ -361,7 +361,7 @@ void CXFA_SimpleParser::ConstructXFANode(CXFA_Node* pXFANode,
pXFAChild->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsChildValue,
false, false);
- pXFANode->InsertChild(pXFAChild);
+ pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLChild);
pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
break;
@@ -537,7 +537,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);
if (pPacketNode) {
pXMLTemplateDOMRoot = pElement;
- pXFARootNode->InsertChild(pPacketNode);
+ pXFARootNode->InsertChild(pPacketNode, nullptr);
}
} else {
CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);
@@ -547,7 +547,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) {
return nullptr;
}
- pXFARootNode->InsertChild(pPacketNode);
+ pXFARootNode->InsertChild(pPacketNode, nullptr);
}
}
}
@@ -560,13 +560,13 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
CXFA_Node* pPacketNode =
ParseAsXDPPacket(pXMLDatasetsDOMRoot, XFA_XDPPACKET_Datasets);
if (pPacketNode)
- pXFARootNode->InsertChild(pPacketNode);
+ pXFARootNode->InsertChild(pPacketNode, nullptr);
}
if (pXMLFormDOMRoot) {
CXFA_Node* pPacketNode =
ParseAsXDPPacket(pXMLFormDOMRoot, XFA_XDPPACKET_Form);
if (pPacketNode)
- pXFARootNode->InsertChild(pPacketNode);
+ pXFARootNode->InsertChild(pPacketNode, nullptr);
}
pXFARootNode->SetXMLMappingNode(pXMLDocumentNode);
@@ -908,7 +908,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode,
pXFAChild->JSNode()->SetAttribute(lpAttrInfo->eName,
it.second.AsStringView(), false);
}
- pXFANode->InsertChild(pXFAChild);
+ pXFANode->InsertChild(pXFAChild, nullptr);
if (eType == XFA_Element::Validate || eType == XFA_Element::Locale) {
if (ePacketID == XFA_XDPPACKET_Config)
ParseContentNode(pXFAChild, pXMLElement, ePacketID);
@@ -991,7 +991,7 @@ void CXFA_SimpleParser::ParseContentNode(CXFA_Node* pXFANode,
ASSERT(pContentRawDataNode);
pContentRawDataNode->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsValue,
false, false);
- pXFANode->InsertChild(pContentRawDataNode);
+ pXFANode->InsertChild(pContentRawDataNode, nullptr);
} else {
pXFANode->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsValue, false, false);
}
@@ -1093,7 +1093,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
false, false);
pXFAMetaData->JSNode()->SetEnum(XFA_ATTRIBUTE_Contains,
XFA_ATTRIBUTEENUM_MetaData, false);
- pXFAChild->InsertChild(pXFAMetaData);
+ pXFAChild->InsertChild(pXFAMetaData, nullptr);
pXFAMetaData->SetXMLMappingNode(pXMLElement);
pXFAMetaData->SetFlag(XFA_NodeFlag_Initialized, false);
}
@@ -1102,7 +1102,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
WideString wsNilName(L"xsi:nil");
pXMLElement->RemoveAttribute(wsNilName.c_str());
}
- pXFANode->InsertChild(pXFAChild);
+ pXFANode->InsertChild(pXFAChild, nullptr);
if (eNodeType == XFA_Element::DataGroup)
ParseDataGroup(pXFAChild, pXMLElement, ePacketID);
else if (bNeedValue)
@@ -1126,7 +1126,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
pXFAChild->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsText, false,
false);
- pXFANode->InsertChild(pXFAChild);
+ pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLText);
pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
continue;
@@ -1178,7 +1178,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
pXFAChild->JSNode()->SetCData(XFA_ATTRIBUTE_Name, L"", false, false);
pXFAChild->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsCurValue, false,
false);
- pXFANode->InsertChild(pXFAChild);
+ pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLCurValueNode);
pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
wsValueTextBuf << wsCurValue;
@@ -1196,7 +1196,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
pXFAChild->JSNode()->SetCData(XFA_ATTRIBUTE_Name, wsNodeStr, false,
false);
ParseDataValue(pXFAChild, pXMLChild, ePacketID);
- pXFANode->InsertChild(pXFAChild);
+ pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLChild);
pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
WideStringView wsCurValue =
@@ -1216,7 +1216,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
pXFAChild->JSNode()->SetCData(XFA_ATTRIBUTE_Name, L"", false, false);
pXFAChild->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsCurValue, false,
false);
- pXFANode->InsertChild(pXFAChild);
+ pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLCurValueNode);
pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
}
diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp
index 5af92b8415..3b567c2e69 100644
--- a/xfa/fxfa/parser/cxfa_validate.cpp
+++ b/xfa/fxfa/parser/cxfa_validate.cpp
@@ -99,7 +99,7 @@ void CXFA_Validate::SetMessageText(WideString& wsMessage,
}
}
CXFA_Node* pTextNode = pNode->CreateSamePacketNode(XFA_Element::Text);
- pNode->InsertChild(pTextNode);
+ pNode->InsertChild(pTextNode, nullptr);
pTextNode->JSNode()->SetCData(XFA_ATTRIBUTE_Name, wsMessageType, false,
false);
pTextNode->JSNode()->SetContent(wsMessage, wsMessage, false, false, true);
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 1828961027..963dc5e24e 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -969,7 +969,7 @@ void CXFA_WidgetData::ClearAllSelections() {
}
while (CXFA_Node* pChildNode = pBind->GetNodeItem(XFA_NODEITEM_FirstChild))
- pBind->RemoveChild(pChildNode);
+ pBind->RemoveChild(pChildNode, true);
}
void CXFA_WidgetData::InsertItem(const WideString& wsLabel,
@@ -1133,7 +1133,7 @@ bool CXFA_WidgetData::DeleteItem(int32_t nIndex,
if (nIndex < 0) {
while (CXFA_Node* pNode = pItems->GetNodeItem(XFA_NODEITEM_FirstChild)) {
- pItems->RemoveChild(pNode);
+ pItems->RemoveChild(pNode, true);
}
} else {
if (!bSetValue && pItems->JSNode()->GetBoolean(XFA_ATTRIBUTE_Save)) {
@@ -1144,7 +1144,7 @@ bool CXFA_WidgetData::DeleteItem(int32_t nIndex,
CXFA_Node* pNode = pItems->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pNode) {
if (i == nIndex) {
- pItems->RemoveChild(pNode);
+ pItems->RemoveChild(pNode, true);
break;
}
i++;
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index 78d2397c5b..d7c37a02d1 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -99,7 +99,7 @@ bool FormValueNode_SetChildContent(CXFA_Node* pValueNode,
element = XFA_Element::Sharpxml;
}
pContentRawDataNode = pChildNode->CreateSamePacketNode(element);
- pChildNode->InsertChild(pContentRawDataNode);
+ pChildNode->InsertChild(pContentRawDataNode, nullptr);
}
pContentRawDataNode->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsContent,
false, false);
@@ -171,7 +171,7 @@ void CreateDataBinding(CXFA_Node* pFormNode,
pValue->JSNode()->SetCData(XFA_ATTRIBUTE_Name, L"value", false,
false);
pValue->CreateXMLMappingNode();
- pDataNode->InsertChild(pValue);
+ pDataNode->InsertChild(pValue, nullptr);
pValue->JSNode()->SetCData(XFA_ATTRIBUTE_Value, text, false,
false);
}
@@ -539,12 +539,12 @@ CXFA_Node* CloneOrMergeInstanceManager(CXFA_Document* pDocument,
break;
CXFA_Node* pNextNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling);
- pFormParent->RemoveChild(pNode);
+ pFormParent->RemoveChild(pNode, true);
subforms->push_back(pNode);
pNode = pNextNode;
}
- pFormParent->RemoveChild(pExistingNode);
- pFormParent->InsertChild(pExistingNode);
+ pFormParent->RemoveChild(pExistingNode, true);
+ pFormParent->InsertChild(pExistingNode, nullptr);
pExistingNode->ClearFlag(XFA_NodeFlag_UnusedNode);
pExistingNode->SetTemplateNode(pTemplateNode);
return pExistingNode;
@@ -1033,7 +1033,7 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument,
pDocument->CreateNode(XFA_XDPPACKET_Datasets, eNodeType);
pDataNode->JSNode()->SetCData(XFA_ATTRIBUTE_Name, wsName, false, false);
pDataNode->CreateXMLMappingNode();
- pDataParent->InsertChild(pDataNode);
+ pDataParent->InsertChild(pDataNode, nullptr);
pDataNode->SetFlag(XFA_NodeFlag_Initialized, false);
return pDataNode;
}
@@ -1069,7 +1069,7 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument,
pDataNode->JSNode()->SetEnum(XFA_ATTRIBUTE_Contains,
XFA_ATTRIBUTEENUM_MetaData, false);
}
- pDataParent->InsertChild(pDataNode);
+ pDataParent->InsertChild(pDataNode, nullptr);
pDataNode->SetDataDescriptionNode(pDDNode);
pDataNode->SetFlag(XFA_NodeFlag_Initialized, false);
return pDataNode;
@@ -1125,8 +1125,8 @@ void UpdateBindingRelations(CXFA_Document* pDocument,
pDataNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pDataParent != pDataScope) {
ASSERT(pDataParent);
- pDataParent->RemoveChild(pDataNode);
- pDataScope->InsertChild(pDataNode);
+ pDataParent->RemoveChild(pDataNode, true);
+ pDataScope->InsertChild(pDataNode, nullptr);
}
}
}
@@ -1278,10 +1278,10 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(
}
if (pExistingNode) {
if (pSubformArray) {
- pFormParent->InsertChild(pExistingNode);
+ pFormParent->InsertChild(pExistingNode, nullptr);
} else if (pExistingNode->IsContainerNode()) {
- pFormParent->RemoveChild(pExistingNode);
- pFormParent->InsertChild(pExistingNode);
+ pFormParent->RemoveChild(pExistingNode, true);
+ pFormParent->InsertChild(pExistingNode, nullptr);
}
pExistingNode->ClearFlag(XFA_NodeFlag_UnusedNode);
pExistingNode->SetTemplateNode(pTemplateNode);
@@ -1388,7 +1388,7 @@ void CXFA_Document::DoDataMerge() {
pDatasetsRoot->JSNode()->SetCData(XFA_ATTRIBUTE_Name, L"datasets", false,
false);
m_pRootNode->GetXMLMappingNode()->InsertChildNode(pDatasetsXMLNode);
- m_pRootNode->InsertChild(pDatasetsRoot);
+ m_pRootNode->InsertChild(pDatasetsRoot, nullptr);
pDatasetsRoot->SetXMLMappingNode(pDatasetsXMLNode);
}
CXFA_Node *pDataRoot = nullptr, *pDDRoot = nullptr;
@@ -1422,7 +1422,7 @@ void CXFA_Document::DoDataMerge() {
pDataRoot = CreateNode(XFA_XDPPACKET_Datasets, XFA_Element::DataGroup);
pDataRoot->JSNode()->SetCData(XFA_ATTRIBUTE_Name, L"data", false, false);
pDataRoot->SetXMLMappingNode(pDataRootXMLNode);
- pDatasetsRoot->InsertChild(pDataRoot);
+ pDatasetsRoot->InsertChild(pDataRoot, nullptr);
}
CXFA_Node* pDataTopLevel =
@@ -1502,7 +1502,7 @@ void CXFA_Document::DoDataMerge() {
m_pPendingPageSet.push_back(pPageSetNode);
CXFA_Node* pNextPageSetNode =
pPageSetNode->GetNextSameClassSibling(XFA_Element::PageSet);
- pSubformSetNode->RemoveChild(pPageSetNode);
+ pSubformSetNode->RemoveChild(pPageSetNode, true);
pPageSetNode = pNextPageSetNode;
}
@@ -1517,7 +1517,7 @@ void CXFA_Document::DoDataMerge() {
if (pNode->IsContainerNode() ||
pNode->GetElementType() == XFA_Element::InstanceManager) {
CXFA_Node* pNext = sIterator.SkipChildrenAndMoveToNext();
- pNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pNode);
+ pNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pNode, true);
pNode = pNext;
} else {
pNode->ClearFlag(XFA_NodeFlag_UnusedNode);
@@ -1535,7 +1535,7 @@ 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))
- pFormRoot->RemoveChild(pNode);
+ pFormRoot->RemoveChild(pNode, true);
pFormRoot->JSNode()->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr, nullptr);
}
m_rgGlobalBinding.clear();