From 0bb1333a9eff1190ddd68f34c71d6a779c69dfef Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 30 Mar 2017 16:12:02 -0400 Subject: 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 Reviewed-by: Tom Sepez --- xfa/fde/cfde_txtedtpage.cpp | 6 +++--- xfa/fde/cfde_txtedtparag.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'xfa/fde') 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 pIter(new CFX_WordBreak); + auto pIter = pdfium::MakeUnique(); 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(pBuf), - wcAlias)); + m_pIter = pdfium::MakeUnique( + static_cast(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 pIter(new CFDE_TxtEdtBuf::Iterator( - static_cast(pTxtBuf), wcAlias)); + auto pIter = pdfium::MakeUnique( + static_cast(pTxtBuf), wcAlias); pIter->SetAt(m_nCharStart); int32_t nEndIndex = m_nCharStart + m_nCharCount; std::vector LineBaseArr; -- cgit v1.2.3