summaryrefslogtreecommitdiff
path: root/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxfa/src/parser/xfa_parser_imp.cpp')
-rw-r--r--xfa/src/fxfa/src/parser/xfa_parser_imp.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
index 9e85c1f539..66258980e5 100644
--- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
@@ -433,6 +433,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
}
IFDE_XMLNode* pXMLDatasetsDOMRoot = NULL;
IFDE_XMLNode* pXMLFormDOMRoot = NULL;
+ IFDE_XMLNode* pXMLTemplateDOMRoot = NULL;
{
for (IFDE_XMLNode* pChildItem =
pXMLDocumentNode->GetNodeItem(IFDE_XMLNode::FirstChild);
@@ -473,7 +474,17 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
return NULL;
}
pXMLFormDOMRoot = pElement;
- } else {
+ } else if (ePacket == XFA_XDPPACKET_Template) {
+ if (pXMLTemplateDOMRoot) {
+ // Find a duplicate template packet
+ return NULL;
+ }
+ CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);
+ if (pPacketNode) {
+ pXMLTemplateDOMRoot = pElement;
+ pXFARootNode->InsertChild(pPacketNode);
+ }
+ } else {
CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);
if (pPacketNode) {
if (pPacketInfo &&
@@ -486,6 +497,9 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
}
}
}
+ if (!pXMLTemplateDOMRoot) {
+ return NULL;
+ }
if (pXMLDatasetsDOMRoot) {
CXFA_Node* pPacketNode =
ParseAsXDPPacket(pXMLDatasetsDOMRoot, XFA_XDPPACKET_Datasets);