diff options
author | tsepez <tsepez@chromium.org> | 2016-10-21 15:04:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-21 15:04:28 -0700 |
commit | 2f2b58c45dbe369c72d29d2be89605467b082f39 (patch) | |
tree | 8bb870b02c7fcabe37c6462d5c7a64866b85ef1a /fpdfsdk/fpdfview.cpp | |
parent | 5532835aeb884642571be2f7b741b5f49f76cd64 (diff) | |
download | pdfium-2f2b58c45dbe369c72d29d2be89605467b082f39.tar.xz |
Remove dead code in CPDF_CustomAccess
Review-Url: https://chromiumcodereview.appspot.com/2441653004
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 3ab81fe112..e0c24ec792 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -175,44 +175,8 @@ FX_BOOL CFPDF_FileStream::Flush() { } #endif // PDF_ENABLE_XFA -CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess) { - m_FileAccess = *pFileAccess; -#ifdef PDF_ENABLE_XFA - m_BufferOffset = (uint32_t)-1; -#endif // PDF_ENABLE_XFA -} - -#ifdef PDF_ENABLE_XFA -CFX_ByteString CPDF_CustomAccess::GetFullPath() { - return ""; -} - -FX_BOOL CPDF_CustomAccess::GetByte(uint32_t pos, uint8_t& ch) { - if (pos >= m_FileAccess.m_FileLen) - return FALSE; - if (m_BufferOffset == (uint32_t)-1 || pos < m_BufferOffset || - pos >= m_BufferOffset + 512) { - // Need to read from file access - m_BufferOffset = pos; - int size = 512; - if (pos + 512 > m_FileAccess.m_FileLen) - size = m_FileAccess.m_FileLen - pos; - if (!m_FileAccess.m_GetBlock(m_FileAccess.m_Param, m_BufferOffset, m_Buffer, - size)) - return FALSE; - } - ch = m_Buffer[pos - m_BufferOffset]; - return TRUE; -} - -FX_BOOL CPDF_CustomAccess::GetBlock(uint32_t pos, - uint8_t* pBuf, - uint32_t size) { - if (pos + size > m_FileAccess.m_FileLen) - return FALSE; - return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, pos, pBuf, size); -} -#endif // PDF_ENABLE_XFA +CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess) + : m_FileAccess(*pFileAccess) {} FX_FILESIZE CPDF_CustomAccess::GetSize() { return m_FileAccess.m_FileLen; |