summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/xml/cfx_xmlelement.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fxcrt/xml/cfx_xmlelement.h b/core/fxcrt/xml/cfx_xmlelement.h
index ca5fd5e797..0d3468aba4 100644
--- a/core/fxcrt/xml/cfx_xmlelement.h
+++ b/core/fxcrt/xml/cfx_xmlelement.h
@@ -54,4 +54,10 @@ class CFX_XMLElement : public CFX_XMLNode {
std::map<WideString, WideString> attrs_;
};
+inline CFX_XMLElement* ToXMLElement(CFX_XMLNode* pNode) {
+ return pNode && pNode->GetType() == FX_XMLNODE_Element
+ ? static_cast<CFX_XMLElement*>(pNode)
+ : nullptr;
+}
+
#endif // CORE_FXCRT_XML_CFX_XMLELEMENT_H_