diff options
author | tsepez <tsepez@chromium.org> | 2016-05-18 14:16:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-18 14:16:03 -0700 |
commit | 87144d3fc81769578fbfae89f7b99bab89229a57 (patch) | |
tree | 5b1a9b8d4b721a5dfbd91593a141d3c4e4256953 /xfa/fde/cfde_txtedtengine.cpp | |
parent | 0aae2a773cf51632b7808ab0e5b5c1635cf6a5fa (diff) | |
download | pdfium-87144d3fc81769578fbfae89f7b99bab89229a57.tar.xz |
Remove Release() from CFDE_TxtEdit* classes
Review-Url: https://codereview.chromium.org/1987223003
Diffstat (limited to 'xfa/fde/cfde_txtedtengine.cpp')
-rw-r--r-- | xfa/fde/cfde_txtedtengine.cpp | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index 3162d397ee..9781d60bf8 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -47,10 +47,7 @@ CFDE_TxtEdtEngine::CFDE_TxtEdtEngine() } CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() { - if (m_pTxtBuf) { - m_pTxtBuf->Release(); - m_pTxtBuf = NULL; - } + delete m_pTxtBuf; if (m_pTextBreak) { m_pTextBreak->Release(); m_pTextBreak = NULL; @@ -61,10 +58,6 @@ CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() { ClearSelection(); } -void CFDE_TxtEdtEngine::Release() { - delete this; -} - void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) { if (!m_pTextBreak) m_pTextBreak = new CFX_TxtBreak(FX_TXTBREAKPOLICY_None); @@ -994,21 +987,14 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() { } void CFDE_TxtEdtEngine::RemoveAllParags() { - int32_t nCount = m_ParagPtrArray.GetSize(); - for (int i = 0; i < nCount; ++i) + for (int32_t i = 0; i < m_ParagPtrArray.GetSize(); ++i) delete m_ParagPtrArray[i]; m_ParagPtrArray.RemoveAll(); } void CFDE_TxtEdtEngine::RemoveAllPages() { - int32_t nCount = m_PagePtrArray.GetSize(); - int32_t i = 0; - for (i = 0; i < nCount; i++) { - IFDE_TxtEdtPage* pPage = m_PagePtrArray[i]; - if (pPage) { - pPage->Release(); - } - } + for (int32_t i = 0; i < m_PagePtrArray.GetSize(); i++) + delete m_PagePtrArray[i]; m_PagePtrArray.RemoveAll(); } @@ -1043,10 +1029,7 @@ void CFDE_TxtEdtEngine::UpdatePages() { IFDE_TxtEdtPage* pPage = NULL; int32_t i = 0; for (i = nSize - 1; i >= nPageCount; i--) { - pPage = m_PagePtrArray[i]; - if (pPage) { - pPage->Release(); - } + delete m_PagePtrArray[i]; m_PagePtrArray.RemoveAt(i); } return; |