diff options
Diffstat (limited to 'xfa/fgas')
-rw-r--r-- | xfa/fgas/crt/ifgas_stream.cpp | 34 | ||||
-rw-r--r-- | xfa/fgas/crt/ifgas_stream.h | 2 | ||||
-rw-r--r-- | xfa/fgas/font/cfgas_gefont.cpp | 50 | ||||
-rw-r--r-- | xfa/fgas/font/cfgas_gefont.h | 9 |
4 files changed, 0 insertions, 95 deletions
diff --git a/xfa/fgas/crt/ifgas_stream.cpp b/xfa/fgas/crt/ifgas_stream.cpp index 874330165b..dcd13b162e 100644 --- a/xfa/fgas/crt/ifgas_stream.cpp +++ b/xfa/fgas/crt/ifgas_stream.cpp @@ -169,19 +169,6 @@ class CFGAS_TextStream : public IFGAS_Stream { CFX_RetainPtr<IFGAS_Stream> m_pStreamImp; }; -class CFGAS_FileRead : public IFX_SeekableReadStream { - public: - explicit CFGAS_FileRead(const CFX_RetainPtr<IFGAS_Stream>& pStream); - ~CFGAS_FileRead() override; - - // IFX_SeekableReadStream - FX_FILESIZE GetSize() override; - bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; - - protected: - CFX_RetainPtr<IFGAS_Stream> m_pStream; -}; - IFGAS_StreamImp::IFGAS_StreamImp() : m_dwAccess(0) {} CFGAS_FileReadStreamImp::CFGAS_FileReadStreamImp() @@ -663,23 +650,6 @@ uint16_t CFGAS_Stream::SetCodePage(uint16_t wCodePage) { #endif } -CFGAS_FileRead::CFGAS_FileRead(const CFX_RetainPtr<IFGAS_Stream>& pStream) - : m_pStream(pStream) { - ASSERT(m_pStream); -} - -CFGAS_FileRead::~CFGAS_FileRead() {} - -FX_FILESIZE CFGAS_FileRead::GetSize() { - return (FX_FILESIZE)m_pStream->GetLength(); -} - -bool CFGAS_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { - m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset); - int32_t iLen = m_pStream->ReadData((uint8_t*)buffer, (int32_t)size); - return iLen == (int32_t)size; -} - } // namespace // static @@ -714,7 +684,3 @@ CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateWriteStream( return pdfium::MakeRetain<CFGAS_TextStream>( pdfium::MakeRetain<CFGAS_Stream>(std::move(pImp), FX_STREAMACCESS_Write)); } - -CFX_RetainPtr<IFX_SeekableReadStream> IFGAS_Stream::MakeSeekableReadStream() { - return pdfium::MakeRetain<CFGAS_FileRead>(CFX_RetainPtr<IFGAS_Stream>(this)); -} diff --git a/xfa/fgas/crt/ifgas_stream.h b/xfa/fgas/crt/ifgas_stream.h index cfb0722b21..d8efc41afd 100644 --- a/xfa/fgas/crt/ifgas_stream.h +++ b/xfa/fgas/crt/ifgas_stream.h @@ -42,8 +42,6 @@ class IFGAS_Stream : public CFX_Retainable { virtual int32_t GetBOM(uint8_t bom[4]) const = 0; virtual uint16_t GetCodePage() const = 0; virtual uint16_t SetCodePage(uint16_t wCodePage) = 0; - - CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(); }; #endif // XFA_FGAS_CRT_IFGAS_STREAM_H_ diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp index 7abc3bccb0..fdeb2ce533 100644 --- a/xfa/fgas/font/cfgas_gefont.cpp +++ b/xfa/fgas/font/cfgas_gefont.cpp @@ -54,29 +54,6 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont( return pFont; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -// static -CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(const uint8_t* pBuffer, - int32_t iLength, - CFGAS_FontMgr* pFontMgr) { - auto pFont = pdfium::MakeRetain<CFGAS_GEFont>(pFontMgr); - if (pFont->LoadFontInternal(pBuffer, iLength)) - return nullptr; - return pFont; -} - -// static -CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont( - const CFX_RetainPtr<IFGAS_Stream>& pFontStream, - CFGAS_FontMgr* pFontMgr, - bool bSaveStream) { - auto pFont = pdfium::MakeRetain<CFGAS_GEFont>(pFontMgr); - if (!pFont->LoadFontInternal(pFontStream, bSaveStream)) - return nullptr; - return pFont; -} -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - CFGAS_GEFont::CFGAS_GEFont(CFGAS_FontMgr* pFontMgr) : #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ @@ -159,33 +136,6 @@ bool CFGAS_GEFont::LoadFontInternal(const wchar_t* pszFontFamily, return false; return InitFont(); } - -bool CFGAS_GEFont::LoadFontInternal(const uint8_t* pBuffer, int32_t length) { - if (m_pFont) - return false; - - m_pFont = new CFX_Font; - if (!m_pFont->LoadEmbedded(pBuffer, length)) - return false; - return InitFont(); -} - -bool CFGAS_GEFont::LoadFontInternal( - const CFX_RetainPtr<IFGAS_Stream>& pFontStream, - bool bSaveStream) { - if (m_pFont || m_pFileRead || !pFontStream || pFontStream->GetLength() < 1) - return false; - if (bSaveStream) - m_pStream = pFontStream; - - m_pFileRead = pFontStream->MakeSeekableReadStream(); - m_pFont = new CFX_Font; - if (!m_pFont->LoadFile(m_pFileRead)) { - m_pFileRead.Reset(); - return false; - } - return InitFont(); -} #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ bool CFGAS_GEFont::LoadFontInternal(CFX_Font* pExternalFont) { diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h index b460cee496..14029be1e0 100644 --- a/xfa/fgas/font/cfgas_gefont.h +++ b/xfa/fgas/font/cfgas_gefont.h @@ -37,15 +37,6 @@ class CFGAS_GEFont : public CFX_Retainable { static CFX_RetainPtr<CFGAS_GEFont> LoadFont( std::unique_ptr<CFX_Font> pInternalFont, CFGAS_FontMgr* pFontMgr); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - static CFX_RetainPtr<CFGAS_GEFont> LoadFont(const uint8_t* pBuffer, - int32_t iLength, - CFGAS_FontMgr* pFontMgr); - static CFX_RetainPtr<CFGAS_GEFont> LoadFont( - const CFX_RetainPtr<IFGAS_Stream>& pFontStream, - CFGAS_FontMgr* pFontMgr, - bool bSaveStream); -#endif CFX_RetainPtr<CFGAS_GEFont> Derive(uint32_t dwFontStyles, uint16_t wCodePage = 0); |