summaryrefslogtreecommitdiff
path: root/xfa/fee/fde_txtedtparag.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-17 13:42:51 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-17 13:42:51 -0700
commit8bdb290b9301200aeafa8b89678e690166ba1ce6 (patch)
treed4f6e474169f0a3ce1e435ac5571883bacb10f57 /xfa/fee/fde_txtedtparag.cpp
parent992def065be348d6f8157fab75aee312f5f45558 (diff)
downloadpdfium-8bdb290b9301200aeafa8b89678e690166ba1ce6.tar.xz
Remove Release() from IFX_CharIter, use unique_ptrs.chromium/2742chromium/2741
Review-Url: https://codereview.chromium.org/1986373002
Diffstat (limited to 'xfa/fee/fde_txtedtparag.cpp')
-rw-r--r--xfa/fee/fde_txtedtparag.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/xfa/fee/fde_txtedtparag.cpp b/xfa/fee/fde_txtedtparag.cpp
index f49f43147d..4f5b5a15df 100644
--- a/xfa/fee/fde_txtedtparag.cpp
+++ b/xfa/fee/fde_txtedtparag.cpp
@@ -37,8 +37,8 @@ void CFDE_TxtEdtParag::LoadParag() {
if (pParam->dwMode & FDE_TEXTEDITMODE_Password) {
wcAlias = m_pEngine->GetAliasChar();
}
- IFX_CharIter* pIter =
- new CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf, wcAlias);
+ std::unique_ptr<IFX_CharIter> pIter(
+ new CFDE_TxtEdtBufIter(static_cast<CFDE_TxtEdtBuf*>(pTxtBuf), wcAlias));
pIter->SetAt(m_nCharStart);
int32_t nEndIndex = m_nCharStart + m_nCharCount;
CFX_ArrayTemplate<int32_t> LineBaseArr;
@@ -71,7 +71,6 @@ void CFDE_TxtEdtParag::LoadParag() {
pIter->Next(TRUE);
}
} while (pIter->Next(FALSE) && (pIter->GetAt() < nEndIndex));
- pIter->Release();
pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pTxtBreak->ClearBreakPieces();
int32_t nLineCount = LineBaseArr.GetSize();
@@ -102,10 +101,11 @@ void CFDE_TxtEdtParag::UnloadParag() {
void CFDE_TxtEdtParag::CalcLines() {
CFX_TxtBreak* pTxtBreak = m_pEngine->GetTextBreak();
CFDE_TxtEdtBuf* pTxtBuf = m_pEngine->GetTextBuf();
- IFX_CharIter* pIter = new CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf);
int32_t nCount = 0;
uint32_t dwBreakStatus = FX_TXTBREAK_None;
int32_t nEndIndex = m_nCharStart + m_nCharCount;
+ std::unique_ptr<IFX_CharIter> pIter(
+ new CFDE_TxtEdtBufIter(static_cast<CFDE_TxtEdtBuf*>(pTxtBuf)));
pIter->SetAt(m_nCharStart);
FX_BOOL bReload = FALSE;
do {
@@ -129,7 +129,6 @@ void CFDE_TxtEdtParag::CalcLines() {
pIter->Next(TRUE);
}
} while (pIter->Next(FALSE) && (pIter->GetAt() < nEndIndex));
- pIter->Release();
pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pTxtBreak->ClearBreakPieces();
m_nLineCount = nCount;