summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_simple_parser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-04-10 13:01:07 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-10 13:01:07 +0000
commit4027887ee29a7f4920b03041068bff9bde239782 (patch)
tree5f3978ef04fbc8c3195cbadc3ed560c1712ab950 /xfa/fxfa/parser/cxfa_simple_parser.cpp
parente372ad7333bdd6bb0c579cf074843ef0c6f3414f (diff)
downloadpdfium-4027887ee29a7f4920b03041068bff9bde239782.tar.xz
Merge CXFA_SimpleParser::{Start|Do}Parsechromium/3394
The StartParse and DoParse methods have been merged into a single Parse method. Change-Id: I1310bda90b853c11af8b8d1794de6b5c19e931cf Reviewed-on: https://pdfium-review.googlesource.com/30010 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_simple_parser.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp
index a59ea9d951..7021285dff 100644
--- a/xfa/fxfa/parser/cxfa_simple_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp
@@ -339,8 +339,8 @@ void CXFA_SimpleParser::SetFactory(CXFA_Document* pFactory) {
m_pFactory = pFactory;
}
-void CXFA_SimpleParser::StartParse(const RetainPtr<IFX_SeekableStream>& pStream,
- XFA_PacketType ePacketID) {
+int32_t CXFA_SimpleParser::Parse(const RetainPtr<IFX_SeekableStream>& pStream,
+ XFA_PacketType ePacketID) {
CloseParser();
m_pFileRead = pStream;
m_pStream = pdfium::MakeRetain<CFX_SeekableStreamProxy>(pStream, false);
@@ -351,13 +351,7 @@ void CXFA_SimpleParser::StartParse(const RetainPtr<IFX_SeekableStream>& pStream,
}
m_pXMLDoc = pdfium::MakeUnique<CFX_XMLDoc>(m_pStream);
-
- m_bParseStarted = true;
- m_ePacketID = ePacketID;
-}
-
-int32_t CXFA_SimpleParser::DoParse() {
- if (!m_pXMLDoc || !m_bParseStarted)
+ if (!m_pXMLDoc)
return XFA_PARSESTATUS_StatusErr;
int32_t iRet = m_pXMLDoc->DoLoad();
@@ -366,7 +360,7 @@ int32_t CXFA_SimpleParser::DoParse() {
if (iRet < 100)
return iRet / 2;
- m_pRootNode = ParseAsXDPPacket(GetDocumentNode(m_pXMLDoc.get()), m_ePacketID);
+ m_pRootNode = ParseAsXDPPacket(GetDocumentNode(m_pXMLDoc.get()), ePacketID);
m_pXMLDoc->CloseXML();
m_pStream.Reset();