summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fxedit
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-19 14:51:10 -0700
committerLei Zhang <thestig@chromium.org>2015-06-19 14:51:10 -0700
commitcfac954abcab7caf47d3fa3d641c553cba998271 (patch)
tree4cd546a2377e973fec54b75c1002c8c0ff321e8f /fpdfsdk/src/fxedit
parentdf558514bf5cb5750d5a7000a843f45f4170d5a4 (diff)
downloadpdfium-cfac954abcab7caf47d3fa3d641c553cba998271.tar.xz
Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004.
Diffstat (limited to 'fpdfsdk/src/fxedit')
-rw-r--r--fpdfsdk/src/fxedit/fxet_edit.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp
index 70d7b77553..8e109b5cf8 100644
--- a/fpdfsdk/src/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/src/fxedit/fxet_edit.cpp
@@ -971,19 +971,11 @@ CFX_Edit::CFX_Edit(IPDF_VariableText * pVT) :
CFX_Edit::~CFX_Edit()
{
- if (m_pVTProvide)
- {
- delete m_pVTProvide;
- m_pVTProvide = NULL;
- }
-
- if (m_pIterator)
- {
- delete m_pIterator;
- m_pIterator = NULL;
- }
-
- ASSERT(m_pGroupUndoItem == NULL);
+ delete m_pVTProvide;
+ m_pVTProvide = NULL;
+ delete m_pIterator;
+ m_pIterator = NULL;
+ ASSERT(m_pGroupUndoItem == NULL);
}
// public methods
@@ -997,10 +989,8 @@ void CFX_Edit::Initialize()
void CFX_Edit::SetFontMap(IFX_Edit_FontMap * pFontMap)
{
- if (m_pVTProvide)
- delete m_pVTProvide;
-
- m_pVT->SetProvider(m_pVTProvide = new CFX_Edit_Provider(pFontMap));
+ delete m_pVTProvide;
+ m_pVT->SetProvider(m_pVTProvide = new CFX_Edit_Provider(pFontMap));
}
void CFX_Edit::SetVTProvider(IPDF_VariableText_Provider* pProvider)