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 /xfa/fxfa/cxfa_textparser.cpp | |
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 'xfa/fxfa/cxfa_textparser.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_textparser.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp index 3084783a83..484e862510 100644 --- a/xfa/fxfa/cxfa_textparser.cpp +++ b/xfa/fxfa/cxfa_textparser.cpp @@ -192,7 +192,7 @@ RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateStyle( } RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::ComputeStyle( - CFX_XMLNode* pXMLNode, + const CFX_XMLNode* pXMLNode, CFX_CSSComputedStyle* pParentStyle) { auto it = m_mapXMLNodeToParseContext.find(pXMLNode); if (it == m_mapXMLNodeToParseContext.end()) @@ -215,7 +215,7 @@ RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::ComputeStyle( return pStyle; } -void CXFA_TextParser::DoParse(CFX_XMLNode* pXMLContainer, +void CXFA_TextParser::DoParse(const CFX_XMLNode* pXMLContainer, CXFA_TextProvider* pTextProvider) { if (!pXMLContainer || !pTextProvider || m_bParsed) return; @@ -226,7 +226,7 @@ void CXFA_TextParser::DoParse(CFX_XMLNode* pXMLContainer, ParseRichText(pXMLContainer, pRootStyle.Get()); } -void CXFA_TextParser::ParseRichText(CFX_XMLNode* pXMLNode, +void CXFA_TextParser::ParseRichText(const CFX_XMLNode* pXMLNode, CFX_CSSComputedStyle* pParentStyle) { if (!pXMLNode) return; @@ -285,10 +285,11 @@ bool CXFA_TextParser::TagValidate(const WideString& wsName) const { FX_HashCode_GetW(wsName.AsStringView(), true)); } +// static std::unique_ptr<CXFA_TextParser::TagProvider> CXFA_TextParser::ParseTagInfo( - CFX_XMLNode* pXMLNode) { + const CFX_XMLNode* pXMLNode) { auto tagProvider = pdfium::MakeUnique<TagProvider>(); - CFX_XMLElement* pXMLElement = ToXMLElement(pXMLNode); + const CFX_XMLElement* pXMLElement = ToXMLElement(pXMLNode); if (pXMLElement) { WideString wsName = pXMLElement->GetLocalTagName(); tagProvider->SetTagName(wsName); @@ -377,7 +378,7 @@ float CXFA_TextParser::GetFontSize(CXFA_TextProvider* pTextProvider, int32_t CXFA_TextParser::GetHorScale(CXFA_TextProvider* pTextProvider, CFX_CSSComputedStyle* pStyle, - CFX_XMLNode* pXMLNode) const { + const CFX_XMLNode* pXMLNode) const { if (pStyle) { WideString wsValue; if (pStyle->GetCustomStyle(L"xfa-font-horizontal-scale", wsValue)) @@ -538,7 +539,7 @@ Optional<WideString> CXFA_TextParser::GetEmbeddedObj( } CXFA_TextParseContext* CXFA_TextParser::GetParseContextFromMap( - CFX_XMLNode* pXMLNode) { + const CFX_XMLNode* pXMLNode) { auto it = m_mapXMLNodeToParseContext.find(pXMLNode); return it != m_mapXMLNodeToParseContext.end() ? it->second.get() : nullptr; } |