Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: xfa/fee/fde_txtedtengine.cpp

Issue 1986373002: Remove Release() from IFX_CharIter, use unique_ptrs. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nit Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fee/fde_txtedtbuf.cpp ('k') | xfa/fee/fde_txtedtpage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fee/fde_txtedtengine.cpp
diff --git a/xfa/fee/fde_txtedtengine.cpp b/xfa/fee/fde_txtedtengine.cpp
index 71f510205be4b5cc21a5f0c6456850fb605fe2c9..826f0ce62c70c1615c6bea0ece8fa33fa5a73b7a 100644
--- a/xfa/fee/fde_txtedtengine.cpp
+++ b/xfa/fee/fde_txtedtengine.cpp
@@ -954,7 +954,8 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() {
FX_WCHAR wChar = L' ';
int32_t nParagStart = 0;
int32_t nIndex = 0;
- IFX_CharIter* pIter = new CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf);
+ std::unique_ptr<IFX_CharIter> pIter(
+ new CFDE_TxtEdtBufIter(static_cast<CFDE_TxtEdtBuf*>(m_pTxtBuf)));
pIter->SetAt(0);
do {
wChar = pIter->GetChar();
@@ -968,7 +969,6 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() {
nParagStart = nIndex + 1;
}
} while (pIter->Next());
- pIter->Release();
}
void CFDE_TxtEdtEngine::RemoveAllParags() {
« no previous file with comments | « xfa/fee/fde_txtedtbuf.cpp ('k') | xfa/fee/fde_txtedtpage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698