diff options
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document_parser.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index 3e4aa58dd9..8df91bc1cc 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -18,23 +18,18 @@ CXFA_DocumentParser::~CXFA_DocumentParser() { m_pDocument->ReleaseXMLNodesIfNeeded(); } -int32_t CXFA_DocumentParser::StartParse( - const RetainPtr<IFX_SeekableStream>& pStream, - XFA_PacketType ePacketID) { +int32_t CXFA_DocumentParser::Parse(const RetainPtr<IFX_SeekableStream>& pStream, + XFA_PacketType ePacketID) { m_pDocument.reset(); m_nodeParser.CloseParser(); - int32_t nRetStatus = m_nodeParser.StartParse(pStream, ePacketID); - if (nRetStatus == XFA_PARSESTATUS_Ready) { - m_pDocument = pdfium::MakeUnique<CXFA_Document>(GetNotify()); - m_nodeParser.SetFactory(m_pDocument.get()); - } - return nRetStatus; -} + m_nodeParser.StartParse(pStream, ePacketID); + + m_pDocument = pdfium::MakeUnique<CXFA_Document>(GetNotify()); + m_nodeParser.SetFactory(m_pDocument.get()); -int32_t CXFA_DocumentParser::DoParse() { int32_t nRetStatus = m_nodeParser.DoParse(); - if (nRetStatus >= XFA_PARSESTATUS_Done) { + if (nRetStatus == XFA_PARSESTATUS_Done) { ASSERT(m_pDocument); m_pDocument->SetRoot(m_nodeParser.GetRootNode()); } |