summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2014-08-13 17:12:28 -0700
committerTom Sepez <tsepez@chromium.org>2014-08-13 17:12:28 -0700
commit368ed462dd6e5e63977ca2b2e56a7e83b3a3bdda (patch)
treed6e9f37c824646a245d2753fe93a8404da52dbff /core/src
parent2fd7b0be4473f4c9877fed2c2ade403c71ded395 (diff)
downloadpdfium-368ed462dd6e5e63977ca2b2e56a7e83b3a3bdda.tar.xz
Add FX_OVERRIDE and use it for virtual functions of FX_FINAL classes.
Should there be cases where this fails to compile, it indicates a mistake, either an incorrectly declared overrriden virtual method, or a method that should be declared non-virtual. The only issues were with CPDF_CustomAccess::GetBlock(), CPDF_CustomAccess::GetByte(), and CPDF_CustomAccess::GetFullPath(). These don't appear to be used anywhere, and are removed. Two members are removed that are no longer needed once those methods are removed. R=jam@chromium.org, jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/454983003
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h4
-rw-r--r--core/src/fxcrt/extension.h54
-rw-r--r--core/src/fxcrt/fx_arabic.h12
-rw-r--r--core/src/fxge/apple/apple_int.h12
4 files changed, 41 insertions, 41 deletions
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index cc7f8c8752..515b9f9242 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -409,11 +409,11 @@ private:
class CFX_GSUBTable FX_FINAL : public IFX_GSUBTable, public CFX_Object
{
public:
- virtual void Release()
+ virtual void Release() FX_OVERRIDE
{
delete this;
}
- virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum);
+ virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) FX_OVERRIDE;
CFX_CTTGSUBTable m_GsubImp;
};
#endif
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index bb2a79b9f9..c23a2e3369 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -36,27 +36,27 @@ public:
m_pFile->Release();
}
}
- virtual IFX_FileStream* Retain()
+ virtual IFX_FileStream* Retain() FX_OVERRIDE
{
m_dwCount ++;
return this;
}
- virtual void Release()
+ virtual void Release() FX_OVERRIDE
{
FX_DWORD nCount = -- m_dwCount;
if (!nCount) {
delete this;
}
}
- virtual FX_FILESIZE GetSize()
+ virtual FX_FILESIZE GetSize() FX_OVERRIDE
{
return m_bUseRange ? m_nSize : m_pFile->GetSize();
}
- virtual FX_BOOL IsEOF()
+ virtual FX_BOOL IsEOF() FX_OVERRIDE
{
return GetPosition() >= GetSize();
}
- virtual FX_FILESIZE GetPosition()
+ virtual FX_FILESIZE GetPosition() FX_OVERRIDE
{
FX_FILESIZE pos = m_pFile->GetPosition();
if (m_bUseRange) {
@@ -64,7 +64,7 @@ public:
}
return pos;
}
- virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) FX_OVERRIDE
{
if (offset < 0 || size < 0) {
return FALSE;
@@ -82,11 +82,11 @@ public:
m_pFile->SetPosition(m_nOffset);
return TRUE;
}
- virtual void ClearRange()
+ virtual void ClearRange() FX_OVERRIDE
{
m_bUseRange = FALSE;
}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
{
if (m_bUseRange && offset < 0) {
return FALSE;
@@ -101,7 +101,7 @@ public:
}
return (FX_BOOL)m_pFile->ReadPos(buffer, size, pos.ValueOrDie());
}
- virtual size_t ReadBlock(void* buffer, size_t size)
+ virtual size_t ReadBlock(void* buffer, size_t size) FX_OVERRIDE
{
if (m_bUseRange) {
FX_FILESIZE availSize = m_nOffset + m_nSize - m_pFile->GetPosition();
@@ -111,14 +111,14 @@ public:
}
return m_pFile->Read(buffer, size);
}
- virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size)
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
{
if (m_bUseRange) {
offset += m_nOffset;
}
return (FX_BOOL)m_pFile->WritePos(buffer, size, offset);
}
- virtual FX_BOOL Flush()
+ virtual FX_BOOL Flush() FX_OVERRIDE
{
return m_pFile->Flush();
}
@@ -164,12 +164,12 @@ public:
}
m_Blocks.RemoveAll();
}
- virtual IFX_FileStream* Retain()
+ virtual IFX_FileStream* Retain() FX_OVERRIDE
{
m_dwCount ++;
return this;
}
- virtual void Release()
+ virtual void Release() FX_OVERRIDE
{
FX_DWORD nCount = -- m_dwCount;
if (nCount) {
@@ -177,15 +177,15 @@ public:
}
delete this;
}
- virtual FX_FILESIZE GetSize()
+ virtual FX_FILESIZE GetSize() FX_OVERRIDE
{
return m_bUseRange ? (FX_FILESIZE) m_nSize : (FX_FILESIZE)m_nCurSize;
}
- virtual FX_BOOL IsEOF()
+ virtual FX_BOOL IsEOF() FX_OVERRIDE
{
return m_nCurPos >= (size_t)GetSize();
}
- virtual FX_FILESIZE GetPosition()
+ virtual FX_FILESIZE GetPosition() FX_OVERRIDE
{
FX_FILESIZE pos = (FX_FILESIZE)m_nCurPos;
if (m_bUseRange) {
@@ -193,7 +193,7 @@ public:
}
return pos;
}
- virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) FX_OVERRIDE
{
if (offset < 0 || size < 0) {
return FALSE;
@@ -209,11 +209,11 @@ public:
m_nCurPos = m_nOffset;
return TRUE;
}
- virtual void ClearRange()
+ virtual void ClearRange() FX_OVERRIDE
{
m_bUseRange = FALSE;
}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
{
if (!buffer || !size) {
return FALSE;
@@ -256,7 +256,7 @@ public:
}
return TRUE;
}
- virtual size_t ReadBlock(void* buffer, size_t size)
+ virtual size_t ReadBlock(void* buffer, size_t size) FX_OVERRIDE
{
if (m_nCurPos >= m_nCurSize) {
return 0;
@@ -273,7 +273,7 @@ public:
}
return nRead;
}
- virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size)
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
{
if (!buffer || !size) {
return FALSE;
@@ -333,15 +333,15 @@ public:
}
return TRUE;
}
- virtual FX_BOOL Flush()
+ virtual FX_BOOL Flush() FX_OVERRIDE
{
return TRUE;
}
- virtual FX_BOOL IsConsecutive() const
+ virtual FX_BOOL IsConsecutive() const FX_OVERRIDE
{
return m_dwFlags & FX_MEMSTREAM_Consecutive;
}
- virtual void EstimateSize(size_t nInitSize, size_t nGrowSize)
+ virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) FX_OVERRIDE
{
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
if (m_Blocks.GetSize() < 1) {
@@ -355,11 +355,11 @@ public:
m_nGrowSize = FX_MAX(nGrowSize, 4096);
}
}
- virtual FX_LPBYTE GetBuffer() const
+ virtual FX_LPBYTE GetBuffer() const FX_OVERRIDE
{
return m_Blocks.GetSize() ? (FX_LPBYTE)m_Blocks[0] : NULL;
}
- virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE)
+ virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) FX_OVERRIDE
{
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;
@@ -371,7 +371,7 @@ public:
m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
ClearRange();
}
- virtual void DetachBuffer()
+ virtual void DetachBuffer() FX_OVERRIDE
{
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;
diff --git a/core/src/fxcrt/fx_arabic.h b/core/src/fxcrt/fx_arabic.h
index 1dc275b8c3..c404449af0 100644
--- a/core/src/fxcrt/fx_arabic.h
+++ b/core/src/fxcrt/fx_arabic.h
@@ -10,18 +10,18 @@ class CFX_BidiChar FX_FINAL : public IFX_BidiChar, public CFX_Object
{
public:
CFX_BidiChar();
- virtual void Release()
+ virtual void Release() FX_OVERRIDE
{
delete this;
}
- virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE)
+ virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) FX_OVERRIDE
{
m_bSeparateNeutral = bSeparateNeutral;
}
- virtual FX_BOOL AppendChar(FX_WCHAR wch);
- virtual FX_BOOL EndChar();
- virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount);
- virtual void Reset();
+ virtual FX_BOOL AppendChar(FX_WCHAR wch) FX_OVERRIDE;
+ virtual FX_BOOL EndChar() FX_OVERRIDE;
+ virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) FX_OVERRIDE;
+ virtual void Reset() FX_OVERRIDE;
protected:
FX_BOOL m_bSeparateNeutral;
FX_INT32 m_iCurStart;
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h
index a8fbe2fbaa..e3794159b8 100644
--- a/core/src/fxge/apple/apple_int.h
+++ b/core/src/fxge/apple/apple_int.h
@@ -188,25 +188,25 @@ protected:
class CFX_FontProvider FX_FINAL : public IFX_FileRead
{
public:
- virtual void Release()
+ virtual void Release() FX_OVERRIDE
{
delete this;
}
- virtual FX_FILESIZE GetSize()
+ virtual FX_FILESIZE GetSize() FX_OVERRIDE
{
return (FX_FILESIZE)_totalSize;
}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE;
- virtual FX_BOOL IsEOF()
+ virtual FX_BOOL IsEOF() FX_OVERRIDE
{
return _offSet == _totalSize;
}
- virtual FX_FILESIZE GetPosition()
+ virtual FX_FILESIZE GetPosition() FX_OVERRIDE
{
return (FX_FILESIZE)_offSet;
}
- virtual size_t ReadBlock(void* buffer, size_t size);
+ virtual size_t ReadBlock(void* buffer, size_t size) FX_OVERRIDE;
public:
CFX_FontProvider(CGFontRef cgFont);
~CFX_FontProvider();