summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/fsdk_baseform.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-17 16:38:51 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-17 16:38:51 -0700
commitff8347a4b16f000be628c5e10d03a1e1c17537eb (patch)
tree1d46e77a1ef6b28def6af3ffdd576017a6cfe229 /fpdfsdk/include/fsdk_baseform.h
parentc4d9f6ad2dc922b574862cd2f6f0a899d7e169e3 (diff)
downloadpdfium-ff8347a4b16f000be628c5e10d03a1e1c17537eb.tar.xz
Replace some Release() calls with virtual destructors.
A virtual method that does |delete this| is an anti-pattern. Some classes can be de-virtualized instead. Throw in some unique_ptrs and delete dead code for good measure. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1192013002.
Diffstat (limited to 'fpdfsdk/include/fsdk_baseform.h')
-rw-r--r--fpdfsdk/include/fsdk_baseform.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index ac0f72aef8..718ff60ab5 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -56,7 +56,7 @@ typedef struct _PDFSDK_FieldAction
FX_BOOL bFieldFull; //in
FX_BOOL bRC; //in[out]
}PDFSDK_FieldAction;
-class CPDFSDK_Widget:public CPDFSDK_Annot
+class CPDFSDK_Widget : public CPDFSDK_Annot
{
public:
CPDFSDK_Widget(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm);
@@ -170,14 +170,12 @@ private:
class CPDFSDK_InterForm : public CPDF_FormNotify
{
public:
- CPDFSDK_InterForm(CPDFSDK_Document* pDocument);
- virtual ~CPDFSDK_InterForm();
+ explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument);
+ ~CPDFSDK_InterForm() override;
-public:
- virtual void Destroy();
- virtual CPDF_InterForm* GetInterForm();
+ CPDF_InterForm* GetInterForm() const { return m_pInterForm; }
+ CPDFSDK_Document* GetDocument() const { return m_pDocument; }
- CPDFSDK_Document* GetDocument();
FX_BOOL HighlightWidgets();
CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const;