summaryrefslogtreecommitdiff
path: root/core/include
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/include
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/include')
-rw-r--r--core/include/fpdfapi/fpdf_parser.h32
-rw-r--r--core/include/fxcrt/fx_system.h4
2 files changed, 20 insertions, 16 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index feac6c67dc..7cab2117a2 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -413,9 +413,9 @@ public:
void CloseParser(FX_BOOL bReParse = FALSE);
- virtual FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE);
+ virtual FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE) FX_OVERRIDE;
- virtual FX_BOOL IsOwner();
+ virtual FX_BOOL IsOwner() FX_OVERRIDE;
void SetPassword(const FX_CHAR* password)
{
@@ -463,16 +463,16 @@ public:
return &m_Trailers;
}
- virtual FX_DWORD GetRootObjNum();
- virtual FX_DWORD GetInfoObjNum();
- virtual CPDF_Array* GetIDArray();
- virtual CPDF_Dictionary* GetEncryptDict()
+ virtual FX_DWORD GetRootObjNum() FX_OVERRIDE;
+ virtual FX_DWORD GetInfoObjNum() FX_OVERRIDE;
+ virtual CPDF_Array* GetIDArray() FX_OVERRIDE;
+ virtual CPDF_Dictionary* GetEncryptDict() FX_OVERRIDE
{
return m_pEncryptDict;
}
- virtual CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL);
- virtual FX_DWORD GetLastObjNum();
- virtual FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm);
+ virtual CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL) FX_OVERRIDE;
+ virtual FX_DWORD GetLastObjNum() FX_OVERRIDE;
+ virtual FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) FX_OVERRIDE;
FX_FILESIZE GetObjectOffset(FX_DWORD objnum);
@@ -952,24 +952,24 @@ public:
CPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRead);
~CPDF_DataAvail();
- virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints);
+ virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) FX_OVERRIDE;
- virtual void SetDocument(CPDF_Document* pDoc);
+ virtual void SetDocument(CPDF_Document* pDoc) FX_OVERRIDE;
- virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints);
+ virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) FX_OVERRIDE;
- virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints);
+ virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints) FX_OVERRIDE;
- virtual FX_INT32 IsLinearizedPDF();
+ virtual FX_INT32 IsLinearizedPDF() FX_OVERRIDE;
- virtual FX_BOOL IsLinearized()
+ virtual FX_BOOL IsLinearized() FX_OVERRIDE
{
return m_bLinearized;
}
- virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize);
+ virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) FX_OVERRIDE;
IFX_FileRead* GetFileRead() const
{
return m_pFileRead;
diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h
index 6d659e2c10..36050f35dc 100644
--- a/core/include/fxcrt/fx_system.h
+++ b/core/include/fxcrt/fx_system.h
@@ -280,13 +280,17 @@ int FXSYS_round(FX_FLOAT f);
typedef base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD;
typedef base::CheckedNumeric<FX_INT32> FX_SAFE_INT32;
typedef base::CheckedNumeric<size_t> FX_SAFE_SIZE_T;
+
#if defined(__clang__) || _MSC_VER >= 1700
#define FX_FINAL final
+#define FX_OVERRIDE override
#elif defined(__GNUC__) && __cplusplus >= 201103 && \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
#define FX_FINAL final
+#define FX_OVERRIDE override
#else
#define FX_FINAL
+#define FX_OVERRIDE
#endif
#endif
#endif