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

Unified Diff: fpdfsdk/src/fpdfview.cpp

Issue 454983003: Add FX_OVERRIDE and use it for virtual functions of FX_FINAL classes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: mark m_FileAccess private. Created 6 years, 4 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 | « fpdfsdk/src/fpdfsave.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfview.cpp
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 23d44935b544743727e3f6dd80f2d7c4c391d791..9f80ea1a71bfbfa09dddd4be278e3a56dac40e0f 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -13,34 +13,8 @@
CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess)
{
- m_FileAccess = *pFileAccess;
- m_BufferOffset = (FX_DWORD)-1;
-}
-
-FX_BOOL CPDF_CustomAccess::GetByte(FX_DWORD pos, FX_BYTE& ch)
-{
- if (pos >= m_FileAccess.m_FileLen) return FALSE;
- if (m_BufferOffset == (FX_DWORD)-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(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size)
-{
- FX_SAFE_DWORD newPos = size;
- newPos += pos;
- if (!newPos.IsValid() || newPos.ValueOrDie() > m_FileAccess.m_FileLen) {
- return FALSE;
- }
- return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, pos, pBuf, size);
+ if (pFileAccess)
+ m_FileAccess = *pFileAccess;
}
FX_BOOL CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698