summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 363af54028..9fdea14cae 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1259,11 +1259,9 @@ void CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) {
return;
}
- ASSERT(pNode->xml_node_.Get() == xml_node_.Get() &&
- xml_node_->GetType() == FX_XMLNODE_Element);
- if (pNode->xml_node_->GetType() == FX_XMLNODE_Element) {
- CFX_XMLElement* pXMLElement =
- static_cast<CFX_XMLElement*>(pNode->xml_node_.Get());
+ ASSERT(pNode->xml_node_.Get() == xml_node_.Get());
+ CFX_XMLElement* pXMLElement = ToXMLElement(pNode->xml_node_.Get());
+ if (pXMLElement) {
WideString wsAttributeName =
pNode->JSObject()->GetCData(XFA_Attribute::QualifiedName);
pXMLElement->RemoveAttribute(wsAttributeName);
@@ -4700,10 +4698,10 @@ bool CXFA_Node::PresenceRequiresSpace() const {
}
void CXFA_Node::SetToXML(const WideString& value) {
- auto* elem = static_cast<CFX_XMLElement*>(GetXMLMappingNode());
- FX_XMLNODETYPE eXMLType = elem->GetType();
- switch (eXMLType) {
+ auto* pNode = GetXMLMappingNode();
+ switch (pNode->GetType()) {
case FX_XMLNODE_Element: {
+ auto* elem = static_cast<CFX_XMLElement*>(pNode);
if (IsAttributeInXML()) {
elem->SetAttribute(JSObject()->GetCData(XFA_Attribute::QualifiedName),
value);