summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtengine.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-18 14:16:03 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-18 14:16:03 -0700
commit87144d3fc81769578fbfae89f7b99bab89229a57 (patch)
tree5b1a9b8d4b721a5dfbd91593a141d3c4e4256953 /xfa/fde/cfde_txtedtengine.cpp
parent0aae2a773cf51632b7808ab0e5b5c1635cf6a5fa (diff)
downloadpdfium-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.cpp27
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;