From bf510b7c520bccbd2edf5bb3e2f91b125ebfd6d7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 18 Apr 2017 16:35:55 -0400 Subject: Rename IFGAS_Stream to CFGAS_Stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL replaces IFGAS_Stream with the only implementation CFGAS_Stream. The CreateReadStream and CreateWriteStream methods are removed in favour of calling MakeRetain directly. Change-Id: I882a89258f642e24fc3d631587db05652bd53ded Reviewed-on: https://pdfium-review.googlesource.com/4210 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez --- xfa/fxfa/parser/cxfa_simple_parser.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_simple_parser.cpp') diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp index 1ebed10b4d..92196ec957 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.cpp +++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp @@ -19,8 +19,8 @@ #include "xfa/fde/xml/cfde_xmlnode.h" #include "xfa/fde/xml/cfde_xmlparser.h" #include "xfa/fde/xml/cfde_xmltext.h" +#include "xfa/fgas/crt/cfgas_stream.h" #include "xfa/fgas/crt/fgas_codepage.h" -#include "xfa/fgas/crt/ifgas_stream.h" #include "xfa/fxfa/fxfa.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_node.h" @@ -277,10 +277,7 @@ int32_t CXFA_SimpleParser::StartParse( XFA_XDPPACKET ePacketID) { CloseParser(); m_pFileRead = pStream; - m_pStream = IFGAS_Stream::CreateReadStream(pStream); - if (!m_pStream) - return XFA_PARSESTATUS_StreamErr; - + m_pStream = pdfium::MakeRetain(pStream, false); uint16_t wCodePage = m_pStream->GetCodePage(); if (wCodePage != FX_CODEPAGE_UTF16LE && wCodePage != FX_CODEPAGE_UTF16BE && wCodePage != FX_CODEPAGE_UTF8) { @@ -322,9 +319,8 @@ CFDE_XMLNode* CXFA_SimpleParser::ParseXMLData(const CFX_ByteString& wsXML, CloseParser(); m_pXMLDoc = pdfium::MakeUnique(); - CFX_RetainPtr pStream = - IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( - const_cast(wsXML.raw_str()), wsXML.GetLength())); + auto pStream = pdfium::MakeRetain( + const_cast(wsXML.raw_str()), wsXML.GetLength()); auto pParser = pdfium::MakeUnique(m_pXMLDoc->GetRoot(), pStream); pParser->m_dwCheckStatus = 0x03; -- cgit v1.2.3