diff options
author | Lei Zhang <thestig@chromium.org> | 2015-11-19 22:09:27 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-11-19 22:09:27 -0800 |
commit | 126ba519bdd489ec6c285d1410dcae773e8ef673 (patch) | |
tree | 61390a37589c06ce01810bca631a2a7003748a91 /core/include | |
parent | 814000d7876df07a03a320f9eae8af5da7b340c5 (diff) | |
download | pdfium-126ba519bdd489ec6c285d1410dcae773e8ef673.tar.xz |
Add more overrides.
Using Chromium's clang + build options, there's more override warnings.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1453643002 .
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/fpdfapi/fpdf_resource.h | 38 | ||||
-rw-r--r-- | core/include/fxcrt/fx_stream.h | 82 |
2 files changed, 56 insertions, 64 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h index ccecce83eb..6c39e381f5 100644 --- a/core/include/fpdfapi/fpdf_resource.h +++ b/core/include/fpdfapi/fpdf_resource.h @@ -346,21 +346,23 @@ class CPDF_Type1Font : public CPDF_SimpleFont { CPDF_Type1Font(); int GetBase14Font() { return m_Base14Font; } - virtual int GlyphFromCharCodeExt(FX_DWORD charcode); protected: - virtual FX_BOOL _Load(); + // CPDF_SimpleFont: + int GlyphFromCharCodeExt(FX_DWORD charcode) override; + FX_BOOL _Load() override; + void LoadGlyphMap() override; int m_Base14Font; - virtual void LoadGlyphMap(); }; class CPDF_TrueTypeFont : public CPDF_SimpleFont { public: CPDF_TrueTypeFont(); protected: - virtual FX_BOOL _Load(); - virtual void LoadGlyphMap(); + // CPDF_SimpleFont: + FX_BOOL _Load() override; + void LoadGlyphMap() override; }; class CPDF_Type3Char { @@ -428,33 +430,33 @@ class CPDF_CIDFont : public CPDF_Font { static FX_FLOAT CIDTransformToFloat(uint8_t ch); - FX_BOOL LoadGB2312(); + // CPDF_Font: int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; int GetCharWidthF(FX_DWORD charcode, int level = 0) override; void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; - FX_WORD CIDFromCharCode(FX_DWORD charcode) const; - - FX_BOOL IsTrueType() const { return !m_bType1; } - - virtual FX_DWORD GetNextChar(const FX_CHAR* pString, - int nStrLen, - int& offset) const override; + FX_DWORD GetNextChar(const FX_CHAR* pString, + int nStrLen, + int& offset) const override; int CountChar(const FX_CHAR* pString, int size) const override; int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override; int GetCharSize(FX_DWORD charcode) const override; - const uint8_t* GetCIDTransform(FX_WORD CID) const; FX_BOOL IsVertWriting() const override; + FX_BOOL IsUnicodeCompatible() const override; + FX_BOOL _Load() override; + FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const override; + FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const override; + + FX_BOOL LoadGB2312(); + FX_WORD CIDFromCharCode(FX_DWORD charcode) const; + FX_BOOL IsTrueType() const { return !m_bType1; } + const uint8_t* GetCIDTransform(FX_WORD CID) const; short GetVertWidth(FX_WORD CID) const; void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const; - FX_BOOL IsUnicodeCompatible() const override; virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const; protected: friend class CPDF_Font; - FX_BOOL _Load() override; - FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const override; - FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const override; int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL* pVertGlyph); void LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result, diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h index 3260807940..a5599b04d0 100644 --- a/core/include/fxcrt/fx_stream.h +++ b/core/include/fxcrt/fx_stream.h @@ -62,76 +62,71 @@ class IFX_StreamWrite { virtual void Release() = 0; virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0; }; + class IFX_FileWrite : public IFX_StreamWrite { public: - virtual void Release() = 0; + // IFX_StreamWrite: + FX_BOOL WriteBlock(const void* pData, size_t size) override { + return WriteBlock(pData, GetSize(), size); + } virtual FX_FILESIZE GetSize() = 0; - virtual FX_BOOL Flush() = 0; - virtual FX_BOOL WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) = 0; - virtual FX_BOOL WriteBlock(const void* pData, size_t size) { - return WriteBlock(pData, GetSize(), size); - } }; + class IFX_StreamRead { public: virtual ~IFX_StreamRead() {} virtual void Release() = 0; - virtual FX_BOOL IsEOF() = 0; - virtual FX_FILESIZE GetPosition() = 0; - virtual size_t ReadBlock(void* buffer, size_t size) = 0; }; + class IFX_FileRead : IFX_StreamRead { public: - virtual void Release() = 0; - - virtual FX_FILESIZE GetSize() = 0; - - virtual FX_BOOL IsEOF() { return FALSE; } - - virtual FX_FILESIZE GetPosition() { return 0; } + // IFX_StreamRead: + void Release() override = 0; + FX_BOOL IsEOF() override { return FALSE; } + FX_FILESIZE GetPosition() override { return 0; } + size_t ReadBlock(void* buffer, size_t size) override { return 0; } virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; - - virtual size_t ReadBlock(void* buffer, size_t size) { return 0; } + virtual FX_FILESIZE GetSize() = 0; }; + IFX_FileRead* FX_CreateFileRead(const FX_CHAR* filename); IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename); + class IFX_FileStream : public IFX_FileRead, public IFX_FileWrite { public: virtual IFX_FileStream* Retain() = 0; - virtual void Release() = 0; - - virtual FX_FILESIZE GetSize() = 0; - - virtual FX_BOOL IsEOF() = 0; - - virtual FX_FILESIZE GetPosition() = 0; - - virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; - - virtual size_t ReadBlock(void* buffer, size_t size) = 0; - - virtual FX_BOOL WriteBlock(const void* buffer, - FX_FILESIZE offset, - size_t size) = 0; - virtual FX_BOOL WriteBlock(const void* buffer, size_t size) { + // IFX_FileRead: + void Release() override = 0; + FX_BOOL IsEOF() override = 0; + FX_FILESIZE GetPosition() override = 0; + size_t ReadBlock(void* buffer, size_t size) override = 0; + FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override = 0; + FX_FILESIZE GetSize() override = 0; + + // IFX_FileWrite: + FX_BOOL WriteBlock(const void* buffer, + FX_FILESIZE offset, + size_t size) override = 0; + FX_BOOL WriteBlock(const void* buffer, size_t size) override { return WriteBlock(buffer, GetSize(), size); } - - virtual FX_BOOL Flush() = 0; + FX_BOOL Flush() override = 0; }; + IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes); IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes); + class IFX_MemoryStream : public IFX_FileStream { public: virtual FX_BOOL IsConsecutive() const = 0; @@ -152,20 +147,15 @@ IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive = FALSE); class IFX_BufferRead : public IFX_StreamRead { public: - virtual void Release() = 0; - - virtual FX_BOOL IsEOF() = 0; - - virtual FX_FILESIZE GetPosition() = 0; - - virtual size_t ReadBlock(void* buffer, size_t size) = 0; + // IFX_StreamRead: + void Release() override = 0; + FX_BOOL IsEOF() override = 0; + FX_FILESIZE GetPosition() override = 0; + size_t ReadBlock(void* buffer, size_t size) override = 0; virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; - virtual const uint8_t* GetBlockBuffer() = 0; - virtual size_t GetBlockSize() = 0; - virtual FX_FILESIZE GetBlockOffset() = 0; }; |