From d562ef07d9faf211f1f6218f0879f02b60a05f18 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 10 Apr 2017 16:29:57 -0400 Subject: Remove unused CreateSharedStream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CreateShreadStream code is not called, remove. Change-Id: I62871ce190e50598b7c82ab3b43355dbde6b8b4b Reviewed-on: https://pdfium-review.googlesource.com/4013 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fgas/crt/ifgas_stream.cpp | 59 ------------------------------------------- xfa/fgas/crt/ifgas_stream.h | 4 --- 2 files changed, 63 deletions(-) (limited to 'xfa/fgas') diff --git a/xfa/fgas/crt/ifgas_stream.cpp b/xfa/fgas/crt/ifgas_stream.cpp index 0edf2ccbbd..ae479964d0 100644 --- a/xfa/fgas/crt/ifgas_stream.cpp +++ b/xfa/fgas/crt/ifgas_stream.cpp @@ -220,9 +220,6 @@ class CFGAS_Stream : public IFGAS_Stream { int32_t GetBOM(uint8_t bom[4]) const override; uint16_t GetCodePage() const override; uint16_t SetCodePage(uint16_t wCodePage) override; - CFX_RetainPtr CreateSharedStream(uint32_t dwAccess, - int32_t iOffset, - int32_t iLength) override; protected: CFGAS_Stream(); @@ -258,9 +255,6 @@ class CFGAS_TextStream : public IFGAS_Stream { int32_t GetBOM(uint8_t bom[4]) const override; uint16_t GetCodePage() const override; uint16_t SetCodePage(uint16_t wCodePage) override; - CFX_RetainPtr CreateSharedStream(uint32_t dwAccess, - int32_t iOffset, - int32_t iLength) override; protected: explicit CFGAS_TextStream(const CFX_RetainPtr& pStream); @@ -957,21 +951,6 @@ uint16_t CFGAS_TextStream::GetCodePage() const { return m_wCodePage; } -CFX_RetainPtr CFGAS_TextStream::CreateSharedStream( - uint32_t dwAccess, - int32_t iOffset, - int32_t iLength) { - CFX_RetainPtr pSR = - m_pStreamImp->CreateSharedStream(dwAccess, iOffset, iLength); - if (!pSR) - return nullptr; - - if (dwAccess & FX_STREAMACCESS_Text) - return pdfium::MakeRetain(pSR); - - return pSR; -} - int32_t CFGAS_TextStream::GetBOM(uint8_t bom[4]) const { if (m_wBOMLength < 1) return 0; @@ -1364,44 +1343,6 @@ uint16_t CFGAS_Stream::SetCodePage(uint16_t wCodePage) { #endif } -CFX_RetainPtr CFGAS_Stream::CreateSharedStream(uint32_t dwAccess, - int32_t iOffset, - int32_t iLength) { - ASSERT(iLength > 0); - if (!m_pStreamImp) - return nullptr; - - if ((m_dwAccess & FX_STREAMACCESS_Text) != 0 && - (dwAccess & FX_STREAMACCESS_Text) == 0) { - return nullptr; - } - if ((m_dwAccess & FX_STREAMACCESS_Write) == 0 && - (dwAccess & FX_STREAMACCESS_Write) != 0) { - return nullptr; - } - int32_t iStart = m_iStart + iOffset; - int32_t iTotal = m_iStart + m_iLength; - if (iStart < m_iStart || iStart >= iTotal) - return nullptr; - - int32_t iEnd = iStart + iLength; - if (iEnd < iStart || iEnd > iTotal) - return nullptr; - - auto pShared = pdfium::MakeRetain(); - pShared->m_eStreamType = FX_STREAMTYPE_Stream; - pShared->m_pStreamImp = m_pStreamImp; - pShared->m_dwAccess = dwAccess; - pShared->m_iTotalSize = iLength; - pShared->m_iPosition = iStart; - pShared->m_iStart = iStart; - pShared->m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iLength; - if (dwAccess & FX_STREAMACCESS_Text) - return IFGAS_Stream::CreateTextStream(pShared); - - return pShared; -} - CFX_RetainPtr CFGAS_FileRead::Create( const CFX_RetainPtr& pStream) { return pdfium::MakeRetain(pStream); diff --git a/xfa/fgas/crt/ifgas_stream.h b/xfa/fgas/crt/ifgas_stream.h index 3ffead96dd..d3b3ef545c 100644 --- a/xfa/fgas/crt/ifgas_stream.h +++ b/xfa/fgas/crt/ifgas_stream.h @@ -41,10 +41,6 @@ class IFGAS_Stream : public CFX_Retainable { static CFX_RetainPtr CreateTextStream( const CFX_RetainPtr& pBaseStream); - virtual CFX_RetainPtr CreateSharedStream(uint32_t dwAccess, - int32_t iOffset, - int32_t iLength) = 0; - virtual uint32_t GetAccessModes() const = 0; virtual int32_t GetLength() const = 0; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0; -- cgit v1.2.3