summaryrefslogtreecommitdiff
path: root/fxjs/xfa/cjx_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/xfa/cjx_node.cpp')
-rw-r--r--fxjs/xfa/cjx_node.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp
index 06a812e2eb..a8a88c9627 100644
--- a/fxjs/xfa/cjx_node.cpp
+++ b/fxjs/xfa/cjx_node.cpp
@@ -247,7 +247,13 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime,
}
if (bIgnoreRoot) {
- pXMLNode->MoveChildrenTo(pFakeXMLRoot.get());
+ CFX_XMLNode* pXMLChild = pXMLNode->GetFirstChild();
+ while (pXMLChild) {
+ CFX_XMLNode* pXMLSibling = pXMLChild->GetNextSibling();
+ pXMLNode->RemoveChildNode(pXMLChild);
+ pFakeXMLRoot->AppendChild(pdfium::WrapUnique<CFX_XMLNode>(pXMLChild));
+ pXMLChild = pXMLSibling;
+ }
} else {
CFX_XMLNode* pXMLParent = pXMLNode->GetParent();
if (pXMLParent)