From 03fdf3a2b5ee0974be13a9594a897003df412306 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 22 Aug 2018 16:14:49 +0000 Subject: Mark CFX_XMLNode pointers as const in various places. Change-Id: I86c6f7526e2ef4c3e8de30ebaff223095ee70fc4 Reviewed-on: https://pdfium-review.googlesource.com/40811 Commit-Queue: Lei Zhang Reviewed-by: Ryan Harrison --- core/fxcrt/xml/cfx_xmltext.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core') 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(pNode) : nullptr; } +inline const CFX_XMLText* ToXMLText(const CFX_XMLNode* pNode) { + return pNode && IsXMLText(pNode) ? static_cast(pNode) + : nullptr; +} + #endif // CORE_FXCRT_XML_CFX_XMLTEXT_H_ -- cgit v1.2.3