diff options
author | Lei Zhang <thestig@chromium.org> | 2017-12-04 06:04:35 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-04 06:04:35 +0000 |
commit | 56b08b1f2bb8a4eb9330963bff3a626603499730 (patch) | |
tree | 406c3453ad65a08c56aa3c15b6f70d7b149b84a7 /xfa/fxfa/parser/cxfa_simple_parser.cpp | |
parent | b8d86800487df4021860f08407c323ed82243c79 (diff) | |
download | pdfium-56b08b1f2bb8a4eb9330963bff3a626603499730.tar.xz |
Make CXFA_SimpleParser members const or Unowned.
Fix ownership issues, and simplify CXFA_SimpleParser ctors.
Change-Id: Ie083080297c5c2586ae3e6a8355839fcb86ee9ea
Reviewed-on: https://pdfium-review.googlesource.com/20130
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_simple_parser.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_simple_parser.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp index 22b02ccdc8..b3965ed6a2 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.cpp +++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp @@ -299,18 +299,15 @@ bool XFA_RecognizeRichText(CFX_XMLElement* pRichTextXMLNode) { L"http://www.w3.org/1999/xhtml"; } -CXFA_SimpleParser::CXFA_SimpleParser(CXFA_Document* pFactory, - bool bDocumentParser) - : m_pXMLParser(nullptr), - m_pFactory(pFactory), - m_pRootNode(nullptr), - m_ePacketID(XFA_PacketType::User), - m_bParseStarted(false), - m_bDocumentParser(bDocumentParser) {} +CXFA_SimpleParser::CXFA_SimpleParser() : m_bDocumentParser(true) {} + +CXFA_SimpleParser::CXFA_SimpleParser(CXFA_Document* pFactory) + : m_pFactory(pFactory), m_bDocumentParser(false) {} CXFA_SimpleParser::~CXFA_SimpleParser() {} void CXFA_SimpleParser::SetFactory(CXFA_Document* pFactory) { + ASSERT(m_bDocumentParser); m_pFactory = pFactory; } @@ -348,6 +345,7 @@ int32_t CXFA_SimpleParser::DoParse() { return iRet / 2; m_pRootNode = ParseAsXDPPacket(GetDocumentNode(m_pXMLDoc.get()), m_ePacketID); + m_pXMLParser.Release(); m_pXMLDoc->CloseXML(); m_pStream.Reset(); |