diff options
Diffstat (limited to 'core/fxcrt/xml')
-rw-r--r-- | core/fxcrt/xml/cfx_xmltext.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/fxcrt/xml/cfx_xmltext.h b/core/fxcrt/xml/cfx_xmltext.h index f7feae669e..a8a5f12a53 100644 --- a/core/fxcrt/xml/cfx_xmltext.h +++ b/core/fxcrt/xml/cfx_xmltext.h @@ -31,7 +31,7 @@ class CFX_XMLText : public CFX_XMLNode { WideString m_wsText; }; -inline bool IsXMLText(CFX_XMLNode* pNode) { +inline bool IsXMLText(const CFX_XMLNode* pNode) { FX_XMLNODETYPE type = pNode->GetType(); return type == FX_XMLNODE_Text || type == FX_XMLNODE_CharData; } @@ -40,4 +40,9 @@ inline CFX_XMLText* ToXMLText(CFX_XMLNode* pNode) { return pNode && IsXMLText(pNode) ? static_cast<CFX_XMLText*>(pNode) : nullptr; } +inline const CFX_XMLText* ToXMLText(const CFX_XMLNode* pNode) { + return pNode && IsXMLText(pNode) ? static_cast<const CFX_XMLText*>(pNode) + : nullptr; +} + #endif // CORE_FXCRT_XML_CFX_XMLTEXT_H_ |