Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: fpdfsdk/fpdfview.cpp

Issue 2441653004: Remove dead code in CPDF_CustomAccess (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/fsdk_define.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfview.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 3ab81fe1124321bd4f4e355aad20bdc1310eab5a..e0c24ec792ee43d997aea570b87caa00bcd6b3aa 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;
« no previous file with comments | « no previous file | fpdfsdk/fsdk_define.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698