summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_dataexporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_dataexporter.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_dataexporter.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp
index eb3e04afd8..820d3546f7 100644
--- a/xfa/fxfa/parser/cxfa_dataexporter.cpp
+++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp
@@ -38,9 +38,8 @@ bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pStream,
break;
}
case XFA_PacketType::Datasets: {
- CFX_XMLElement* pElement =
- static_cast<CFX_XMLElement*>(pNode->GetXMLMappingNode());
- if (!pElement || pElement->GetType() != FX_XMLNODE_Element)
+ CFX_XMLElement* pElement = ToXMLElement(pNode->GetXMLMappingNode());
+ if (!pElement)
return false;
CXFA_Node* pDataNode = pNode->GetFirstChild();
@@ -54,9 +53,8 @@ bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pStream,
break;
case XFA_PacketType::Template:
default: {
- CFX_XMLElement* pElement =
- static_cast<CFX_XMLElement*>(pNode->GetXMLMappingNode());
- if (!pElement || pElement->GetType() != FX_XMLNODE_Element)
+ CFX_XMLElement* pElement = ToXMLElement(pNode->GetXMLMappingNode());
+ if (!pElement)
return false;
pElement->Save(pStream);
@@ -75,9 +73,8 @@ bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pStream,
break;
}
}
- CFX_XMLElement* pElement =
- static_cast<CFX_XMLElement*>(pExportNode->GetXMLMappingNode());
- if (!pElement || pElement->GetType() != FX_XMLNODE_Element)
+ CFX_XMLElement* pElement = ToXMLElement(pExportNode->GetXMLMappingNode());
+ if (!pElement)
return false;
XFA_DataExporter_DealWithDataGroupNode(pExportNode);
@@ -85,6 +82,5 @@ bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pStream,
L"http://www.xfa.org/schema/xfa-data/1.0/");
pElement->Save(pStream);
pElement->RemoveAttribute(L"xmlns:xfa");
-
return true;
}