summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/xfa/cjx_node.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp
index 8876628c3b..49cd041c88 100644
--- a/fxjs/xfa/cjx_node.cpp
+++ b/fxjs/xfa/cjx_node.cpp
@@ -221,6 +221,10 @@ CJS_Result CJX_Node::loadXML(CFX_V8* runtime,
if (!pXMLNode)
return CJS_Result::Success();
+ CFX_XMLDocument* top_xml_doc =
+ GetXFANode()->GetDocument()->GetNotify()->GetHDOC()->GetXMLDocument();
+ top_xml_doc->AppendNodesFrom(pParser->GetXMLDoc().get());
+
if (bIgnoreRoot &&
(pXMLNode->GetType() != FX_XMLNODE_Element ||
XFA_RecognizeRichText(static_cast<CFX_XMLElement*>(pXMLNode)))) {
@@ -239,19 +243,10 @@ CJS_Result CJX_Node::loadXML(CFX_V8* runtime,
CFX_XMLNode* pThisXMLRoot = GetXFANode()->GetXMLMappingNode();
CFX_XMLNode* clone;
if (pThisXMLRoot) {
- clone = pThisXMLRoot->Clone(GetXFANode()
- ->GetDocument()
- ->GetNotify()
- ->GetHDOC()
- ->GetXMLDocument());
+ clone = pThisXMLRoot->Clone(top_xml_doc);
} else {
- clone = GetXFANode()
- ->GetDocument()
- ->GetNotify()
- ->GetHDOC()
- ->GetXMLDocument()
- ->CreateNode<CFX_XMLElement>(
- WideString(GetXFANode()->GetClassName()));
+ clone = top_xml_doc->CreateNode<CFX_XMLElement>(
+ WideString(GetXFANode()->GetClassName()));
}
pFakeXMLRoot = clone;
}