summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 14:07:43 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 14:07:43 -0700
commitc2c3f7b5f0396409451a9d344f35ec1929a76e9f (patch)
treeb1c696afdca13e8087e18014b19a6c82415f72d5 /core/include
parentc6540e037ed1a9546d5a90455bf440a24b181ab4 (diff)
downloadpdfium-c2c3f7b5f0396409451a9d344f35ec1929a76e9f.tar.xz
Use override in more classes in core/
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1292613003 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfapi/fpdf_pageobj.h16
-rw-r--r--core/include/fpdfapi/fpdf_parser.h66
-rw-r--r--core/include/fpdfapi/fpdf_resource.h4
-rw-r--r--core/include/fpdfdoc/fpdf_ap.h27
-rw-r--r--core/include/fpdfdoc/fpdf_doc.h6
-rw-r--r--core/include/fpdfdoc/fpdf_vt.h4
-rw-r--r--core/include/fxge/fpf.h10
-rw-r--r--core/include/fxge/fx_dib.h91
-rw-r--r--core/include/fxge/fx_font.h8
-rw-r--r--core/include/fxge/fx_ge.h16
10 files changed, 125 insertions, 123 deletions
diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h
index be81244ef4..7ea51cc814 100644
--- a/core/include/fpdfapi/fpdf_pageobj.h
+++ b/core/include/fpdfapi/fpdf_pageobj.h
@@ -70,9 +70,7 @@ class CPDF_Path : public CFX_CountRef<CFX_PathData> {
class CPDF_ClipPathData {
public:
CPDF_ClipPathData();
-
CPDF_ClipPathData(const CPDF_ClipPathData&);
-
~CPDF_ClipPathData();
void SetCount(int path_count, int text_count);
@@ -88,6 +86,7 @@ class CPDF_ClipPathData {
CPDF_TextObject** m_pTextList;
};
+
class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData> {
public:
FX_DWORD GetPathCount() const { return m_pObject->m_PathCount; }
@@ -492,12 +491,14 @@ class CPDF_TextObject : public CPDF_PageObject {
class CPDF_PathObject : public CPDF_PageObject {
public:
CPDF_PathObject() { m_Type = PDFPAGE_PATH; }
+ ~CPDF_PathObject() override {}
- virtual ~CPDF_PathObject() {}
void Transform(const CFX_AffineMatrix& maxtrix) override;
void SetGraphState(CPDF_GraphState GraphState);
+ void CalcBoundingBox();
+
CPDF_Path m_Path;
int m_FillType;
@@ -506,8 +507,6 @@ class CPDF_PathObject : public CPDF_PageObject {
CFX_AffineMatrix m_Matrix;
- void CalcBoundingBox();
-
protected:
void CopyData(const CPDF_PageObject* pSrcObject) override;
};
@@ -515,8 +514,8 @@ class CPDF_PathObject : public CPDF_PageObject {
class CPDF_ImageObject : public CPDF_PageObject {
public:
CPDF_ImageObject();
+ ~CPDF_ImageObject() override;
- virtual ~CPDF_ImageObject();
void Transform(const CFX_AffineMatrix& matrix) override;
CPDF_Image* m_pImage;
@@ -532,8 +531,7 @@ class CPDF_ImageObject : public CPDF_PageObject {
class CPDF_ShadingObject : public CPDF_PageObject {
public:
CPDF_ShadingObject();
-
- virtual ~CPDF_ShadingObject();
+ ~CPDF_ShadingObject() override;
CPDF_ShadingPattern* m_pShading;
@@ -553,8 +551,8 @@ class CPDF_FormObject : public CPDF_PageObject {
m_Type = PDFPAGE_FORM;
m_pForm = NULL;
}
+ ~CPDF_FormObject() override;
- virtual ~CPDF_FormObject();
void Transform(const CFX_AffineMatrix& matrix) override;
CPDF_Form* m_pForm;
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index cb4e15e25d..a83cec194c 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -547,17 +547,18 @@ class CPDF_SecurityHandler {
class CPDF_StandardSecurityHandler : public CPDF_SecurityHandler {
public:
CPDF_StandardSecurityHandler();
-
- virtual ~CPDF_StandardSecurityHandler();
- virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict);
- virtual FX_DWORD GetPermissions();
- virtual FX_BOOL IsOwner() { return m_bOwner; }
- virtual FX_BOOL GetCryptInfo(int& cipher,
- const uint8_t*& buffer,
- int& keylen);
- virtual FX_BOOL IsMetadataEncrypted();
- virtual CPDF_CryptoHandler* CreateCryptoHandler();
- virtual CPDF_StandardSecurityHandler* GetStandardHandler() { return this; }
+ ~CPDF_StandardSecurityHandler() override;
+
+ // CPDF_SecurityHandler
+ FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) override;
+ FX_DWORD GetPermissions() override;
+ FX_BOOL IsOwner() override { return m_bOwner; }
+ FX_BOOL GetCryptInfo(int& cipher,
+ const uint8_t*& buffer,
+ int& keylen) override;
+ FX_BOOL IsMetadataEncrypted() override;
+ CPDF_CryptoHandler* CreateCryptoHandler() override;
+ CPDF_StandardSecurityHandler* GetStandardHandler() override { return this; }
void OnCreate(CPDF_Dictionary* pEncryptDict,
CPDF_Array* pIdArray,
@@ -683,29 +684,30 @@ class CPDF_CryptoHandler {
class CPDF_StandardCryptoHandler : public CPDF_CryptoHandler {
public:
CPDF_StandardCryptoHandler();
-
- virtual ~CPDF_StandardCryptoHandler();
+ ~CPDF_StandardCryptoHandler() override;
+
+ // CPDF_CryptoHandler
+ FX_BOOL Init(CPDF_Dictionary* pEncryptDict,
+ CPDF_SecurityHandler* pSecurityHandler) override;
+ FX_DWORD DecryptGetSize(FX_DWORD src_size) override;
+ void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) override;
+ FX_BOOL DecryptStream(void* context,
+ const uint8_t* src_buf,
+ FX_DWORD src_size,
+ CFX_BinaryBuf& dest_buf) override;
+ FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) override;
+ FX_DWORD EncryptGetSize(FX_DWORD objnum,
+ FX_DWORD version,
+ const uint8_t* src_buf,
+ FX_DWORD src_size) override;
+ FX_BOOL EncryptContent(FX_DWORD objnum,
+ FX_DWORD version,
+ const uint8_t* src_buf,
+ FX_DWORD src_size,
+ uint8_t* dest_buf,
+ FX_DWORD& dest_size) override;
FX_BOOL Init(int cipher, const uint8_t* key, int keylen);
- virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict,
- CPDF_SecurityHandler* pSecurityHandler);
- virtual FX_DWORD DecryptGetSize(FX_DWORD src_size);
- virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum);
- virtual FX_BOOL DecryptStream(void* context,
- const uint8_t* src_buf,
- FX_DWORD src_size,
- CFX_BinaryBuf& dest_buf);
- virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf);
- virtual FX_DWORD EncryptGetSize(FX_DWORD objnum,
- FX_DWORD version,
- const uint8_t* src_buf,
- FX_DWORD src_size);
- virtual FX_BOOL EncryptContent(FX_DWORD objnum,
- FX_DWORD version,
- const uint8_t* src_buf,
- FX_DWORD src_size,
- uint8_t* dest_buf,
- FX_DWORD& dest_size);
protected:
virtual void CryptBlock(FX_BOOL bEncrypt,
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index c41a306d54..5b6f3498fe 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -664,7 +664,7 @@ class CPDF_TilingPattern : public CPDF_Pattern {
CPDF_Object* pPatternObj,
const CFX_AffineMatrix* parentMatrix);
- virtual ~CPDF_TilingPattern();
+ ~CPDF_TilingPattern() override;
FX_BOOL Load();
@@ -685,7 +685,7 @@ class CPDF_ShadingPattern : public CPDF_Pattern {
FX_BOOL bShading,
const CFX_AffineMatrix* parentMatrix);
- virtual ~CPDF_ShadingPattern();
+ ~CPDF_ShadingPattern() override;
CPDF_Object* m_pShadingObj;
diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h
index 43452fdb47..305834e96a 100644
--- a/core/include/fpdfdoc/fpdf_ap.h
+++ b/core/include/fpdfdoc/fpdf_ap.h
@@ -51,20 +51,19 @@ struct CPVT_Color {
class CPVT_Provider : public IPDF_VariableText_Provider {
public:
CPVT_Provider(IPVT_FontMap* pFontMap);
-
- virtual ~CPVT_Provider();
-
- int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle);
-
- int32_t GetTypeAscent(int32_t nFontIndex);
-
- int32_t GetTypeDescent(int32_t nFontIndex);
-
- int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex);
-
- FX_BOOL IsLatinWord(FX_WORD word);
-
- int32_t GetDefaultFontIndex();
+ ~CPVT_Provider() override;
+
+ // IPDF_VariableText_Provider
+ int32_t GetCharWidth(int32_t nFontIndex,
+ FX_WORD word,
+ int32_t nWordStyle) override;
+ int32_t GetTypeAscent(int32_t nFontIndex) override;
+ int32_t GetTypeDescent(int32_t nFontIndex) override;
+ int32_t GetWordFontIndex(FX_WORD word,
+ int32_t charset,
+ int32_t nFontIndex) override;
+ FX_BOOL IsLatinWord(FX_WORD word) override;
+ int32_t GetDefaultFontIndex() override;
private:
IPVT_FontMap* m_pFontMap;
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index 7b430642d5..e0c6d337ca 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -132,14 +132,13 @@ class CPDF_OCContext : public IPDF_OCContext {
enum UsageType { View = 0, Design, Print, Export };
CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View);
-
- virtual ~CPDF_OCContext();
+ ~CPDF_OCContext() override;
CPDF_Document* GetDocument() const { return m_pDocument; }
UsageType GetUsageType() const { return m_eUsageType; }
- FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict);
+ FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict) override;
void ResetOCContext();
@@ -589,7 +588,6 @@ class CPDF_DefaultAppearance {
class CPDF_InterForm : public CFX_PrivateData {
public:
CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bUpdateAP);
-
~CPDF_InterForm();
static void EnableUpdateAP(FX_BOOL bUpdateAP);
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index 62a6019793..141b3c6a1c 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -448,8 +448,8 @@ class IPDF_VariableText {
virtual void UpdateWordPlace(CPVT_WordPlace& place) const = 0;
- virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace& place,
- FX_BOOL bPrevOrNext) const = 0;
+ virtual CPVT_WordPlace AdjustLineHeader(const CPVT_WordPlace& place,
+ FX_BOOL bPrevOrNext) const = 0;
virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const = 0;
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h
index efa001e916..e65fae0bbd 100644
--- a/core/include/fxge/fpf.h
+++ b/core/include/fxge/fpf.h
@@ -9,18 +9,21 @@
#include "../fxcrt/fx_coordinates.h"
-class IFPF_DeviceModule;
class IFPF_FontMgr;
-class IFPF_Font;
+
class IFPF_DeviceModule {
public:
virtual ~IFPF_DeviceModule() {}
virtual void Destroy() = 0;
virtual IFPF_FontMgr* GetFontMgr() = 0;
};
+
IFPF_DeviceModule* FPF_GetDeviceModule();
+
#define FPF_MATCHFONT_REPLACEANSI 1
+
typedef struct FPF_HFONT_ { void* pData; } * FPF_HFONT;
+
class IFPF_Font {
public:
virtual void Release() = 0;
@@ -47,8 +50,9 @@ class IFPF_Font {
FX_DWORD dwSize) = 0;
protected:
- ~IFPF_Font() {}
+ virtual ~IFPF_Font() {}
};
+
class IFPF_FontMgr {
public:
virtual ~IFPF_FontMgr() {}
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index ddc47d3db5..818aaac520 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -69,6 +69,8 @@ typedef FX_DWORD FX_CMYK;
class CFX_ClipRgn;
class CFX_DIBSource;
class CFX_DIBitmap;
+class CStretchEngine;
+
#define FXSYS_RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))
#define FXSYS_GetRValue(rgb) ((rgb)&0xff)
#define FXSYS_GetGValue(rgb) (((rgb) >> 8) & 0xff)
@@ -281,11 +283,9 @@ class CFX_DIBSource {
};
class CFX_DIBitmap : public CFX_DIBSource {
public:
- virtual ~CFX_DIBitmap();
-
CFX_DIBitmap();
-
- CFX_DIBitmap(const CFX_DIBitmap& src);
+ explicit CFX_DIBitmap(const CFX_DIBitmap& src);
+ ~CFX_DIBitmap() override;
FX_BOOL Create(int width,
int height,
@@ -295,19 +295,18 @@ class CFX_DIBitmap : public CFX_DIBSource {
FX_BOOL Copy(const CFX_DIBSource* pSrc);
- virtual uint8_t* GetBuffer() const { return m_pBuffer; }
-
- virtual const uint8_t* GetScanline(int line) const {
+ // CFX_DIBSource
+ uint8_t* GetBuffer() const override { return m_pBuffer; }
+ const uint8_t* GetScanline(int line) const override {
return m_pBuffer ? m_pBuffer + line * m_Pitch : NULL;
}
-
- virtual void DownSampleScanline(int line,
- uint8_t* dest_scan,
- int dest_bpp,
- int dest_width,
- FX_BOOL bFlipX,
- int clip_left,
- int clip_width) const;
+ void DownSampleScanline(int line,
+ uint8_t* dest_scan,
+ int dest_bpp,
+ int dest_width,
+ FX_BOOL bFlipX,
+ int clip_left,
+ int clip_width) const override;
void TakeOver(CFX_DIBitmap* pSrcBitmap);
@@ -407,12 +406,12 @@ class CFX_DIBExtractor {
private:
CFX_DIBitmap* m_pBitmap;
};
+
typedef CFX_CountRef<CFX_DIBitmap> CFX_DIBitmapRef;
class CFX_FilteredDIB : public CFX_DIBSource {
public:
CFX_FilteredDIB();
-
- ~CFX_FilteredDIB();
+ ~CFX_FilteredDIB() override;
void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE);
@@ -429,14 +428,15 @@ class CFX_FilteredDIB : public CFX_DIBSource {
int Bpp) const = 0;
protected:
- virtual const uint8_t* GetScanline(int line) const;
- virtual void DownSampleScanline(int line,
- uint8_t* dest_scan,
- int dest_bpp,
- int dest_width,
- FX_BOOL bFlipX,
- int clip_left,
- int clip_width) const;
+ // CFX_DIBSource
+ const uint8_t* GetScanline(int line) const override;
+ void DownSampleScanline(int line,
+ uint8_t* dest_scan,
+ int dest_bpp,
+ int dest_width,
+ FX_BOOL bFlipX,
+ int clip_left,
+ int clip_width) const override;
const CFX_DIBSource* m_pSrc;
@@ -444,6 +444,7 @@ class CFX_FilteredDIB : public CFX_DIBSource {
uint8_t* m_pScanline;
};
+
class IFX_ScanlineComposer {
public:
virtual ~IFX_ScanlineComposer() {}
@@ -514,11 +515,11 @@ class CFX_ScanlineCompositor {
int m_CacheSize;
FX_BOOL m_bRgbByteOrder;
};
+
class CFX_BitmapComposer : public IFX_ScanlineComposer {
public:
CFX_BitmapComposer();
-
- ~CFX_BitmapComposer();
+ ~CFX_BitmapComposer() override;
void Compose(CFX_DIBitmap* pDest,
const CFX_ClipRgn* pClipRgn,
@@ -533,14 +534,15 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer {
void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL);
- virtual FX_BOOL SetInfo(int width,
- int height,
- FXDIB_Format src_format,
- FX_DWORD* pSrcPalette);
+ // IFX_ScanlineComposer
+ FX_BOOL SetInfo(int width,
+ int height,
+ FXDIB_Format src_format,
+ FX_DWORD* pSrcPalette) override;
- virtual void ComposeScanline(int line,
- const uint8_t* scanline,
- const uint8_t* scan_extra_alpha);
+ void ComposeScanline(int line,
+ const uint8_t* scanline,
+ const uint8_t* scan_extra_alpha) override;
protected:
void DoCompose(uint8_t* dest_scan,
@@ -569,20 +571,21 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer {
uint8_t* m_pAddClipScan;
uint8_t* m_pScanlineAlphaV;
};
+
class CFX_BitmapStorer : public IFX_ScanlineComposer {
public:
CFX_BitmapStorer();
+ ~CFX_BitmapStorer() override;
- ~CFX_BitmapStorer();
+ // IFX_ScanlineComposer
+ void ComposeScanline(int line,
+ const uint8_t* scanline,
+ const uint8_t* scan_extra_alpha) override;
- virtual void ComposeScanline(int line,
- const uint8_t* scanline,
- const uint8_t* scan_extra_alpha);
-
- virtual FX_BOOL SetInfo(int width,
- int height,
- FXDIB_Format src_format,
- FX_DWORD* pSrcPalette);
+ FX_BOOL SetInfo(int width,
+ int height,
+ FXDIB_Format src_format,
+ FX_DWORD* pSrcPalette) override;
CFX_DIBitmap* GetBitmap() { return m_pBitmap; }
@@ -593,7 +596,7 @@ class CFX_BitmapStorer : public IFX_ScanlineComposer {
private:
CFX_DIBitmap* m_pBitmap;
};
-class CStretchEngine;
+
class CFX_ImageStretcher {
public:
CFX_ImageStretcher();
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 50cbba8e26..ce06a8ac5f 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -244,7 +244,7 @@ class IFX_AdditionalFontEnum {
};
class CFX_FontMapper {
public:
- CFX_FontMapper(CFX_FontMgr* mgr);
+ explicit CFX_FontMapper(CFX_FontMgr* mgr);
~CFX_FontMapper();
void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
@@ -283,6 +283,7 @@ class CFX_FontMapper {
IFX_FontEnumerator* m_pFontEnumerator;
CFX_FontMgr* const m_pFontMgr;
};
+
class IFX_SystemFontInfo {
public:
static IFX_SystemFontInfo* CreateDefault(const char** pUserPaths);
@@ -307,12 +308,13 @@ class IFX_SystemFontInfo {
virtual void* RetainFont(void* hFont) { return NULL; }
protected:
- ~IFX_SystemFontInfo() {}
+ virtual ~IFX_SystemFontInfo() {}
};
+
class CFX_FolderFontInfo : public IFX_SystemFontInfo {
public:
CFX_FolderFontInfo();
- virtual ~CFX_FolderFontInfo();
+ ~CFX_FolderFontInfo() override;
void AddPath(const CFX_ByteStringC& path);
// IFX_SytemFontInfo:
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index ef3c8f665e..4cfe622007 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -10,17 +10,12 @@
#include "fx_dib.h"
#include "fx_font.h"
-class CFX_ClipRgn;
-class CFX_PathData;
-class CFX_GraphStateData;
class CFX_Font;
class CFX_FontMgr;
class CFX_FontCache;
class CFX_FaceCache;
-class CFX_RenderDevice;
class IFX_RenderDeviceDriver;
class CCodec_ModuleMgr;
-class IFXG_PaintModuleMgr;
class CFX_GEModule {
public:
@@ -435,8 +430,7 @@ class CFX_RenderDevice {
class CFX_FxgeDevice : public CFX_RenderDevice {
public:
CFX_FxgeDevice();
-
- ~CFX_FxgeDevice();
+ ~CFX_FxgeDevice() override;
FX_BOOL Attach(CFX_DIBitmap* pBitmap,
int dither_bits = 0,
@@ -456,8 +450,7 @@ class CFX_FxgeDevice : public CFX_RenderDevice {
class CFX_SkiaDevice : public CFX_RenderDevice {
public:
CFX_SkiaDevice();
-
- ~CFX_SkiaDevice();
+ ~CFX_SkiaDevice() override;
FX_BOOL Attach(CFX_DIBitmap* pBitmap,
int dither_bits = 0,
@@ -474,6 +467,7 @@ class CFX_SkiaDevice : public CFX_RenderDevice {
protected:
FX_BOOL m_bOwnedBitmap;
};
+
class IFX_RenderDeviceDriver {
public:
static IFX_RenderDeviceDriver* CreateFxgeDriver(
@@ -613,14 +607,16 @@ class IFX_RenderDeviceDriver {
virtual void ClearDriver() {}
};
+
class IFX_PSOutput {
public:
virtual void Release() = 0;
virtual void OutputPS(const FX_CHAR* string, int len) = 0;
protected:
- ~IFX_PSOutput() {}
+ virtual ~IFX_PSOutput() {}
};
+
class CPSFont;
class CFX_PSRenderer {
public: