From 4fcdf058734b5df696420aa653ea787842678224 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 18 Apr 2017 11:55:27 -0400 Subject: Subclass the stream implementations from CFGAS_Stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename CFGAS_TextStream to CFGAS_Stream. CFGAS_Stream is converted to a base class instead of accepting an IFGAS_StreamImp. Things which inherted from IFGAS_StreamImp now inherit from CFGAS_Stream. The stream type inputs are changed to IFX_SeekableStream so that they can accept the same type (IFX_SeekableStream is an IFX_SeekableWriteStream and an IFX_SeekableReadStream). This way the storage can be shared in the base class. Change-Id: I06645071e68e2a4d4120c0e336529f2c18c2b705 Reviewed-on: https://pdfium-review.googlesource.com/4152 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- xfa/fxfa/cxfa_ffdoc.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'xfa/fxfa/cxfa_ffdoc.cpp') diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp index 2bbdfa1b9c..3565370bde 100644 --- a/xfa/fxfa/cxfa_ffdoc.cpp +++ b/xfa/fxfa/cxfa_ffdoc.cpp @@ -281,7 +281,7 @@ CXFA_FFDocView* CXFA_FFDoc::GetDocView() { return m_DocView.get(); } -bool CXFA_FFDoc::OpenDoc(const CFX_RetainPtr& pStream) { +bool CXFA_FFDoc::OpenDoc(const CFX_RetainPtr& pStream) { m_pStream = pStream; return true; } @@ -389,9 +389,8 @@ CFX_RetainPtr CXFA_FFDoc::GetPDFNamedImage( auto pAcc = pdfium::MakeRetain(pStream); pAcc->LoadAllData(); - CFX_RetainPtr pImageFileRead = - IFX_MemoryStream::Create(const_cast(pAcc->GetData()), - pAcc->GetSize()); + CFX_RetainPtr pImageFileRead = IFX_MemoryStream::Create( + const_cast(pAcc->GetData()), pAcc->GetSize()); CFX_RetainPtr pDibSource = XFA_LoadImageFromBuffer( pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi); @@ -399,10 +398,9 @@ CFX_RetainPtr CXFA_FFDoc::GetPDFNamedImage( return pDibSource; } -bool CXFA_FFDoc::SavePackage( - XFA_HashCode code, - const CFX_RetainPtr& pFile, - CFX_ChecksumContext* pCSContext) { +bool CXFA_FFDoc::SavePackage(XFA_HashCode code, + const CFX_RetainPtr& pFile, + CFX_ChecksumContext* pCSContext) { CXFA_Document* doc = m_pDocumentParser->GetDocument(); auto pExport = pdfium::MakeUnique(doc); CXFA_Node* pNode = code == XFA_HASHCODE_Xfa ? doc->GetRoot() @@ -418,9 +416,8 @@ bool CXFA_FFDoc::SavePackage( pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr); } -bool CXFA_FFDoc::ImportData( - const CFX_RetainPtr& pStream, - bool bXDP) { +bool CXFA_FFDoc::ImportData(const CFX_RetainPtr& pStream, + bool bXDP) { auto importer = pdfium::MakeUnique(m_pDocumentParser->GetDocument()); return importer->ImportData(pStream); -- cgit v1.2.3