summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document_parser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-04-12 13:15:59 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 13:15:59 +0000
commita995d6fd9b862dbd37aebb9c323766bb5d11d389 (patch)
treedb204479d0c854d1e30840794972d5115cbe80f4 /xfa/fxfa/parser/cxfa_document_parser.cpp
parent332139df2c3c0826069fa61bcd436309fcdf5a6f (diff)
downloadpdfium-a995d6fd9b862dbd37aebb9c323766bb5d11d389.tar.xz
Allow retrieving the XML tree from the CFX_XMLDoc
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the CFX_XMLDoc. This way, we don't have to keep the doc around and can store the pointer to the tree in the CXFA_SimpleParser. Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c Reviewed-on: https://pdfium-review.googlesource.com/30210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
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 {