summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document_parser.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_document_parser.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp
index 18f9955210..883f684768 100644
--- a/xfa/fxfa/parser/cxfa_document_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_document_parser.cpp
@@ -20,18 +20,15 @@ CXFA_DocumentParser::~CXFA_DocumentParser() {
int32_t CXFA_DocumentParser::Parse(const RetainPtr<IFX_SeekableStream>& pStream,
XFA_PacketType ePacketID) {
- m_pDocument.reset();
- m_nodeParser.CloseParser();
-
m_pDocument = pdfium::MakeUnique<CXFA_Document>(GetNotify());
m_nodeParser.SetFactory(m_pDocument.get());
- int32_t nRetStatus = m_nodeParser.Parse(pStream, ePacketID);
- if (nRetStatus == XFA_PARSESTATUS_Done) {
- ASSERT(m_pDocument);
- m_pDocument->SetRoot(m_nodeParser.GetRootNode());
- }
- return nRetStatus;
+ if (!m_nodeParser.Parse(pStream, ePacketID))
+ return XFA_PARSESTATUS_StatusErr;
+
+ ASSERT(m_pDocument);
+ m_pDocument->SetRoot(m_nodeParser.GetRootNode());
+ return XFA_PARSESTATUS_Done;
}
CXFA_FFNotify* CXFA_DocumentParser::GetNotify() const {