summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-01-09 11:46:17 -0800
committerTom Sepez <tsepez@chromium.org>2015-01-09 11:46:17 -0800
commite5b59cacbb7ed6bcefe25d736a315753dd764594 (patch)
tree973eb3e80739558ba3c06f8b06358bfb1c79581c
parent1c83be6bedb4dceb06ef7e8e6a5d76105d0fff4d (diff)
downloadpdfium-e5b59cacbb7ed6bcefe25d736a315753dd764594.tar.xz
merge to XFA: Fix -Wnon-virtual-dtor compiler warnings.
Original at URL: https://codereview.chromium.org/810883005 Note that the new code in XFA introduces many more of these, to be handled separately. TBR=brucedawson@chromium.org TBR=thestig@chromium.org BUG=https://code.google.com/p/pdfium/issues/detail?id=102 Review URL: https://codereview.chromium.org/842223004
-rw-r--r--core/include/fpdfapi/fpdf_parser.h17
-rw-r--r--core/include/fpdfapi/fpdf_render.h2
-rw-r--r--core/include/fpdfdoc/fpdf_ap.h3
-rw-r--r--core/include/fpdfdoc/fpdf_tagged.h1
-rw-r--r--core/include/fpdfdoc/fpdf_vt.h7
-rw-r--r--core/include/fxcodec/fx_codec_provider.h4
-rw-r--r--core/include/fxcrt/fx_arb.h3
-rw-r--r--core/include/fxcrt/fx_basic.h6
-rw-r--r--core/include/fxcrt/fx_stream.h4
-rw-r--r--core/include/fxge/fpf.h5
-rw-r--r--core/include/fxge/fx_dib.h3
-rw-r--r--core/include/fxge/fx_font.h8
-rw-r--r--core/include/fxge/fx_ge.h6
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h5
-rw-r--r--core/src/fpdfdoc/tagged_int.h9
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Module.h1
-rw-r--r--core/src/fxcrt/fx_arabic.h4
-rw-r--r--fpdfsdk/include/fsdk_annothandler.h22
-rw-r--r--fpdfsdk/include/fxedit/fx_edit.h26
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h9
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Edit.h1
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_EditCtrl.h1
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_IconList.h1
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Note.h3
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Wnd.h4
-rw-r--r--fpdfsdk/src/fpdf_sysfontinfo.cpp3
27 files changed, 108 insertions, 52 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index da22dc72ca..d2fdad4cfb 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -49,7 +49,7 @@ class CFX_PrivateData;
class IPDF_EnumPageHandler
{
public:
-
+ virtual ~IPDF_EnumPageHandler() { }
virtual FX_BOOL EnumPage(CPDF_Dictionary* pPageDict) = 0;
};
class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjects
@@ -247,8 +247,7 @@ class CPDF_SyntaxParser : public CFX_Object
public:
CPDF_SyntaxParser();
-
- ~CPDF_SyntaxParser();
+ virtual ~CPDF_SyntaxParser();
void InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOffset);
@@ -366,7 +365,7 @@ struct PARSE_CONTEXT {
class IPDF_DocParser : public CFX_Object
{
public:
-
+ virtual ~IPDF_DocParser() { }
virtual FX_DWORD GetRootObjNum() = 0;
virtual FX_DWORD GetInfoObjNum() = 0;
@@ -402,8 +401,7 @@ class CPDF_Parser FX_FINAL : public IPDF_DocParser
public:
CPDF_Parser();
-
- ~CPDF_Parser();
+ ~CPDF_Parser() override;
FX_DWORD StartParse(FX_LPCSTR filename, FX_BOOL bReParse = FALSE);
@@ -853,13 +851,13 @@ protected:
class IFX_FileAvail
{
public:
-
+ virtual ~IFX_FileAvail() { }
virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0;
};
class IFX_DownloadHints
{
public:
-
+ virtual ~IFX_DownloadHints() { }
virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0;
};
#define PDF_IS_LINEARIZED 1
@@ -871,13 +869,12 @@ public:
class IPDF_DataAvail
{
public:
+ virtual ~IPDF_DataAvail() { }
virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) = 0;
-
virtual void SetDocument(CPDF_Document* pDoc) = 0;
-
virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
virtual FX_BOOL IsLinearized() = 0;
diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h
index c059bedb2b..e2801f61f2 100644
--- a/core/include/fpdfapi/fpdf_render.h
+++ b/core/include/fpdfapi/fpdf_render.h
@@ -138,7 +138,7 @@ protected:
class IPDF_BackgroundDraw
{
public:
-
+ virtual ~IPDF_BackgroundDraw() { }
virtual void OnDrawBackground(
CFX_RenderDevice* pBitmapDevice,
const CFX_AffineMatrix* pOriginal2Bitmap
diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h
index 78f9676221..02bbf249c4 100644
--- a/core/include/fpdfdoc/fpdf_ap.h
+++ b/core/include/fpdfdoc/fpdf_ap.h
@@ -13,9 +13,8 @@
class IPVT_FontMap
{
public:
-
+ virtual ~IPVT_FontMap() { }
virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex) = 0;
-
virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0;
};
struct CPVT_Dash {
diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h
index f3ab01ea28..1a2a5d4ffa 100644
--- a/core/include/fpdfdoc/fpdf_tagged.h
+++ b/core/include/fpdfdoc/fpdf_tagged.h
@@ -68,6 +68,7 @@ struct CPDF_StructKid {
class CPDF_StructElement : public CFX_Object
{
public:
+ virtual ~CPDF_StructElement() { }
virtual CPDF_StructTree* GetTree() const = 0;
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index 41025cbe2e..3e23c3a1a3 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -275,6 +275,7 @@ struct CPVT_Section {
class IPDF_VariableText_Provider
{
public:
+ virtual ~IPDF_VariableText_Provider() { }
virtual FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) = 0;
@@ -291,6 +292,7 @@ public:
class IPDF_VariableText_Iterator
{
public:
+ virtual ~IPDF_VariableText_Iterator() { }
virtual FX_BOOL NextWord() = 0;
@@ -323,11 +325,9 @@ public:
class IPDF_VariableText
{
public:
-
static IPDF_VariableText* NewVariableText();
static void DelVariableText(IPDF_VariableText* pVT);
-public:
virtual IPDF_VariableText_Provider* SetProvider(IPDF_VariableText_Provider * pProvider) = 0;
@@ -440,5 +440,8 @@ public:
virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0;
+
+protected:
+ ~IPDF_VariableText() { }
};
#endif
diff --git a/core/include/fxcodec/fx_codec_provider.h b/core/include/fxcodec/fx_codec_provider.h
index f26194a14e..00792ff2ad 100644
--- a/core/include/fxcodec/fx_codec_provider.h
+++ b/core/include/fxcodec/fx_codec_provider.h
@@ -10,7 +10,6 @@ class CFX_DIBAttribute;
class IFX_JpegProvider
{
public:
-
virtual void Release() = 0;
virtual void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
@@ -49,5 +48,8 @@ public:
virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+
+protected:
+ ~IFX_JpegProvider() { }
};
#endif
diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h
index ed0370ff74..a1dc231a8d 100644
--- a/core/include/fxcrt/fx_arb.h
+++ b/core/include/fxcrt/fx_arb.h
@@ -64,5 +64,8 @@ public:
virtual FX_BOOL EndChar() = 0;
virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) = 0;
virtual void Reset() = 0;
+
+protected:
+ ~IFX_BidiChar() { }
};
#endif
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 2a77e6e947..1c828cea48 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -240,7 +240,7 @@ class IFX_BufferArchive
{
public:
IFX_BufferArchive(FX_STRSIZE size);
-
+ virtual ~IFX_BufferArchive() { }
virtual void Clear();
@@ -271,7 +271,7 @@ class CFX_FileBufferArchive : public IFX_BufferArchive, public CFX_Object
{
public:
CFX_FileBufferArchive(FX_STRSIZE size = 32768);
- ~CFX_FileBufferArchive();
+ ~CFX_FileBufferArchive() override;
virtual void Clear();
FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE);
@@ -1377,7 +1377,7 @@ protected:
class IFX_Pause
{
public:
-
+ virtual ~IFX_Pause() { }
virtual FX_BOOL NeedToPauseNow() = 0;
};
class CFX_DataFilter : public CFX_Object
diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h
index 0a3d1c4609..2e02f0c865 100644
--- a/core/include/fxcrt/fx_stream.h
+++ b/core/include/fxcrt/fx_stream.h
@@ -65,7 +65,7 @@ FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst);
class IFX_StreamWrite
{
public:
-
+ virtual ~IFX_StreamWrite() { }
virtual void Release() = 0;
virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0;
@@ -91,6 +91,7 @@ IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename);
class IFX_StreamRead
{
public:
+ virtual ~IFX_StreamRead() { }
virtual void Release() = 0;
@@ -103,7 +104,6 @@ public:
class IFX_FileRead : IFX_StreamRead
{
public:
-
virtual void Release() = 0;
virtual FX_FILESIZE GetSize() = 0;
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h
index 99d9b7c999..28d028cfbb 100644
--- a/core/include/fxge/fpf.h
+++ b/core/include/fxge/fpf.h
@@ -12,6 +12,7 @@ class IFPF_Font;
class IFPF_DeviceModule
{
public:
+ virtual ~IFPF_DeviceModule() { }
virtual void Destroy() = 0;
virtual IFPF_FontMgr* GetFontMgr() = 0;
};
@@ -41,10 +42,14 @@ public:
virtual FX_INT32 GetHeight() const = 0;
virtual FX_INT32 GetItalicAngle() const = 0;
virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize) = 0;
+
+protected:
+ ~IFPF_Font() { }
};
class IFPF_FontMgr
{
public:
+ virtual ~IFPF_FontMgr() { }
virtual void LoadSystemFonts() = 0;
virtual void LoadPrivateFont(IFX_FileRead* pFontFile) = 0;
virtual void LoadPrivateFont(FX_BSTR bsFileName) = 0;
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index d8a2003548..f7e435d966 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -402,16 +402,15 @@ protected:
class IFX_ScanlineComposer
{
public:
+ virtual ~IFX_ScanlineComposer() { }
virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL) = 0;
-
virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0;
};
class CFX_ScanlineCompositor : public CFX_Object
{
public:
-
CFX_ScanlineCompositor();
~CFX_ScanlineCompositor();
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 8744919cf8..73292a0fd1 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -274,6 +274,7 @@ public:
class IFX_FontEnumerator
{
public:
+ virtual ~IFX_FontEnumerator() { }
virtual void HitFont() = 0;
@@ -282,6 +283,7 @@ public:
class IFX_AdditionalFontEnum
{
public:
+ virtual ~IFX_AdditionalFontEnum() { }
virtual int CountFiles() = 0;
virtual IFX_FileStream* GetFontFile(int index) = 0;
};
@@ -328,6 +330,7 @@ class IFX_SystemFontInfo : public CFX_Object
public:
static IFX_SystemFontInfo* CreateDefault();
virtual void Release() = 0;
+
virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0;
virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact) = 0;
virtual void* MapFontByUnicode(FX_DWORD dwUnicode, int weight, FX_BOOL bItalic, int pitch_family)
@@ -347,6 +350,8 @@ public:
{
return NULL;
}
+protected:
+ ~IFX_SystemFontInfo() { }
};
class CFX_FolderFontInfo : public IFX_SystemFontInfo
{
@@ -460,6 +465,9 @@ class IFX_GSUBTable
public:
virtual void Release() = 0;
virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
+
+protected:
+ ~IFX_GSUBTable() { }
};
IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont);
#endif
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index 82719ffda6..0c4bce8003 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -637,9 +637,11 @@ public:
class IFX_PSOutput
{
public:
-
- virtual void OutputPS(FX_LPCSTR string, int len) = 0;
virtual void Release() = 0;
+ virtual void OutputPS(FX_LPCSTR string, int len) = 0;
+
+protected:
+ ~IFX_PSOutput() { }
};
class CPSFont;
class CFX_PSRenderer : public CFX_Object
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index 42f77de57b..e317aa67fd 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -446,7 +446,7 @@ IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont)
if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->m_pGsubData)) {
return pGsubTable;
}
- delete pGsubTable;
+ pGsubTable->Release();
}
return NULL;
}
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index c381a01304..6b1b4f2443 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -414,6 +414,11 @@ public:
delete this;
}
virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) FX_OVERRIDE;
+
CFX_CTTGSUBTable m_GsubImp;
+
+private:
+ ~CFX_GSUBTable() { }
};
#endif
+
diff --git a/core/src/fpdfdoc/tagged_int.h b/core/src/fpdfdoc/tagged_int.h
index d190db6427..7efd682887 100644
--- a/core/src/fpdfdoc/tagged_int.h
+++ b/core/src/fpdfdoc/tagged_int.h
@@ -6,7 +6,9 @@
#ifndef _FPDF_TAGGED_INT_H_
#define _FPDF_TAGGED_INT_H_
-class CPDF_StructTreeImpl;
+
+#include "../../include/fpdfdoc/fpdf_tagged.h"
+
class CPDF_StructElementImpl;
class CPDF_StructTreeImpl : public CPDF_StructTree
{
@@ -36,7 +38,6 @@ class CPDF_StructElementImpl FX_FINAL : public CPDF_StructElement
{
public:
CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict);
- ~CPDF_StructElementImpl();
CPDF_StructTree* GetTree() const
{
return m_pTree;
@@ -79,13 +80,15 @@ public:
CPDF_StructElementImpl* Retain();
void Release();
protected:
+ ~CPDF_StructElementImpl();
+
CPDF_StructTreeImpl* m_pTree;
CFX_ByteString m_Type;
CPDF_StructElementImpl* m_pParent;
CPDF_Dictionary* m_pDict;
CFX_ArrayTemplate<CPDF_StructKid> m_Kids;
-
int m_RefCount;
+
friend class CPDF_StructTreeImpl;
};
#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Module.h b/core/src/fxcodec/jbig2/JBig2_Module.h
index 3a01eb094c..711cf4047b 100644
--- a/core/src/fxcodec/jbig2/JBig2_Module.h
+++ b/core/src/fxcodec/jbig2/JBig2_Module.h
@@ -10,6 +10,7 @@
class CJBig2_Module
{
public:
+ virtual ~CJBig2_Module() { }
virtual void *JBig2_Malloc(FX_DWORD dwSize) = 0;
diff --git a/core/src/fxcrt/fx_arabic.h b/core/src/fxcrt/fx_arabic.h
index e44bfb8142..f55f7c60cf 100644
--- a/core/src/fxcrt/fx_arabic.h
+++ b/core/src/fxcrt/fx_arabic.h
@@ -195,7 +195,9 @@ public:
virtual FX_BOOL EndChar() FX_OVERRIDE;
virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) FX_OVERRIDE;
virtual void Reset() FX_OVERRIDE;
-protected:
+
+private:
+ ~CFX_BidiChar() { }
FX_BOOL m_bSeparateNeutral;
FX_INT32 m_iCurStart;
FX_INT32 m_iCurCount;
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index 6aa9412f68..6f2b71b045 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -306,26 +306,28 @@ typedef int (*AI_COMPARE) (CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
class CPDFSDK_AnnotIterator
{
-protected:
- CPDFSDK_Annot* NextAnnot (const CPDFSDK_Annot* pCurrent) ;
- CPDFSDK_Annot* PrevAnnot (const CPDFSDK_Annot* pCurrent) ;
- CPDFSDK_Annot* NextAnnot(int& index ) ;
- CPDFSDK_Annot* PrevAnnot(int& index ) ;
public:
CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView, FX_BOOL bReverse,
- FX_BOOL bIgnoreTopmost=FALSE,FX_BOOL bCircle=FALSE,CFX_PtrArray* pList=NULL);
+ FX_BOOL bIgnoreTopmost=FALSE,FX_BOOL bCircle=FALSE,CFX_PtrArray* pList=NULL);
+ virtual ~CPDFSDK_AnnotIterator() { }
+
virtual CPDFSDK_Annot* Next (const CPDFSDK_Annot* pCurrent) ;
virtual CPDFSDK_Annot* Prev (const CPDFSDK_Annot* pCurrent) ;
virtual CPDFSDK_Annot* Next(int& index ) ;
virtual CPDFSDK_Annot* Prev(int& index ) ;
virtual int Count(){return m_pIteratorAnnotList.GetSize();}
-
+
virtual FX_BOOL InitIteratorAnnotList(CPDFSDK_PageView * pPageView,CFX_PtrArray* pList=NULL);
-
+
void InsertSort(CFX_PtrArray &arrayList, AI_COMPARE pCompare);
+
protected:
- // CFX_PtrList m_pIteratorAnnotList;
- CFX_PtrArray m_pIteratorAnnotList;
+ CPDFSDK_Annot* NextAnnot (const CPDFSDK_Annot* pCurrent) ;
+ CPDFSDK_Annot* PrevAnnot (const CPDFSDK_Annot* pCurrent) ;
+ CPDFSDK_Annot* NextAnnot(int& index ) ;
+ CPDFSDK_Annot* PrevAnnot(int& index ) ;
+
+ CFX_PtrArray m_pIteratorAnnotList;
FX_BOOL m_bReverse;
FX_BOOL m_bIgnoreTopmost;
FX_BOOL m_bCircle;
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h
index 95b9096159..a8cd711e11 100644
--- a/fpdfsdk/include/fxedit/fx_edit.h
+++ b/fpdfsdk/include/fxedit/fx_edit.h
@@ -44,6 +44,7 @@ class IFX_SystemHandler;
class IFX_Edit_FontMap
{
public:
+ virtual ~IFX_Edit_FontMap() { }
//map a fontindex to pdf font.
virtual CPDF_Font * GetPDFFont(FX_INT32 nFontIndex) = 0;
//get the alias of a pdf font.
@@ -58,8 +59,8 @@ public:
class IFX_Edit_Notify
{
- //this class is implemented by user
public:
+ virtual ~IFX_Edit_Notify() { }
//set the horizontal scrollbar information.
virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
FX_FLOAT fContentMin, FX_FLOAT fContentMax,
@@ -84,8 +85,9 @@ public:
class IFX_Edit_OprNotify
{
- //this class is implemented by user
public:
+ virtual ~IFX_Edit_OprNotify() { }
+
//OprType: 0
virtual void OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
//OprType: 1
@@ -143,10 +145,13 @@ public:
class IFX_Edit_UndoItem
{
public:
+ virtual void Release() = 0;
virtual void Undo() = 0;
virtual void Redo() = 0;
virtual CFX_WideString GetUndoTitle() = 0;
- virtual void Release() = 0;
+
+protected:
+ ~IFX_Edit_UndoItem() { }
};
class FXET_CLASS IFX_Edit
@@ -155,8 +160,7 @@ public:
static IFX_Edit* NewEdit();
static void DelEdit(IFX_Edit* pEdit);
-public:
- //set a IFX_Edit_FontMap pointer implemented by user.
+ //set a IFX_Edit_FontMap pointer implemented by user.
virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
//if user don't like to use FontMap, implement VTProvider and set it directly.
virtual void SetVTProvider(IPDF_VariableText_Provider* pProvider) = 0;
@@ -371,7 +375,6 @@ public:
virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0;
-public:
static CFX_ByteString GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
const CPVT_WordRange* pRange = NULL,
FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
@@ -388,12 +391,15 @@ public:
const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
static void GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color);
+
+protected:
+ ~IFX_Edit() { }
};
class IFX_List_Notify
{
- //this class is implemented by user
public:
+ virtual ~IFX_List_Notify() { }
//set the horizontal scrollbar information.
virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
FX_FLOAT fContentMin, FX_FLOAT fContentMax,
@@ -416,7 +422,6 @@ public:
static IFX_List* NewList();
static void DelList(IFX_List* pList);
-public:
virtual void SetFontMap(IFX_Edit_FontMap * pFontMap) = 0;
virtual void SetNotify(IFX_List_Notify * pNotify) = 0;
@@ -465,7 +470,10 @@ public:
virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
virtual void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
virtual FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+
+protected:
+ ~IFX_List() { }
};
-#endif
+#endif
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 7754537af2..fbd89d26f1 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -11,13 +11,13 @@ namespace v8 {
class Platform;
}
-class IFXJS_Context
+class IFXJS_Context
{
public:
+ virtual ~IFXJS_Context() { }
virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
-public:
virtual void OnApp_Init() = 0;
virtual void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName) = 0;
@@ -31,7 +31,7 @@ public:
virtual void OnPage_Close(CPDFSDK_Document* pTarget) = 0;
virtual void OnPage_InView(CPDFSDK_Document* pTarget) = 0;
virtual void OnPage_OutView(CPDFSDK_Document* pTarget) = 0;
-
+
virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
@@ -90,6 +90,9 @@ public:
virtual FX_BOOL IsEntered() = 0;
virtual FX_BOOL GetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue) = 0;
virtual FX_BOOL SetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue) = 0;
+
+protected:
+ ~IFXJS_Runtime() { }
};
class CPDFDoc_Environment;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h
index 6af324d5f7..f7d7b6f8f1 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h
@@ -14,6 +14,7 @@ class IPWL_SpellCheck;
class IPWL_Filler_Notify
{
public:
+ virtual ~IPWL_Filler_Notify() { }
virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax,
FX_INT32 & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top)
virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
index b13d5e1e79..c9d87b217c 100644
--- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
@@ -30,6 +30,7 @@ class CPWL_Edit;
class IPWL_Edit_Notify
{
public:
+ virtual ~IPWL_Edit_Notify() { }
//when the position of caret is changed in edit
virtual void OnCaretMove(FX_INT32 x1, FX_INT32 y1, FX_INT32 x2, FX_INT32 y2) {}
virtual void OnContentChange(const CPDF_Rect& rcContent){}
diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h
index effabd0713..6b3d577504 100644
--- a/fpdfsdk/include/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h
@@ -16,6 +16,7 @@ class CPWL_Label;
class IPWL_IconList_Notify
{
public:
+ virtual ~IPWL_IconList_Notify() { }
virtual void OnNoteListSelChanged(FX_INT32 nItemIndex) = 0;
};
diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h
index b3f73581b1..125271f48f 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Note.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Note.h
@@ -27,6 +27,7 @@ class IPopup_Note;
class IPWL_NoteNotify
{
public:
+ virtual ~IPWL_NoteNotify() { }
virtual void OnNoteMove(const FX_RECT& rtWin) = 0;
virtual void OnNoteShow(FX_BOOL bShow) = 0;
virtual void OnNoteActivate(FX_BOOL bActive) = 0;
@@ -45,12 +46,14 @@ public:
class IPWL_NoteHandler
{
public:
+ virtual ~IPWL_NoteHandler() { }
virtual void OnNoteColorChanged(const CPWL_Color& color) = 0;
};
class IPWL_NoteItem
{
public:
+ virtual ~IPWL_NoteItem() { }
virtual void SetPrivateData(void* pData) = 0;
virtual void SetBkColor(const CPWL_Color& color) = 0;
virtual void SetSubjectName(const CFX_WideString& sName) = 0;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
index c3dd9b7a70..51a3058993 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
@@ -168,6 +168,7 @@ inline FX_BOOL operator != (const CPWL_Color &c1, const CPWL_Color &c2)
class IPWL_SpellCheck
{
public:
+ virtual ~IPWL_SpellCheck() { }
virtual FX_BOOL CheckWord(FX_LPCSTR sWord) = 0;
virtual void SuggestWords(FX_LPCSTR sWord, CFX_ByteStringArray & sSuggest) = 0;
};
@@ -175,6 +176,8 @@ public:
class IPWL_Provider
{
public:
+ virtual ~IPWL_Provider() { }
+
//get a matrix which map user space to CWnd client space
virtual CPDF_Matrix GetWindowMatrix(void* pAttachedData) = 0;
@@ -193,6 +196,7 @@ public:
class IPWL_FocusHandler
{
public:
+ virtual ~IPWL_FocusHandler() { }
virtual void OnSetFocus(CPWL_Wnd* pWnd) = 0;
virtual void OnKillFocus(CPWL_Wnd* pWnd) = 0;
};
diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp
index 0e0114b372..f60dc9723e 100644
--- a/fpdfsdk/src/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp
@@ -75,6 +75,9 @@ public:
if (m_pInfo->DeleteFont)
m_pInfo->DeleteFont(m_pInfo, hFont);
}
+
+private:
+ ~CSysFontInfo_Ext() { }
};
DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper, const char* name, int charset)