diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-22 16:14:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-22 16:14:49 +0000 |
commit | 03fdf3a2b5ee0974be13a9594a897003df412306 (patch) | |
tree | 3ba4cb34ef92e4245c6e81835760a76dc34418c7 /core/fxcrt | |
parent | b9509d740966e16a94dc456c634b3f1005e8be95 (diff) | |
download | pdfium-03fdf3a2b5ee0974be13a9594a897003df412306.tar.xz |
Mark CFX_XMLNode pointers as const in various places.
Change-Id: I86c6f7526e2ef4c3e8de30ebaff223095ee70fc4
Reviewed-on: https://pdfium-review.googlesource.com/40811
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt')
-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_ |