summaryrefslogtreecommitdiff
path: root/xfa/fde
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-30 16:12:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-30 20:26:02 +0000
commit0bb1333a9eff1190ddd68f34c71d6a779c69dfef (patch)
tree5a46946c4852f147309e2b1389e6f42d6553abf7 /xfa/fde
parent908c848202ef137e98d96f82a4eadfae551403b7 (diff)
downloadpdfium-0bb1333a9eff1190ddd68f34c71d6a779c69dfef.tar.xz
Add some calls to MakeUnique
This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fde')
-rw-r--r--xfa/fde/cfde_txtedtpage.cpp6
-rw-r--r--xfa/fde/cfde_txtedtparag.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp
index ef16939116..122eb40f7d 100644
--- a/xfa/fde/cfde_txtedtpage.cpp
+++ b/xfa/fde/cfde_txtedtpage.cpp
@@ -215,7 +215,7 @@ int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF& fPoint, int32_t& nCount) {
if (nIndex < 0) {
return -1;
}
- std::unique_ptr<CFX_WordBreak> pIter(new CFX_WordBreak);
+ auto pIter = pdfium::MakeUnique<CFX_WordBreak>();
pIter->Attach(new CFDE_TxtEdtBuf::Iterator(pBuf));
pIter->SetAt(nIndex);
nCount = pIter->GetWordLength();
@@ -238,8 +238,8 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
if (pParams->dwMode & FDE_TEXTEDITMODE_Password) {
wcAlias = m_pEditEngine->GetAliasChar();
}
- m_pIter.reset(new CFDE_TxtEdtBuf::Iterator(static_cast<CFDE_TxtEdtBuf*>(pBuf),
- wcAlias));
+ m_pIter = pdfium::MakeUnique<CFDE_TxtEdtBuf::Iterator>(
+ static_cast<CFDE_TxtEdtBuf*>(pBuf), wcAlias);
CFX_TxtBreak* pBreak = m_pEditEngine->GetTextBreak();
pBreak->EndBreak(CFX_BreakType::Paragraph);
pBreak->ClearBreakPieces();
diff --git a/xfa/fde/cfde_txtedtparag.cpp b/xfa/fde/cfde_txtedtparag.cpp
index ceff448f2c..bcacc66695 100644
--- a/xfa/fde/cfde_txtedtparag.cpp
+++ b/xfa/fde/cfde_txtedtparag.cpp
@@ -43,8 +43,8 @@ void CFDE_TxtEdtParag::LoadParag() {
if (pParam->dwMode & FDE_TEXTEDITMODE_Password)
wcAlias = m_pEngine->GetAliasChar();
- std::unique_ptr<IFX_CharIter> pIter(new CFDE_TxtEdtBuf::Iterator(
- static_cast<CFDE_TxtEdtBuf*>(pTxtBuf), wcAlias));
+ auto pIter = pdfium::MakeUnique<CFDE_TxtEdtBuf::Iterator>(
+ static_cast<CFDE_TxtEdtBuf*>(pTxtBuf), wcAlias);
pIter->SetAt(m_nCharStart);
int32_t nEndIndex = m_nCharStart + m_nCharCount;
std::vector<int32_t> LineBaseArr;